From 0a2be0cbac730a90d5e601af799fb4d1cfc4e732 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:42:33 -0700 Subject: [PATCH] Skip TE break validation for some waterlogged TEs (#5741) --- ...e-spam-when-removing-chests-in-water.patch | 19 ----------- ...-validation-for-some-waterlogged-TEs.patch | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 19 deletions(-) delete mode 100644 Spigot-Server-Patches/0657-Fix-console-spam-when-removing-chests-in-water.patch create mode 100644 Spigot-Server-Patches/0657-Skip-TE-break-validation-for-some-waterlogged-TEs.patch diff --git a/Spigot-Server-Patches/0657-Fix-console-spam-when-removing-chests-in-water.patch b/Spigot-Server-Patches/0657-Fix-console-spam-when-removing-chests-in-water.patch deleted file mode 100644 index d05dbe7aff..0000000000 --- a/Spigot-Server-Patches/0657-Fix-console-spam-when-removing-chests-in-water.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: HexedHero <6012891+HexedHero@users.noreply.github.com> -Date: Thu, 19 Nov 2020 02:07:10 +0000 -Subject: [PATCH] Fix console spam when removing chests in water - - -diff --git a/src/main/java/net/minecraft/world/level/block/BlockChest.java b/src/main/java/net/minecraft/world/level/block/BlockChest.java -index b2c29cff5883868cb56a4e376ab946ac929abc94..a45ee959f41e7f349ff2c309f21fa44ec671cb87 100644 ---- a/src/main/java/net/minecraft/world/level/block/BlockChest.java -+++ b/src/main/java/net/minecraft/world/level/block/BlockChest.java -@@ -239,7 +239,7 @@ public class BlockChest extends BlockChestAbstract implements I - @Override - public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { - if (!iblockdata.a(iblockdata1.getBlock())) { -- TileEntity tileentity = world.getTileEntity(blockposition); -+ TileEntity tileentity = world.getTileEntity(blockposition, false); // Paper - Don't validate TE - Fix console spam when removing chests in water - - if (tileentity instanceof IInventory) { - InventoryUtils.dropInventory(world, blockposition, (IInventory) tileentity); diff --git a/Spigot-Server-Patches/0657-Skip-TE-break-validation-for-some-waterlogged-TEs.patch b/Spigot-Server-Patches/0657-Skip-TE-break-validation-for-some-waterlogged-TEs.patch new file mode 100644 index 0000000000..5afdaebd1c --- /dev/null +++ b/Spigot-Server-Patches/0657-Skip-TE-break-validation-for-some-waterlogged-TEs.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: HexedHero <6012891+HexedHero@users.noreply.github.com> +Date: Thu, 19 Nov 2020 02:07:10 +0000 +Subject: [PATCH] Skip TE break validation for some waterlogged TEs + + +diff --git a/src/main/java/net/minecraft/world/level/block/BlockCampfire.java b/src/main/java/net/minecraft/world/level/block/BlockCampfire.java +index 21baa8fb99b0587da503e14e2b04abf3134d03bc..ba2385a876e7d77bc253d98307f1c75ec8aeb46c 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockCampfire.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockCampfire.java +@@ -98,7 +98,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!iblockdata.a(iblockdata1.getBlock())) { +- TileEntity tileentity = world.getTileEntity(blockposition); ++ TileEntity tileentity = world.getTileEntity(blockposition, !iblockdata1.isSameInstance(Blocks.WATER)); // Don't validate TE when removing campfire in water + + if (tileentity instanceof TileEntityCampfire) { + InventoryUtils.a(world, blockposition, ((TileEntityCampfire) tileentity).getItems()); +diff --git a/src/main/java/net/minecraft/world/level/block/BlockChest.java b/src/main/java/net/minecraft/world/level/block/BlockChest.java +index b2c29cff5883868cb56a4e376ab946ac929abc94..219950a446ef5811b113b32158852def964234a4 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockChest.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockChest.java +@@ -239,7 +239,7 @@ public class BlockChest extends BlockChestAbstract implements I + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!iblockdata.a(iblockdata1.getBlock())) { +- TileEntity tileentity = world.getTileEntity(blockposition); ++ TileEntity tileentity = world.getTileEntity(blockposition, !iblockdata1.isSameInstance(Blocks.WATER)); // Paper - Don't validate TE - Fix console spam when removing chests in water + + if (tileentity instanceof IInventory) { + InventoryUtils.dropInventory(world, blockposition, (IInventory) tileentity);