From c99d64cfa03a25851d6a0190b79cbeb8f4bf3b98 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Tue, 16 Aug 2011 22:29:06 -0700 Subject: [PATCH] Removed unnecessary valid block checking (already in LocalWorld) --- src/main/java/com/sk89q/worldedit/ServerInterface.java | 10 ---------- src/main/java/com/sk89q/worldedit/WorldEdit.java | 2 +- .../sk89q/worldedit/bukkit/BukkitServerInterface.java | 5 ----- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/ServerInterface.java b/src/main/java/com/sk89q/worldedit/ServerInterface.java index f66e512ed..112ffd8dd 100644 --- a/src/main/java/com/sk89q/worldedit/ServerInterface.java +++ b/src/main/java/com/sk89q/worldedit/ServerInterface.java @@ -40,16 +40,6 @@ public abstract class ServerInterface { */ public abstract boolean isValidMobType(String type); - /** - * Returns whether a block has a valid ID. - * - * @param type - * @return - */ - public boolean isValidBlockType(int type) { - return !((type > 32 && type < 35) || type == 36 || type == 29 || type > 96); - } - /** * Reload WorldEdit configuration. */ diff --git a/src/main/java/com/sk89q/worldedit/WorldEdit.java b/src/main/java/com/sk89q/worldedit/WorldEdit.java index a031def65..31cac1724 100644 --- a/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -289,7 +289,7 @@ public class WorldEdit { blockId = blockType.getID(); } - if (!server.isValidBlockType(blockId)) { + if (!player.getWorld().isValidBlockType(blockId)) { throw new UnknownItemException(arg); } diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index 6cbcf4627..32739e9f3 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -42,11 +42,6 @@ public class BukkitServerInterface extends ServerInterface { public boolean isValidMobType(String type) { return CreatureType.fromName(type) != null; } - - @Override - public boolean isValidBlockType(int type) { - return Material.getMaterial(type) != null; - } @Override public void reload() {