2020-05-02 06:03:47 +08:00
|
|
|
From 3dfa21fff39c7ccf8cd6d213d1a2e0611209ed21 Mon Sep 17 00:00:00 2001
|
2018-11-10 13:19:45 +08:00
|
|
|
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 19:12:32 +08:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
2020-05-02 06:03:47 +08:00
|
|
|
index b9b750c369..540fcce1dd 100644
|
2019-05-05 19:12:32 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
2019-05-28 07:01:45 +08:00
|
|
|
@@ -472,7 +472,7 @@ public class Block implements IMaterial {
|
2019-05-05 19:12:32 +08: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) -> {
|
2018-11-10 13:19:45 +08:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java
|
2020-05-02 06:03:47 +08:00
|
|
|
index 685a30f3f1..9edf937a65 100644
|
2018-11-10 13:19:45 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockSponge.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockSponge.java
|
2019-09-01 03:30:44 +08:00
|
|
|
@@ -115,8 +115,11 @@ public class BlockSponge extends Block {
|
2018-12-17 13:18:06 +08:00
|
|
|
// NOP
|
|
|
|
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
2019-05-05 19:12:32 +08:00
|
|
|
TileEntity tileentity = iblockdata.getBlock().isTileEntity() ? world.getTileEntity(blockposition2) : null;
|
|
|
|
-
|
|
|
|
- a(iblockdata, world, blockposition2, tileentity);
|
2018-12-17 13:18:06 +08:00
|
|
|
+ // Paper start
|
|
|
|
+ if (block.getHandle().getMaterial() == Material.AIR) {
|
2019-05-05 19:12:32 +08:00
|
|
|
+ dropNaturally(iblockdata, world, blockposition2, tileentity);
|
2018-12-17 13:18:06 +08:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
2018-11-10 13:19:45 +08:00
|
|
|
}
|
|
|
|
world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());
|
|
|
|
--
|
2020-05-02 06:03:47 +08:00
|
|
|
2.26.2
|
2018-11-10 13:19:45 +08:00
|
|
|
|