Paper/Spigot-Server-Patches/0310-Fix-SpongeAbsortEvent-handling.patch

38 lines
2.3 KiB
Diff
Raw Normal View History

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
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
index b537385d12463adc82751e40b479b047b32fa5bd..b364ceafb4c3412b0d11b3b2e8b4321ed96769bb 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
@@ -189,6 +189,7 @@ public class Block extends BlockBase implements IMaterial {
2019-05-05 13:12:32 +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) -> {
diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java
index 7051d9bf19f989a1176c1f12e1114240ab4762c4..db73fe0e51bde67d9238ce3f9f6f008c2d8a9d4d 100644
--- a/src/main/java/net/minecraft/server/BlockSponge.java
+++ b/src/main/java/net/minecraft/server/BlockSponge.java
@@ -115,8 +115,11 @@ public class BlockSponge extends Block {
// 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);
+ // Paper start
+ if (block.getHandle().getMaterial() == Material.AIR) {
2019-05-05 13:12:32 +02:00
+ dropNaturally(iblockdata, world, blockposition2, tileentity);
+ }
+ // Paper end
}
}
world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());