mirror of
https://github.com/PaperMC/Paper.git
synced 2025-09-02 21:33:52 -07:00
Update to Minecraft 1.11
This commit is contained in:
45
nms-patches/BlockShulkerBox.patch
Normal file
45
nms-patches/BlockShulkerBox.patch
Normal file
@@ -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()) {
|
Reference in New Issue
Block a user