Paper/patches/server/0284-Fix-SpongeAbsortEvent-handling.patch

26 lines
1.4 KiB
Diff
Raw Normal View History

2021-06-13 10:26:58 +02:00
From 0000000000000000000000000000000000000000 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/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
2022-03-01 06:43:03 +01:00
index dad71c90c51bfef8dd42b3141ad23604a96100fb..11b40defd5f5362346fd8a70a1141cd6425cefa7 100644
2021-06-13 10:26:58 +02:00
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
2022-03-01 06:43:03 +01:00
@@ -129,8 +129,11 @@ public class SpongeBlock extends Block {
2021-06-13 10:26:58 +02:00
// NOP
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
BlockEntity tileentity = iblockdata.hasBlockEntity() ? world.getBlockEntity(blockposition2) : null;
-
- dropResources(iblockdata, world, blockposition2, tileentity);
+ // Paper start
+ if (block.getHandle().getMaterial() == Material.AIR) {
+ dropResources(iblockdata, world, blockposition2, tileentity);
+ }
+ // Paper end
}
}
world.setBlock(blockposition2, block.getHandle(), block.getFlag());