From d5831ea37b18e7edc242299467360e947fc53704 Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 24 Dec 2013 18:15:24 -0500 Subject: [PATCH] Added 1.7.2 biomes and trees. --- pom.xml | 2 +- .../worldedit/bukkit/BukkitBiomeType.java | 40 ++++++++++++++++++- .../sk89q/worldedit/bukkit/BukkitWorld.java | 9 +---- .../sk89q/worldedit/util/TreeGenerator.java | 11 ++++- 4 files changed, 51 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index ad0bec651..b44dc371b 100644 --- a/pom.xml +++ b/pom.xml @@ -116,7 +116,7 @@ org.bukkit bukkit - 1.5.1-R0.2 + 1.7.2-R0.2 compile jar true diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeType.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeType.java index 6028721d6..8430fbc29 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeType.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeType.java @@ -30,7 +30,45 @@ public enum BukkitBiomeType implements BiomeType { TAIGA_HILLS(Biome.TAIGA_HILLS), SMALL_MOUNTAINS(Biome.SMALL_MOUNTAINS), JUNGLE(Biome.JUNGLE), - JUNGLE_HILLS(Biome.JUNGLE_HILLS); + JUNGLE_HILLS(Biome.JUNGLE_HILLS), + JUNGLE_EDGE(Biome.JUNGLE_EDGE), + DEEP_OCEAN(Biome.DEEP_OCEAN), + STONE_BEACH(Biome.STONE_BEACH), + COLD_BEACH(Biome.COLD_BEACH), + BIRCH_FOREST(Biome.BIRCH_FOREST), + BIRCH_FOREST_HILLS(Biome.BIRCH_FOREST_HILLS), + ROOFED_FOREST(Biome.ROOFED_FOREST), + COLD_TAIGA(Biome.COLD_TAIGA), + COLD_TAIGA_HILLS(Biome.COLD_TAIGA_HILLS), + MEGA_TAIGA(Biome.MEGA_TAIGA), + MEGA_TAIGA_HILLS(Biome.MEGA_TAIGA_HILLS), + EXTREME_HILLS_PLUS(Biome.EXTREME_HILLS_PLUS), + SAVANNA(Biome.SAVANNA), + SAVANNA_PLATEAU(Biome.SAVANNA_PLATEAU), + MESA(Biome.MESA), + MESA_PLATEAU_FOREST(Biome.MESA_PLATEAU_FOREST), + MESA_PLATEAU(Biome.MESA_PLATEAU), + SUNFLOWER_PLAINS(Biome.SUNFLOWER_PLAINS), + DESERT_MOUNTAINS(Biome.DESERT_MOUNTAINS), + FLOWER_FOREST(Biome.FLOWER_FOREST), + TAIGA_MOUNTAINS(Biome.TAIGA_MOUNTAINS), + SWAMPLAND_MOUNTAINS(Biome.SWAMPLAND_MOUNTAINS), + ICE_PLAINS_SPIKES(Biome.ICE_PLAINS_SPIKES), + JUNGLE_MOUNTAINS(Biome.JUNGLE_MOUNTAINS), + JUNGLE_EDGE_MOUNTAINS(Biome.JUNGLE_EDGE_MOUNTAINS), + COLD_TAIGA_MOUNTAINS(Biome.COLD_TAIGA_MOUNTAINS), + SAVANNA_MOUNTAINS(Biome.SAVANNA_MOUNTAINS), + SAVANNA_PLATEAU_MOUNTAINS(Biome.SAVANNA_PLATEAU_MOUNTAINS), + MESA_BRYCE(Biome.MESA_BRYCE), + MESA_PLATEAU_FOREST_MOUNTAINS(Biome.MESA_PLATEAU_FOREST_MOUNTAINS), + MESA_PLATEAU_MOUNTAINS(Biome.MESA_PLATEAU_MOUNTAINS), + BIRCH_FOREST_MOUNTAINS(Biome.BIRCH_FOREST_MOUNTAINS), + BIRCH_FOREST_HILLS_MOUNTAINS(Biome.BIRCH_FOREST_HILLS_MOUNTAINS), + ROOFED_FOREST_MOUNTAINS(Biome.ROOFED_FOREST_MOUNTAINS), + MEGA_SPRUCE_TAIGA(Biome.MEGA_SPRUCE_TAIGA), + EXTREME_HILLS_MOUNTAINS(Biome.EXTREME_HILLS_MOUNTAINS), + EXTREME_HILLS_PLUS_MOUNTAINS(Biome.EXTREME_HILLS_PLUS_MOUNTAINS), + MEGA_SPRUCE_TAIGA_HILLS(Biome.MEGA_SPRUCE_TAIGA_HILLS); private Biome bukkitBiome; diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 680715248..b79374498 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -876,14 +876,6 @@ public class BukkitWorld extends LocalWorld { new EnumMap(TreeGenerator.TreeType.class); static { - // Mappings for new TreeType values not yet in Bukkit - treeTypeMapping.put(TreeGenerator.TreeType.SWAMP, TreeType.TREE); - treeTypeMapping.put(TreeGenerator.TreeType.JUNGLE_BUSH, TreeType.TREE); - try { - treeTypeMapping.put(TreeGenerator.TreeType.SHORT_JUNGLE, TreeType.valueOf("SMALL_JUNGLE")); - } catch (IllegalArgumentException e) { - treeTypeMapping.put(TreeGenerator.TreeType.SHORT_JUNGLE, TreeType.TREE); - } for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { try { TreeType bukkitType = TreeType.valueOf(type.name()); @@ -893,6 +885,7 @@ public class BukkitWorld extends LocalWorld { } } // Other mappings for WE-specific values + treeTypeMapping.put(TreeGenerator.TreeType.SHORT_JUNGLE, TreeType.SMALL_JUNGLE); treeTypeMapping.put(TreeGenerator.TreeType.RANDOM, TreeType.BROWN_MUSHROOM); treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_REDWOOD, TreeType.REDWOOD); treeTypeMapping.put(TreeGenerator.TreeType.PINE, TreeType.REDWOOD); diff --git a/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index bb7eb9d1e..6a3754607 100644 --- a/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -56,11 +56,20 @@ public class TreeGenerator { } }, JUNGLE("Jungle", "jungle"), - SHORT_JUNGLE("Short jungle", "shortjungle", "smalljungle"), + SMALL_JUNGLE("Small jungle", "shortjungle", "smalljungle"), + SHORT_JUNGLE("Short jungle") { + public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException { + return SMALL_JUNGLE.generate(editSession, pos); + } + }, JUNGLE_BUSH("Jungle bush", "junglebush", "jungleshrub"), RED_MUSHROOM("Red Mushroom", "redmushroom", "redgiantmushroom"), BROWN_MUSHROOM("Brown Mushroom", "brownmushroom", "browngiantmushroom"), SWAMP("Swamp", "swamp", "swamptree"), + ACACIA("Acacia", "acacia"), + DARK_OAK("Dark Oak", "darkoak"), + MEGA_REDWOOD("Mega Redwood", "megaredwood"), + TALL_BIRCH("Tall Birch", "tallbirch"), RANDOM("Random", "rand", "random" ) { public boolean generate(EditSession editSession, Vector pos) throws MaxChangedBlocksException { TreeType[] choices = new TreeType[] {