From 8c2169f21c39627b09f37b71c1069ab861816007 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 25 Dec 2010 20:41:25 -0800 Subject: [PATCH] Updated WorldEdit for beta. --- src/MinecraftServerInterface.java | 20 +++++++++++++++++++- src/MinecraftSetBlockProxy.java | 2 +- src/ServerInterface.java | 14 ++++++-------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/MinecraftServerInterface.java b/src/MinecraftServerInterface.java index 363765e11..2f4b2f49a 100644 --- a/src/MinecraftServerInterface.java +++ b/src/MinecraftServerInterface.java @@ -60,11 +60,29 @@ public class MinecraftServerInterface { } proxy.setEditSession(editSession); - bj treeGen = new he(); + bt treeGen = new ib(); return treeGen.a(proxy, random, pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); } + /** + * Get mob spawner mob type. May return an empty string. + * + * @param pt + * @param mobType + */ + public static String getMobSpawnerType(Vector pt) { + bg o = etc.getMCServer().e.l( + pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); + + if (o != null && o instanceof cq) { + String type = ((cq)o).f; + return type != null ? type : ""; + } + + return ""; + } + /** * Instantiate a class without calling its constructor. * diff --git a/src/MinecraftSetBlockProxy.java b/src/MinecraftSetBlockProxy.java index 4476c2a38..96c91cca1 100644 --- a/src/MinecraftSetBlockProxy.java +++ b/src/MinecraftSetBlockProxy.java @@ -26,7 +26,7 @@ import com.sk89q.worldedit.blocks.BaseBlock; * * @author sk89q */ -public class MinecraftSetBlockProxy extends eq { +public class MinecraftSetBlockProxy extends ff { /** * Edit session. */ diff --git a/src/ServerInterface.java b/src/ServerInterface.java index 8bd81e7ed..cae88f2dc 100644 --- a/src/ServerInterface.java +++ b/src/ServerInterface.java @@ -233,15 +233,13 @@ public class ServerInterface { * @param mobType */ public static String getMobSpawnerType(Vector pt) { - ay o = etc.getMCServer().e.k( - pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); - - if (o != null && o instanceof cf) { - String type = ((cf)o).f; - return type != null ? type : ""; + try { + return MinecraftServerInterface.getMobSpawnerType(pt); + } catch (Throwable t) { + logger.severe("Failed to get mob spawner type (do you need to update WorldEdit due to a Minecraft update?): " + + t.getMessage()); + return ""; } - - return ""; } /**