summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockLeaves.java
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-03-01 10:49:23 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-03-01 14:38:31 +0000
commit543c4879fee3b7165764c5371d226c93fe3a657b (patch)
tree4fe9116464e1fe42a40dc3ba19b58234bd26f821 /src/main/java/net/minecraft/server/BlockLeaves.java
parente9ca87000c1794715bc3fe0a7d1caaf809057635 (diff)
downloadcraftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.gz
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.lz
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.xz
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.zip
Updated CraftBukkit to 1.2
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockLeaves.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockLeaves.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java
index 1538397a..1f2590b6 100644
--- a/src/main/java/net/minecraft/server/BlockLeaves.java
+++ b/src/main/java/net/minecraft/server/BlockLeaves.java
@@ -139,14 +139,27 @@ public class BlockLeaves extends BlockTransparant {
}
public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
- super.dropNaturally(world, i, j, k, l, f, i1);
- if (!world.isStatic && (l & 3) == 0 && world.random.nextInt(200) == 0) {
- this.a(world, i, j, k, new ItemStack(Item.APPLE, 1, 0));
+ if (!world.isStatic) {
+ byte b0 = 20;
+
+ if ((l & 3) == 3) {
+ b0 = 40;
+ }
+
+ if (world.random.nextInt(b0) == 0) {
+ int j1 = this.getDropType(l, world.random, i1);
+
+ this.a(world, i, j, k, new ItemStack(j1, 1, this.getDropData(l)));
+ }
+
+ if ((l & 3) == 0 && world.random.nextInt(200) == 0) {
+ this.a(world, i, j, k, new ItemStack(Item.APPLE, 1, 0));
+ }
}
}
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
- if (!world.isStatic && entityhuman.Q() != null && entityhuman.Q().id == Item.SHEARS.id) {
+ if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
entityhuman.a(StatisticList.C[this.id], 1);
this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
} else {
@@ -163,7 +176,7 @@ public class BlockLeaves extends BlockTransparant {
}
public int a(int i, int j) {
- return (j & 3) == 1 ? this.textureId + 80 : this.textureId;
+ return (j & 3) == 1 ? this.textureId + 80 : ((j & 3) == 3 ? this.textureId + 144 : this.textureId);
}
public void b(World world, int i, int j, int k, Entity entity) {