diff --git a/src/HMWorld.java b/src/HMWorld.java index 3c0d3be96..63d8390cd 100644 --- a/src/HMWorld.java +++ b/src/HMWorld.java @@ -18,6 +18,7 @@ */ import java.util.Random; +import java.util.logging.Level; import java.util.logging.Logger; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalWorld; @@ -279,8 +280,26 @@ public boolean generateTree(EditSession editSession, Vector pt) { try { return MinecraftServerInterface.generateTree(editSession, pt); } catch (Throwable t) { - logger.severe("Failed to create tree (do you need to update WorldEdit due to a Minecraft update?): " - + t.getMessage()); + logger.log(Level.SEVERE, + "Failed to create tree (do you need to update WorldEdit " + + "due to a Minecraft update?)", t); + return false; + } + } + + /** + * Generate a big tree at a location. + * + * @param pt + * @return + */ + public boolean generateBigTree(EditSession editSession, Vector pt) { + try { + return MinecraftServerInterface.generateBigTree(editSession, pt); + } catch (Throwable t) { + logger.log(Level.SEVERE, + "Failed to create big tree (do you need to update WorldEdit " + + "due to a Minecraft update?)", t); return false; } } diff --git a/src/MinecraftServerInterface.java b/src/MinecraftServerInterface.java index a1db0c1ea..95a59f29c 100644 --- a/src/MinecraftServerInterface.java +++ b/src/MinecraftServerInterface.java @@ -43,12 +43,13 @@ public class MinecraftServerInterface { private static MinecraftSetBlockProxy proxy; /** - * Generate a tree at a location. + * Perform world generation at a location. * * @param pt * @return */ - public static boolean generateTree(EditSession editSession, Vector pt) { + private static boolean performWorldGen(EditSession editSession, Vector pt, + bt worldGen) { if (proxy == null) { try { proxy = createNoConstructor(MinecraftSetBlockProxy.class); @@ -60,11 +61,31 @@ public static boolean generateTree(EditSession editSession, Vector pt) { } proxy.setEditSession(editSession); - bt treeGen = new ib(); - return treeGen.a(proxy, random, + bt gen = worldGen; + return gen.a(proxy, random, pt.getBlockX(), pt.getBlockY() + 1, pt.getBlockZ()); } + /** + * Generate a tree at a location. + * + * @param pt + * @return + */ + public static boolean generateTree(EditSession editSession, Vector pt) { + return performWorldGen(editSession, pt, new kl()); + } + + /** + * Generate a big tree at a location. + * + * @param pt + * @return + */ + public static boolean generateBigTree(EditSession editSession, Vector pt) { + return performWorldGen(editSession, pt, new ib()); + } + /** * Get mob spawner mob type. May return an empty string. * diff --git a/src/com/sk89q/worldedit/EditSession.java b/src/com/sk89q/worldedit/EditSession.java index e20049ec5..43869e441 100755 --- a/src/com/sk89q/worldedit/EditSession.java +++ b/src/com/sk89q/worldedit/EditSession.java @@ -1863,7 +1863,7 @@ public int makeForest(Vector basePos, int size, double density, if (pineTree) { makePineTree(new Vector(x, y + 1, z)); } else { - world.generateTree(this, new Vector(x, y + 1, z)); + world.generateBigTree(this, new Vector(x, y + 1, z)); } affected++; break; diff --git a/src/com/sk89q/worldedit/LocalWorld.java b/src/com/sk89q/worldedit/LocalWorld.java index 59c4956a5..ad0d4e2be 100644 --- a/src/com/sk89q/worldedit/LocalWorld.java +++ b/src/com/sk89q/worldedit/LocalWorld.java @@ -128,6 +128,14 @@ public abstract void setMobSpawnerType(Vector pt, */ public abstract boolean generateTree(EditSession editSession, Vector pt); + /** + * Generate a big tree at a location. + * + * @param pt + * @return + */ + public abstract boolean generateBigTree(EditSession editSession, Vector pt); + /** * Drop an item. * diff --git a/src/com/sk89q/worldedit/WorldEditController.java b/src/com/sk89q/worldedit/WorldEditController.java index 3b9715ca5..7e47006cf 100644 --- a/src/com/sk89q/worldedit/WorldEditController.java +++ b/src/com/sk89q/worldedit/WorldEditController.java @@ -134,6 +134,7 @@ public WorldEditController(ServerInterface server, LocalConfiguration config) { commands.put("/none", "Switch to no tool"); commands.put("/info", "Switch to the info tool"); commands.put("/tree", "Switch to the tree tool"); + commands.put("/bigtree", "Switch to the big tree tool"); commands.put("/repl", "[ID] - Switch to the block replacer tool"); commands.put("//expand", "[Num]