summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-01-22 23:20:07 +0100
committerErik Broes <erikbroes@grum.nl>2011-01-22 23:20:07 +0100
commite0b04001aa0a715ccd15a4292f35bf4925b5e30c (patch)
treeb08df624503900b2fb7b514a34ab7df1954b84fb
parent10f46b5fead01b61838189525dc57580e9e6d43d (diff)
downloadcraftbukkit-e0b04001aa0a715ccd15a4292f35bf4925b5e30c.tar
craftbukkit-e0b04001aa0a715ccd15a4292f35bf4925b5e30c.tar.gz
craftbukkit-e0b04001aa0a715ccd15a4292f35bf4925b5e30c.tar.lz
craftbukkit-e0b04001aa0a715ccd15a4292f35bf4925b5e30c.tar.xz
craftbukkit-e0b04001aa0a715ccd15a4292f35bf4925b5e30c.zip
Fixed placement of blocks with meta-data. (Dyed wool, logs etc)
-rw-r--r--src/main/java/net/minecraft/server/ItemBlock.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
index 5fd020ae..edf628cb 100644
--- a/src/main/java/net/minecraft/server/ItemBlock.java
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
@@ -66,7 +66,15 @@ public class ItemBlock extends Item {
Block block = Block.m[a];
// This executes the placement of the block
- if (world.b(i, j, k, a)) {
+ /*
+ * This replaces world.b(IIIII), we're doing this because we need to
+ * hook between the 'placement' and the informing to 'world' so we can
+ * sanely undo this.
+ *
+ * Whenever the call to 'world.b' changes we need to figure out again what to
+ * replace this with.
+ */
+ if (world.a(i, j, k, a, a(itemstack.h()))) { // <-- world.b does this to place the block
CraftBlock placedBlock = (CraftBlock) blockClicked.getFace(faceClicked) ;
CraftItemStack itemInHand = new CraftItemStack(itemstack);
CraftPlayer thePlayer = new CraftPlayer(((WorldServer) world).getServer(), (EntityPlayerMP) entityplayer);
@@ -90,10 +98,9 @@ public class ItemBlock extends Item {
world.b(i, j - 1, k, 44);
}
- world.b(i, j, k, oldMaterial);
- world.d(i, j, k, oldData);
+ world.a(i, j, k, oldMaterial, oldData);
} else {
- world.c(i, j, k, a, a(itemstack.h()));
+ world.f(i, j, k, a); // <-- world.b does this on success (tell the world)
Block.m[a].c(world, i, j, k, l);
Block.m[a].a(world, i, j, k, ((EntityLiving) (entityplayer)));