PaperMC/patches/server/0262-Fix-SpongeAbsortEvent-handling.patch
2024-12-03 19:28:24 +01:00

23 lines
1.4 KiB
Diff

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
index 0f4d244948b81a2298927f0f1635b03ef0977c09..e9a77c1ae09af42d2d444ad6b5f6c8ac395044e1 100644
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
@@ -137,7 +137,11 @@ public class SpongeBlock extends Block {
} else if (iblockdata.is(Blocks.KELP) || iblockdata.is(Blocks.KELP_PLANT) || iblockdata.is(Blocks.SEAGRASS) || iblockdata.is(Blocks.TALL_SEAGRASS)) {
BlockEntity tileentity = iblockdata.hasBlockEntity() ? world.getBlockEntity(blockposition1) : null;
+ // Paper start - Fix SpongeAbsortEvent handling
+ if (block.getHandle().isAir()) {
dropResources(iblockdata, world, blockposition1, tileentity);
+ }
+ // Paper end - Fix SpongeAbsortEvent handling
}
}
world.setBlock(blockposition1, block.getHandle(), block.getFlag());