2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-11-10 05:19:45 +00: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
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
|
|
|
index 615a4418fd276cd3e0b3686d962ebaf13ef5d4be..e5c43b383a93fac76333a67b41535ab009d1dcf3 100644
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
|
|
|
@@ -228,6 +228,7 @@ public class Block extends BlockBase implements IMaterial {
|
2019-05-05 11:12:32 +00:00
|
|
|
|
|
|
|
}
|
2020-08-25 02:22:08 +00: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) -> {
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/BlockSponge.java b/src/main/java/net/minecraft/world/level/block/BlockSponge.java
|
|
|
|
index ef48ad0ab68e2e050bc8aca484d850297990b78e..d80eee47390ab202eea0368571421bbc94655ab1 100644
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/BlockSponge.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/BlockSponge.java
|
|
|
|
@@ -129,8 +129,11 @@ public class BlockSponge extends Block {
|
2018-12-17 05:18:06 +00:00
|
|
|
// NOP
|
|
|
|
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
2019-05-05 11:12:32 +00:00
|
|
|
TileEntity tileentity = iblockdata.getBlock().isTileEntity() ? world.getTileEntity(blockposition2) : null;
|
|
|
|
-
|
|
|
|
- a(iblockdata, world, blockposition2, tileentity);
|
2018-12-17 05:18:06 +00:00
|
|
|
+ // Paper start
|
|
|
|
+ if (block.getHandle().getMaterial() == Material.AIR) {
|
2019-05-05 11:12:32 +00:00
|
|
|
+ dropNaturally(iblockdata, world, blockposition2, tileentity);
|
2018-12-17 05:18:06 +00:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
2018-11-10 05:19:45 +00:00
|
|
|
}
|
|
|
|
world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());
|