From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Nov 2018 05:15:21 +0000 Subject: [PATCH] Fix SpongeAbsortEvent handling Only process drops when the block is actually going to be removed diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java index b9b750c3695699520c736d57cbd88c8d52254c7a..540fcce1dd4d64dee51e2594f2199fac5299c6a0 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -472,7 +472,7 @@ public class Block implements IMaterial { iblockdata.dropNaturally(world, blockposition, ItemStack.a); } - + public static void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity) { a(iblockdata, world, blockposition, tileentity); } public static void a(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity) { if (world instanceof WorldServer) { a(iblockdata, (WorldServer) world, blockposition, tileentity).forEach((itemstack) -> { diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java index 685a30f3f14232dba88e22ec86e2e66f7da86d0b..9edf937a652a5b463ff049c414f3230bb0ecd9ed 100644 --- a/src/main/java/net/minecraft/server/BlockSponge.java +++ b/src/main/java/net/minecraft/server/BlockSponge.java @@ -115,8 +115,11 @@ public class BlockSponge extends Block { // NOP } else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) { TileEntity tileentity = iblockdata.getBlock().isTileEntity() ? world.getTileEntity(blockposition2) : null; - - a(iblockdata, world, blockposition2, tileentity); + // Paper start + if (block.getHandle().getMaterial() == Material.AIR) { + dropNaturally(iblockdata, world, blockposition2, tileentity); + } + // Paper end } } world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());