From e2c17cbf46fa9b64ca1c674e41fb7c28b1c8a57d Mon Sep 17 00:00:00 2001 From: Wizjany Date: Wed, 11 May 2011 20:04:29 -0400 Subject: [PATCH] Added yet another method to BlockType (rails) --- .../java/com/sk89q/worldedit/blocks/BlockType.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 94f844219..61d86acec 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -520,6 +520,18 @@ public enum BlockType { || id == 77; // Button } + /** + * Checks if the id is that of one of the rail types + * + * @param id + * @return + */ + public static boolean isRailBlock(int id) { + return id == 27 // Powered rail + || id == 28 // Detector rail + || id == 66; // Normal rail + } + /** * Get the block or item that would have been dropped. If nothing is * dropped, 0 will be returned. If the block should not be destroyed