diff options
author | zml2008 <zach@zachsthings.com> | 2012-03-13 19:38:39 -0700 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-21 20:32:17 -0400 |
commit | 8aee4c3f563f8a6e5e2f5b3233c25097487bf6c4 (patch) | |
tree | 93b30ead7171fb8bc06644f0bb7a30d8aab31b78 /src/main/java/net/minecraft/server/WorldGenSwampTree.java | |
parent | 27acb4c41e118a696b001770a16bd84020a26f36 (diff) | |
download | craftbukkit-8aee4c3f563f8a6e5e2f5b3233c25097487bf6c4.tar craftbukkit-8aee4c3f563f8a6e5e2f5b3233c25097487bf6c4.tar.gz craftbukkit-8aee4c3f563f8a6e5e2f5b3233c25097487bf6c4.tar.lz craftbukkit-8aee4c3f563f8a6e5e2f5b3233c25097487bf6c4.tar.xz craftbukkit-8aee4c3f563f8a6e5e2f5b3233c25097487bf6c4.zip |
[Bleeding] Added support for all TreeType entries to CraftWorld.generateTree(). Addresses BUKKIT-1161
Diffstat (limited to 'src/main/java/net/minecraft/server/WorldGenSwampTree.java')
-rw-r--r-- | src/main/java/net/minecraft/server/WorldGenSwampTree.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/WorldGenSwampTree.java b/src/main/java/net/minecraft/server/WorldGenSwampTree.java index ae4f5446..aac4c035 100644 --- a/src/main/java/net/minecraft/server/WorldGenSwampTree.java +++ b/src/main/java/net/minecraft/server/WorldGenSwampTree.java @@ -2,14 +2,18 @@ package net.minecraft.server; import java.util.Random; -public class WorldGenSwampTree extends WorldGenerator { +public class WorldGenSwampTree extends WorldGenerator implements BlockSapling.TreeGenerator { // CraftBukkit - add interface public WorldGenSwampTree() {} public boolean a(World world, Random random, int i, int j, int k) { + return generate((org.bukkit.BlockChangeDelegate) world, random, i, j, k); + } + + public boolean generate(org.bukkit.BlockChangeDelegate world, Random random, int i, int j, int k) { int l; - for (l = random.nextInt(4) + 5; world.getMaterial(i, j - 1, k) == Material.WATER; --j) { + for (l = random.nextInt(4) + 5; world.getTypeId(i, j - 1, k) != 0 && Block.byId[world.getTypeId(i, j - 1, k)].material == Material.WATER; --j) { // CraftBukkit - bypass World.getMaterial ; } @@ -121,7 +125,7 @@ public class WorldGenSwampTree extends WorldGenerator { } } - private void a(World world, int i, int j, int k, int l) { + private void a(org.bukkit.BlockChangeDelegate world, int i, int j, int k, int l) { // CraftBukkit - change signature world.setTypeIdAndData(i, j, k, Block.VINE.id, l); int i1 = 4; |