summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockLeaves.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockLeaves.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockLeaves.java82
1 files changed, 43 insertions, 39 deletions
diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java
index efbf2a10..1bf3eb1b 100644
--- a/src/main/java/net/minecraft/server/BlockLeaves.java
+++ b/src/main/java/net/minecraft/server/BlockLeaves.java
@@ -30,8 +30,10 @@ public class BlockLeaves extends BlockLeavesBase {
for (int l1 = -l; l1 <= l; l1++) {
int i2 = world.a(i + j1, j + k1, k + l1);
- if (i2 == Block.K.bh) {
- world.c(i + j1, j + k1, k + l1, 7);
+ if (i2 == Block.K.bi) {
+ int j2 = world.b(i + j1, j + k1, k + l1);
+
+ world.d(i + j1, j + k1, k + l1, j2 | 4);
}
}
}
@@ -43,69 +45,71 @@ public class BlockLeaves extends BlockLeavesBase {
if (world.z) {
return;
}
- if (world.b(i, j, k) == 7) {
+ int l = world.b(i, j, k);
+
+ if ((l & 4) != 0) {
byte byte0 = 4;
- int l = byte0 + 1;
+ int i1 = byte0 + 1;
byte byte1 = 32;
- int i1 = byte1 * byte1;
- int j1 = byte1 / 2;
+ int j1 = byte1 * byte1;
+ int k1 = byte1 / 2;
if (b == null) {
b = new int[byte1 * byte1 * byte1];
}
- if (world.a(i - l, j - l, k - l, i + l, j + l, k + l)) {
- for (int k1 = -byte0; k1 <= byte0; k1++) {
- for (int j2 = -byte0; j2 <= byte0; j2++) {
- for (int l2 = -byte0; l2 <= byte0; l2++) {
- int j3 = world.a(i + k1, j + j2, k + l2);
-
- if (j3 == Block.J.bh) {
- b[(k1 + j1) * i1 + (j2 + j1) * byte1 + (l2 + j1)] = 0;
+ if (world.a(i - i1, j - i1, k - i1, i + i1, j + i1, k + i1)) {
+ for (int l1 = -byte0; l1 <= byte0; l1++) {
+ for (int k2 = -byte0; k2 <= byte0; k2++) {
+ for (int i3 = -byte0; i3 <= byte0; i3++) {
+ int k3 = world.a(i + l1, j + k2, k + i3);
+
+ if (k3 == Block.J.bi) {
+ b[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = 0;
continue;
}
- if (j3 == Block.K.bh) {
- b[(k1 + j1) * i1 + (j2 + j1) * byte1 + (l2 + j1)] = -2;
+ if (k3 == Block.K.bi) {
+ b[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -2;
} else {
- b[(k1 + j1) * i1 + (j2 + j1) * byte1 + (l2 + j1)] = -1;
+ b[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -1;
}
}
}
}
- for (int l1 = 1; l1 <= 4; l1++) {
- for (int k2 = -byte0; k2 <= byte0; k2++) {
- for (int i3 = -byte0; i3 <= byte0; i3++) {
- for (int k3 = -byte0; k3 <= byte0; k3++) {
- if (b[(k2 + j1) * i1 + (i3 + j1) * byte1 + (k3 + j1)] != l1 - 1) {
+ for (int i2 = 1; i2 <= 4; i2++) {
+ for (int l2 = -byte0; l2 <= byte0; l2++) {
+ for (int j3 = -byte0; j3 <= byte0; j3++) {
+ for (int l3 = -byte0; l3 <= byte0; l3++) {
+ if (b[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] != i2 - 1) {
continue;
}
- if (b[((k2 + j1) - 1) * i1 + (i3 + j1) * byte1 + (k3 + j1)] == -2) {
- b[((k2 + j1) - 1) * i1 + (i3 + j1) * byte1 + (k3 + j1)] = l1;
+ if (b[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2) {
+ b[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2;
}
- if (b[(k2 + j1 + 1) * i1 + (i3 + j1) * byte1 + (k3 + j1)] == -2) {
- b[(k2 + j1 + 1) * i1 + (i3 + j1) * byte1 + (k3 + j1)] = l1;
+ if (b[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2) {
+ b[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2;
}
- if (b[(k2 + j1) * i1 + ((i3 + j1) - 1) * byte1 + (k3 + j1)] == -2) {
- b[(k2 + j1) * i1 + ((i3 + j1) - 1) * byte1 + (k3 + j1)] = l1;
+ if (b[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] == -2) {
+ b[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] = i2;
}
- if (b[(k2 + j1) * i1 + (i3 + j1 + 1) * byte1 + (k3 + j1)] == -2) {
- b[(k2 + j1) * i1 + (i3 + j1 + 1) * byte1 + (k3 + j1)] = l1;
+ if (b[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] == -2) {
+ b[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] = i2;
}
- if (b[(k2 + j1) * i1 + (i3 + j1) * byte1 + ((k3 + j1) - 1)] == -2) {
- b[(k2 + j1) * i1 + (i3 + j1) * byte1 + ((k3 + j1) - 1)] = l1;
+ if (b[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] == -2) {
+ b[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] = i2;
}
- if (b[(k2 + j1) * i1 + (i3 + j1) * byte1 + (k3 + j1 + 1)] == -2) {
- b[(k2 + j1) * i1 + (i3 + j1) * byte1 + (k3 + j1 + 1)] = l1;
+ if (b[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] == -2) {
+ b[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] = i2;
}
}
}
}
}
}
- int i2 = b[j1 * i1 + j1 * byte1 + j1];
+ int j2 = b[k1 * j1 + k1 * byte1 + k1];
- if (i2 >= 0) {
- world.b(i, j, k, 0);
+ if (j2 >= 0) {
+ world.c(i, j, k, l & -5);
} else {
g(world, i, j, k);
}
@@ -123,7 +127,7 @@ public class BlockLeaves extends BlockLeavesBase {
// CraftBukkit end
a_(world, i, j, k, world.b(i, j, k));
- world.d(i, j, k, 0);
+ world.e(i, j, k, 0);
}
public int a(Random random) {
@@ -131,7 +135,7 @@ public class BlockLeaves extends BlockLeavesBase {
}
public int a(int i, Random random) {
- return Block.y.bh;
+ return Block.y.bi;
}
public boolean a() {