2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-11-10 06:19:45 +01: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 13:12:32 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
2021-03-09 00:12:31 +01:00
|
|
|
index cee4e952c96b9f55c57186ac96aa730e656e1f16..05d9f842a990243c4ec83e62e177c818b5f94e8c 100644
|
2019-05-05 13:12:32 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -189,6 +189,7 @@ public class Block extends BlockBase implements IMaterial {
|
2019-05-05 13:12:32 +02:00
|
|
|
|
|
|
|
}
|
2020-08-25 04:22:08 +02:00
|
|
|
|
|
|
|
+ public static void dropNaturally(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) { a(iblockdata, generatoraccess, blockposition, tileentity); }
|
|
|
|
public static void a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) {
|
|
|
|
if (generatoraccess instanceof WorldServer) {
|
|
|
|
a(iblockdata, (WorldServer) generatoraccess, blockposition, tileentity).forEach((itemstack) -> {
|
2018-11-10 06:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java
|
2021-03-09 00:12:31 +01:00
|
|
|
index 4666e3aedc3d614eb38a08bd34f402b24bd1d0b6..7a2130d74e787f82b771d4efa8d3f15804f05940 100644
|
2018-11-10 06:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockSponge.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockSponge.java
|
2021-03-09 00:12:31 +01:00
|
|
|
@@ -116,8 +116,11 @@ public class BlockSponge extends Block {
|
2018-12-17 06:18:06 +01:00
|
|
|
// NOP
|
|
|
|
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
2019-05-05 13:12:32 +02:00
|
|
|
TileEntity tileentity = iblockdata.getBlock().isTileEntity() ? world.getTileEntity(blockposition2) : null;
|
|
|
|
-
|
|
|
|
- a(iblockdata, world, blockposition2, tileentity);
|
2018-12-17 06:18:06 +01:00
|
|
|
+ // Paper start
|
|
|
|
+ if (block.getHandle().getMaterial() == Material.AIR) {
|
2019-05-05 13:12:32 +02:00
|
|
|
+ dropNaturally(iblockdata, world, blockposition2, tileentity);
|
2018-12-17 06:18:06 +01:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
2018-11-10 06:19:45 +01:00
|
|
|
}
|
|
|
|
world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());
|