| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  | --- a/net/minecraft/server/BlockShulkerBox.java
 | 
					
						
							|  |  |  | +++ b/net/minecraft/server/BlockShulkerBox.java
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | @@ -81,7 +81,31 @@
 | 
					
						
							|  |  |  |          super.a(world, blockposition, iblockdata, entityhuman); | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  |      } | 
					
						
							|  |  |  |   | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | -    public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, float f, int i) {}
 | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  | +    // CraftBukkit start - override to prevent duplication when dropping
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | +    @Override
 | 
					
						
							|  |  |  | +    public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, float f, int i) {
 | 
					
						
							|  |  |  | +        if (true) {
 | 
					
						
							|  |  |  | +            TileEntity tileentity = world.getTileEntity(blockposition);
 | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  | +
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | +            if (tileentity instanceof TileEntityShulkerBox) {
 | 
					
						
							|  |  |  | +                TileEntityShulkerBox tileentityshulkerbox = (TileEntityShulkerBox) tileentity;
 | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  | +
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | +                if (!tileentityshulkerbox.s() && tileentityshulkerbox.G()) {
 | 
					
						
							|  |  |  | +                    ItemStack itemstack = new ItemStack(this);
 | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  | +
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | +                    itemstack.getOrCreateTag().set("BlockEntityTag", ((TileEntityShulkerBox) tileentity).g(new NBTTagCompound()));
 | 
					
						
							|  |  |  | +                    if (tileentityshulkerbox.hasCustomName()) {
 | 
					
						
							|  |  |  | +                        itemstack.a(tileentityshulkerbox.getCustomName());
 | 
					
						
							|  |  |  | +                        tileentityshulkerbox.setCustomName((IChatBaseComponent) null);
 | 
					
						
							|  |  |  | +                    }
 | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  | +
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | +                    a(world, blockposition, itemstack);
 | 
					
						
							|  |  |  | +                }
 | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  | +            }
 | 
					
						
							|  |  |  | +            world.updateAdjacentComparators(blockposition, iblockdata.getBlock());
 | 
					
						
							|  |  |  | +        }
 | 
					
						
							|  |  |  | +    }
 | 
					
						
							|  |  |  | +    // CraftBukkit end
 | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |      public void postPlace(World world, BlockPosition blockposition, IBlockData iblockdata, EntityLiving entityliving, ItemStack itemstack) { | 
					
						
							|  |  |  |          if (itemstack.hasName()) { | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | @@ -98,7 +122,7 @@
 | 
					
						
							|  |  |  |          if (iblockdata.getBlock() != iblockdata1.getBlock()) { | 
					
						
							|  |  |  |              TileEntity tileentity = world.getTileEntity(blockposition); | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  |   | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | -            if (tileentity instanceof TileEntityShulkerBox) {
 | 
					
						
							|  |  |  | +            if (false && tileentity instanceof TileEntityShulkerBox) { // CraftBukkit - moved up
 | 
					
						
							|  |  |  |                  TileEntityShulkerBox tileentityshulkerbox = (TileEntityShulkerBox) tileentity; | 
					
						
							| 
									
										
										
										
											2016-11-17 12:41:03 +11:00
										 |  |  |   | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  |                  if (!tileentityshulkerbox.s() && tileentityshulkerbox.G()) { | 
					
						
							|  |  |  | @@ -113,8 +137,8 @@
 | 
					
						
							|  |  |  |                      a(world, blockposition, itemstack); | 
					
						
							|  |  |  |                  } | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  | -                world.updateAdjacentComparators(blockposition, iblockdata.getBlock());
 | 
					
						
							| 
									
										
										
										
											2016-12-28 14:23:52 +11:00
										 |  |  |              } | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | +            world.updateAdjacentComparators(blockposition, iblockdata.getBlock()); // CraftBukkit - moved down
 | 
					
						
							| 
									
										
										
										
											2016-12-28 14:23:52 +11:00
										 |  |  |   | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  |              super.remove(iblockdata, world, blockposition, iblockdata1, flag); | 
					
						
							| 
									
										
										
										
											2016-12-28 14:23:52 +11:00
										 |  |  |          } |