testserver/Spigot-Server-Patches/0342-Fix-SpongeAbsortEvent-...

42 lines
2.2 KiB
Diff
Raw Normal View History

2019-05-14 02:20:58 +00:00
From bd5ffdf5d23fd7077da1ef8e76177882e41c3004 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
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
2019-05-05 11:12:32 +00:00
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
2019-05-14 02:20:58 +00:00
index 8d69a1556..5b98c5255 100644
2019-05-05 11:12:32 +00:00
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
2019-05-14 02:20:58 +00:00
@@ -473,7 +473,7 @@ public class Block implements IMaterial {
2019-05-05 11:12:32 +00:00
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
2019-05-14 02:20:58 +00:00
index 4e281ce6d..6a64af71b 100644
--- a/src/main/java/net/minecraft/server/BlockSponge.java
+++ b/src/main/java/net/minecraft/server/BlockSponge.java
2019-05-05 11:12:32 +00:00
@@ -113,8 +113,11 @@ public class BlockSponge extends Block {
// NOP
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
2019-05-05 11:12:32 +00:00
TileEntity tileentity = iblockdata.getBlock().isTileEntity() ? world.getTileEntity(blockposition2) : null;
-
- a(iblockdata, world, blockposition2, tileentity);
+ // Paper start
+ if (block.getHandle().getMaterial() == Material.AIR) {
2019-05-05 11:12:32 +00:00
+ dropNaturally(iblockdata, world, blockposition2, tileentity);
+ }
+ // Paper end
}
}
world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());
--
2019-05-05 11:32:20 +00:00
2.21.0