summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-04-10 21:24:34 +1000
committermd_5 <git@md-5.net>2015-04-10 21:24:45 +1000
commit501372f2c968a03be98e2d161c6228f4a5d856fb (patch)
tree261cf9c72aaf816c4bc875ca12c3ddbb84d3e856
parent1a1bc08e38a635088c4764210e2dfa7ab6e04aba (diff)
downloadcraftbukkit-501372f2c968a03be98e2d161c6228f4a5d856fb.tar
craftbukkit-501372f2c968a03be98e2d161c6228f4a5d856fb.tar.gz
craftbukkit-501372f2c968a03be98e2d161c6228f4a5d856fb.tar.lz
craftbukkit-501372f2c968a03be98e2d161c6228f4a5d856fb.tar.xz
craftbukkit-501372f2c968a03be98e2d161c6228f4a5d856fb.zip
Special case record placement into juke boxes as they update their tile.
-rw-r--r--nms-patches/ItemRecord.patch17
-rw-r--r--nms-patches/ItemStack.patch24
2 files changed, 33 insertions, 8 deletions
diff --git a/nms-patches/ItemRecord.patch b/nms-patches/ItemRecord.patch
new file mode 100644
index 00000000..7507049d
--- /dev/null
+++ b/nms-patches/ItemRecord.patch
@@ -0,0 +1,17 @@
+--- ../work/decompile-73f3c166/net/minecraft/server/ItemRecord.java 2015-04-10 21:23:03.674603339 +1000
++++ src/main/java/net/minecraft/server/ItemRecord.java 2015-04-10 21:23:03.678603362 +1000
+@@ -22,10 +22,14 @@
+ if (world.isClientSide) {
+ return true;
+ } else {
++ // CraftBukkit Start
++ /*
+ ((BlockJukeBox) Blocks.JUKEBOX).a(world, blockposition, iblockdata, itemstack);
+ world.a((EntityHuman) null, 1005, blockposition, Item.getId(this));
+ --itemstack.count;
+ entityhuman.b(StatisticList.X);
++ */
++ // CraftBukkit End
+ return true;
+ }
+ } else {
diff --git a/nms-patches/ItemStack.patch b/nms-patches/ItemStack.patch
index 79bdd15a..a869e407 100644
--- a/nms-patches/ItemStack.patch
+++ b/nms-patches/ItemStack.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/ItemStack.java 2015-03-16 09:47:03.755222168 +0000
-+++ src/main/java/net/minecraft/server/ItemStack.java 2015-03-16 09:47:03.759222168 +0000
+--- ../work/decompile-73f3c166/net/minecraft/server/ItemStack.java 2015-04-10 21:23:03.678603362 +1000
++++ src/main/java/net/minecraft/server/ItemStack.java 2015-04-10 21:23:03.682603388 +1000
@@ -5,6 +5,19 @@
import java.text.DecimalFormat;
import java.util.Random;
@@ -39,7 +39,7 @@
}
-@@ -83,11 +100,119 @@
+@@ -83,11 +100,127 @@
}
public boolean placeItem(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) {
@@ -134,6 +134,14 @@
+ world.setTileEntity(e.getKey(), e.getValue());
+ }
+
++ // Special case juke boxes as they update their tile entity. Copied from ItemRecord.
++ if (this.getItem() instanceof ItemRecord) {
++ ((BlockJukeBox) Blocks.JUKEBOX).a(world, blockposition, world.getType(blockposition), this);
++ world.a((EntityHuman) null, 1005, blockposition, Item.getId(this.getItem()));
++ --this.count;
++ entityhuman.b(StatisticList.X);
++ }
++
+ if (this.getItem() == Items.SKULL) { // Special case skulls to allow wither spawns to be cancelled
+ BlockPosition bp = blockposition;
+ if (!world.getType(blockposition).getBlock().a(world, blockposition)) {
@@ -160,7 +168,7 @@
return flag;
}
-@@ -111,7 +236,7 @@
+@@ -111,7 +244,7 @@
nbttagcompound.setByte("Count", (byte) this.count);
nbttagcompound.setShort("Damage", (short) this.damage);
if (this.tag != null) {
@@ -169,7 +177,7 @@
}
return nbttagcompound;
-@@ -125,13 +250,18 @@
+@@ -125,13 +258,18 @@
}
this.count = nbttagcompound.getByte("Count");
@@ -189,7 +197,7 @@
if (this.item != null) {
this.item.a(this.tag);
}
-@@ -168,8 +298,28 @@
+@@ -168,8 +306,28 @@
}
public void setData(int i) {
@@ -219,7 +227,7 @@
this.damage = 0;
}
-@@ -223,6 +373,12 @@
+@@ -223,6 +381,12 @@
this.count = 0;
}
@@ -232,7 +240,7 @@
this.damage = 0;
}
-@@ -489,6 +645,7 @@
+@@ -489,6 +653,7 @@
public void setItem(Item item) {
this.item = item;