mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 01:12:47 +01:00
41 lines
2.2 KiB
Diff
41 lines
2.2 KiB
Diff
From fdd3a46f035dc1a66d6e2d01bbbe1c8afee794af 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
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
|
index 549c50de7d..5e66099443 100644
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
|
@@ -465,7 +465,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 4e281ce6dd..6a64af71b9 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockSponge.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockSponge.java
|
|
@@ -113,8 +113,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());
|
|
--
|
|
2.21.0
|
|
|