diff options
author | md_5 <git@md-5.net> | 2016-11-17 12:41:03 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-11-17 12:41:03 +1100 |
commit | c25ddf063a808e3adb749e22017661f403c5fb7e (patch) | |
tree | b2efcff512be12fd3e38cf8c36386148ce6ab4ae /nms-patches/BlockShulkerBox.patch | |
parent | 51263e97187a84338f89698eef187284055a682a (diff) | |
download | craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.gz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.lz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.xz craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.zip |
Update to Minecraft 1.11
Diffstat (limited to 'nms-patches/BlockShulkerBox.patch')
-rw-r--r-- | nms-patches/BlockShulkerBox.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/nms-patches/BlockShulkerBox.patch b/nms-patches/BlockShulkerBox.patch new file mode 100644 index 00000000..ef6b04cd --- /dev/null +++ b/nms-patches/BlockShulkerBox.patch @@ -0,0 +1,45 @@ +--- a/net/minecraft/server/BlockShulkerBox.java ++++ b/net/minecraft/server/BlockShulkerBox.java +@@ -89,7 +89,32 @@ + tileentityshulkerbox.d(entityhuman); + } + +- public void dropNaturally(World world, BlockPosition blockposition, IBlockData iblockdata, float f, int i) {} ++ // CraftBukkit start - override to prevent duplication when dropping ++ public void dropNaturally(World world, BlockPosition blockposition, IBlockData iblockdata, float f, int i) { ++ TileEntity tileentity = world.getTileEntity(blockposition); ++ ++ if (tileentity instanceof TileEntityShulkerBox) { ++ TileEntityShulkerBox tileentityshulkerbox = (TileEntityShulkerBox) tileentity; ++ ++ if (!tileentityshulkerbox.r() && tileentityshulkerbox.F()) { ++ ItemStack itemstack = new ItemStack(Item.getItemOf(this)); ++ NBTTagCompound nbttagcompound = new NBTTagCompound(); ++ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); ++ ++ nbttagcompound.set("BlockEntityTag", ((TileEntityShulkerBox) tileentity).f(nbttagcompound1)); ++ itemstack.setTag(nbttagcompound); ++ if (tileentityshulkerbox.hasCustomName()) { ++ itemstack.g(tileentityshulkerbox.getName()); ++ tileentityshulkerbox.a(""); ++ } ++ ++ a(world, blockposition, itemstack); ++ } ++ ++ world.updateAdjacentComparators(blockposition, iblockdata.getBlock()); ++ } ++ } ++ // CraftBukkit end + + public void postPlace(World world, BlockPosition blockposition, IBlockData iblockdata, EntityLiving entityliving, ItemStack itemstack) { + if (itemstack.hasName()) { +@@ -105,7 +130,7 @@ + public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) { + TileEntity tileentity = world.getTileEntity(blockposition); + +- if (tileentity instanceof TileEntityShulkerBox) { ++ if (false && tileentity instanceof TileEntityShulkerBox) { // CraftBukkit - moved up + TileEntityShulkerBox tileentityshulkerbox = (TileEntityShulkerBox) tileentity; + + if (!tileentityshulkerbox.r() && tileentityshulkerbox.F()) { |