summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-11-24 09:30:01 +1100
committermd_5 <git@md-5.net>2016-11-24 09:30:01 +1100
commit281376dfb5fa05d53a2cd461db3f2d906c7a600e (patch)
tree1bb0194241358b1f60f4477fbfceb0db919d45cb /nms-patches
parenta0d5a841daee1c7983981d87a676d3491df0bfd7 (diff)
downloadcraftbukkit-281376dfb5fa05d53a2cd461db3f2d906c7a600e.tar
craftbukkit-281376dfb5fa05d53a2cd461db3f2d906c7a600e.tar.gz
craftbukkit-281376dfb5fa05d53a2cd461db3f2d906c7a600e.tar.lz
craftbukkit-281376dfb5fa05d53a2cd461db3f2d906c7a600e.tar.xz
craftbukkit-281376dfb5fa05d53a2cd461db3f2d906c7a600e.zip
SPIGOT-2833: Tile entities occasionally wiped after placement
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/ItemStack.patch19
1 files changed, 10 insertions, 9 deletions
diff --git a/nms-patches/ItemStack.patch b/nms-patches/ItemStack.patch
index e2b38e41..4af9c3f9 100644
--- a/nms-patches/ItemStack.patch
+++ b/nms-patches/ItemStack.patch
@@ -75,7 +75,7 @@
this.F();
}
-@@ -94,11 +128,137 @@
+@@ -94,11 +128,138 @@
}
public EnumInteractionResult placeItem(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
@@ -152,6 +152,11 @@
+ this.setData(newData);
+ this.setCount(newCount);
+ }
++
++ for (Map.Entry<BlockPosition, TileEntity> e : world.capturedTileEntities.entrySet()) {
++ world.setTileEntity(e.getKey(), e.getValue());
++ }
++
+ for (BlockState blockstate : blocks) {
+ int x = blockstate.getX();
+ int y = blockstate.getY();
@@ -169,10 +174,6 @@
+ world.notifyAndUpdatePhysics(newblockposition, null, oldBlock.getBlockData(), block, updateFlag); // send null chunk as chunk.k() returns false by this point
+ }
+
-+ for (Map.Entry<BlockPosition, TileEntity> e : world.capturedTileEntities.entrySet()) {
-+ world.setTileEntity(e.getKey(), e.getValue());
-+ }
-+
+ // Special case juke boxes as they update their tile entity. Copied from ItemRecord.
+ // PAIL: checkme on updates.
+ if (this.item instanceof ItemRecord) {
@@ -214,7 +215,7 @@
return enuminteractionresult;
}
-@@ -122,7 +282,7 @@
+@@ -122,7 +283,7 @@
nbttagcompound.setByte("Count", (byte) this.count);
nbttagcompound.setShort("Damage", (short) this.damage);
if (this.tag != null) {
@@ -223,7 +224,7 @@
}
return nbttagcompound;
-@@ -157,11 +317,30 @@
+@@ -157,11 +318,30 @@
}
public void setData(int i) {
@@ -256,7 +257,7 @@
}
public int k() {
-@@ -205,6 +384,11 @@
+@@ -205,6 +385,11 @@
entityhuman.b(StatisticList.c(this.item));
}
@@ -268,7 +269,7 @@
this.damage = 0;
}
-@@ -509,6 +693,12 @@
+@@ -509,6 +694,12 @@
nbttaglist.add(nbttagcompound);
}