diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-11-20 00:01:14 -0800 |
---|---|---|
committer | Erik Broes <erikbroes@ripe.net> | 2011-11-20 00:01:33 -0800 |
commit | 345ea36c7bb3383c6e4825355d0043a646194eaa (patch) | |
tree | df116b57d92315c0a13c2fdc87d792b031c7239a /src/main/java/net/minecraft/server/BlockMushroom.java | |
parent | 589f66bd1b766dc1fdd737ee885304196a2ed86a (diff) | |
download | craftbukkit-345ea36c7bb3383c6e4825355d0043a646194eaa.tar craftbukkit-345ea36c7bb3383c6e4825355d0043a646194eaa.tar.gz craftbukkit-345ea36c7bb3383c6e4825355d0043a646194eaa.tar.lz craftbukkit-345ea36c7bb3383c6e4825355d0043a646194eaa.tar.xz craftbukkit-345ea36c7bb3383c6e4825355d0043a646194eaa.zip |
Update for 1.0.0
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockMushroom.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockMushroom.java | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java index 775d7e18..37bfe158 100644 --- a/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java @@ -14,7 +14,7 @@ public class BlockMushroom extends BlockFlower { } public void a(World world, int i, int j, int k, Random random) { - if (random.nextInt(100) == 0) { + if (random.nextInt(25) == 0) { byte b0 = 4; int l = 5; @@ -68,44 +68,37 @@ public class BlockMushroom extends BlockFlower { } } - protected boolean c(int i) { + protected boolean d(int i) { return Block.o[i]; } public boolean f(World world, int i, int j, int k) { - if (j >= 0) { - world.getClass(); - if (j < 128) { - return world.k(i, j, k) < 13 && this.c(world.getTypeId(i, j - 1, k)); - } - } + if (j >= 0 && j < world.height) { + int l = world.getTypeId(i, j - 1, k); - return false; + return l == Block.MYCEL.id || world.k(i, j, k) < 13 && this.d(l); + } else { + return false; + } } public boolean b(World world, int i, int j, int k, Random random) { - int l = world.getTypeId(i, j - 1, k); + int l = world.getData(i, j, k); - if (l != Block.DIRT.id && l != Block.GRASS.id) { - return false; - } else { - int i1 = world.getData(i, j, k); + world.setRawTypeId(i, j, k, 0); + WorldGenHugeMushroom worldgenhugemushroom = null; - world.setRawTypeId(i, j, k, 0); - WorldGenHugeMushroom worldgenhugemushroom = null; - - if (this.id == Block.BROWN_MUSHROOM.id) { - worldgenhugemushroom = new WorldGenHugeMushroom(0); - } else if (this.id == Block.RED_MUSHROOM.id) { - worldgenhugemushroom = new WorldGenHugeMushroom(1); - } + if (this.id == Block.BROWN_MUSHROOM.id) { + worldgenhugemushroom = new WorldGenHugeMushroom(0); + } else if (this.id == Block.RED_MUSHROOM.id) { + worldgenhugemushroom = new WorldGenHugeMushroom(1); + } - if (worldgenhugemushroom != null && worldgenhugemushroom.a(world, random, i, j, k)) { - return true; - } else { - world.setRawTypeIdAndData(i, j, k, this.id, i1); - return false; - } + if (worldgenhugemushroom != null && worldgenhugemushroom.a(world, random, i, j, k)) { + return true; + } else { + world.setRawTypeIdAndData(i, j, k, this.id, l); + return false; } } } |