From 43f9e517e77aa928ac7fb0441987e0bbecd86ecc Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Sun, 23 Jun 2013 21:05:45 +0200 Subject: [PATCH] BlockType adjustments - Flagged all snow layers except single layers (data values 0 and 8) as "cannot be passed through". - Fixed centralTopLimit for trap doors and fence gates and cake blocks with data values 6..15. --- .../com/sk89q/worldedit/blocks/BlockType.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 8f9e2f53b..f3f77955e 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -437,7 +437,8 @@ public enum BlockType { canPassThrough.add(BlockID.REDSTONE_TORCH_OFF); canPassThrough.add(BlockID.REDSTONE_TORCH_ON); canPassThrough.add(BlockID.STONE_BUTTON); - canPassThrough.add(BlockID.SNOW); + canPassThrough.add(-16*BlockID.SNOW-0); + canPassThrough.add(-16*BlockID.SNOW-8); canPassThrough.add(BlockID.REED); canPassThrough.add(BlockID.PORTAL); canPassThrough.add(BlockID.REDSTONE_REPEATER_OFF); @@ -512,6 +513,9 @@ public enum BlockType { centralTopLimit.put(BlockID.BED, 0.5625); centralTopLimit.put(BlockID.BREWING_STAND, 0.875); centralTopLimit.put(BlockID.CAKE_BLOCK, 0.4375); + for (int data = 6; data < 16; ++data) { + centralTopLimit.put(-16*BlockID.CAKE_BLOCK-data, 0.0); + } centralTopLimit.put(BlockID.CAULDRON, 0.3125); centralTopLimit.put(BlockID.COCOA_PLANT, 0.750); centralTopLimit.put(BlockID.ENCHANTMENT_TABLE, 0.75); @@ -524,13 +528,10 @@ public enum BlockType { } centralTopLimit.put(-16*BlockID.HEAD-data, 0.75); } - // Default value to be used if no data value is given - centralTopLimit.put(BlockID.HEAD, 0.75); // Heads on the floor are lower centralTopLimit.put(-16*BlockID.HEAD-1, 0.5); centralTopLimit.put(-16*BlockID.HEAD-9, 0.5); centralTopLimit.put(BlockID.FENCE, 1.5); - centralTopLimit.put(BlockID.FENCE_GATE, 1.5); for (int data = 0; data < 8; ++data) { centralTopLimit.put(-16*BlockID.STEP-data, 0.5); centralTopLimit.put(-16*BlockID.WOODEN_STEP-data, 0.5); @@ -540,13 +541,28 @@ public enum BlockType { centralTopLimit.put(BlockID.LILY_PAD, 0.015625); centralTopLimit.put(BlockID.REDSTONE_REPEATER_ON, .125); centralTopLimit.put(BlockID.REDSTONE_REPEATER_OFF, .125); - centralTopLimit.put(BlockID.TRAP_DOOR, 0.1875); + for (int data = 0; data < 4; ++data) { + centralTopLimit.put(-16*BlockID.TRAP_DOOR-(data+ 0), 0.1875); // closed lower trap doors + centralTopLimit.put(-16*BlockID.TRAP_DOOR-(data+ 4), 0.0); // opened lower trap doors + centralTopLimit.put(-16*BlockID.TRAP_DOOR-(data+ 8), 1.0); // closed upper trap doors + centralTopLimit.put(-16*BlockID.TRAP_DOOR-(data+12), 0.0); // opened upper trap doors + + centralTopLimit.put(-16*BlockID.FENCE_GATE-(data+ 0), 1.5); + centralTopLimit.put(-16*BlockID.FENCE_GATE-(data+ 4), 0.0); + centralTopLimit.put(-16*BlockID.FENCE_GATE-(data+ 8), 1.5); + centralTopLimit.put(-16*BlockID.FENCE_GATE-(data+12), 0.0); + } centralTopLimit.put(BlockID.SLOW_SAND, 0.875); centralTopLimit.put(BlockID.COBBLESTONE_WALL, 1.5); centralTopLimit.put(BlockID.FLOWER_POT, 0.375); centralTopLimit.put(BlockID.COMPARATOR_OFF, .125); centralTopLimit.put(BlockID.COMPARATOR_ON, .125); centralTopLimit.put(BlockID.DAYLIGHT_SENSOR, 0.375); + + // Some default values to be used if no data value is given + centralTopLimit.put(BlockID.HEAD, 0.75); + centralTopLimit.put(BlockID.TRAP_DOOR, 1.0); + centralTopLimit.put(BlockID.FENCE_GATE, 1.5); } /**