From afa8e873e9ba606a38b65b30f5ba87b357fd11e6 Mon Sep 17 00:00:00 2001 From: Wizjany Date: Wed, 14 Sep 2011 19:19:19 -0400 Subject: [PATCH] Reverted block id checking in BukkitWorld to prevent false positives and made LoclWorld use the internal list for easier updates --- src/main/java/com/sk89q/worldedit/LocalWorld.java | 3 ++- src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/LocalWorld.java b/src/main/java/com/sk89q/worldedit/LocalWorld.java index e9e65d05e..9b594d1d5 100644 --- a/src/main/java/com/sk89q/worldedit/LocalWorld.java +++ b/src/main/java/com/sk89q/worldedit/LocalWorld.java @@ -23,6 +23,7 @@ import java.util.Random; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BlockID; +import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldedit.regions.Region; @@ -434,7 +435,7 @@ public abstract class LocalWorld { * @return */ public boolean isValidBlockType(int type) { - return type >= 0 && type < 96; + return BlockType.fromID(type) != null; } /** diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index dc162ed02..2584ee4c3 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -670,7 +670,7 @@ public class BukkitWorld extends LocalWorld { */ @Override public boolean isValidBlockType(int type) { - return type <= 255 && (Material.getMaterial(type) != null || BlockType.fromID(type) != null); // Bukkit isn't always updated before WorldEdit is + return type <= 255 && Material.getMaterial(type) != null; } @Override