From 4151617d29aa88afe3696dfa091bc72cee004a1a Mon Sep 17 00:00:00 2001 From: Omer Uddin Date: Thu, 9 Jan 2020 22:11:19 -0500 Subject: [PATCH] Update no chunk loads for hoppers and double chests patch (#2777) --- ...Chunks-from-Hoppers-and-other-things.patch | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) rename removed/1.15/0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch => Spigot-Server-Patches/0421-Don-t-load-Chunks-from-Hoppers-and-other-things.patch (59%) diff --git a/removed/1.15/0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/Spigot-Server-Patches/0421-Don-t-load-Chunks-from-Hoppers-and-other-things.patch similarity index 59% rename from removed/1.15/0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch rename to Spigot-Server-Patches/0421-Don-t-load-Chunks-from-Hoppers-and-other-things.patch index d0fd6e9b3..e2e4ce7da 100644 --- a/removed/1.15/0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch +++ b/Spigot-Server-Patches/0421-Don-t-load-Chunks-from-Hoppers-and-other-things.patch @@ -1,4 +1,4 @@ -From 89bcce52afb8d49807203290ef7753aefc06685b Mon Sep 17 00:00:00 2001 +From 42319bc0833fa22b57adfca1b81c422be0fc7526 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Nov 2016 20:28:12 -0400 Subject: [PATCH] Don't load Chunks from Hoppers and other things @@ -12,24 +12,25 @@ only to be reloaded again the next tick. This of course is undesirable, so just return the loaded side as "primary" and treat it as a single chest if the other sides are unloaded -diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index 65b616481..8183a61c9 100644 ---- a/src/main/java/net/minecraft/server/BlockChest.java -+++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -227,7 +227,12 @@ public class BlockChest extends BlockTileEntity implements IBlockWaterlogged { - return blockchest_chestfinder.b(tileentitychest); +diff --git a/src/main/java/net/minecraft/server/DoubleBlockFinder.java b/src/main/java/net/minecraft/server/DoubleBlockFinder.java +index 3cb6e6089..7a16a3e0e 100644 +--- a/src/main/java/net/minecraft/server/DoubleBlockFinder.java ++++ b/src/main/java/net/minecraft/server/DoubleBlockFinder.java +@@ -21,8 +21,12 @@ public class DoubleBlockFinder { + return new DoubleBlockFinder.Result.Single<>(s0); } else { - BlockPosition blockposition1 = blockposition.shift(j(iblockdata)); + BlockPosition blockposition1 = blockposition.shift((EnumDirection) function1.apply(iblockdata)); - IBlockData iblockdata1 = generatoraccess.getType(blockposition1); +- + // Paper start - don't load chunks if the other side of the chest is in unloaded chunk + IBlockData iblockdata1 = generatoraccess.getTypeIfLoaded(blockposition1); + if (iblockdata1 == null) { -+ return null; ++ return new DoubleBlockFinder.Result.Single<>(s0); + } + // Paper end - if (iblockdata1.getBlock() == iblockdata.getBlock()) { - BlockPropertyChestType blockpropertychesttype1 = (BlockPropertyChestType) iblockdata1.get(BlockChest.b); + DoubleBlockFinder.BlockType doubleblockfinder_blocktype1 = (DoubleBlockFinder.BlockType) function.apply(iblockdata1); + -- -2.22.0 +2.24.1