2018-08-31 22:56:57 +00:00
|
|
|
From 73c75f27648ff2c90326d37c4be63ca064278ea4 Mon Sep 17 00:00:00 2001
|
2018-07-16 20:08:09 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Thu, 3 Nov 2016 20:28:12 -0400
|
|
|
|
Subject: [PATCH] Don't load Chunks from Hoppers and other things
|
|
|
|
|
|
|
|
Hoppers call this to I guess "get the primary side" of a double sided chest.
|
|
|
|
|
|
|
|
If the double sided chest crosses chunk lines, it causes the chunk to load.
|
|
|
|
This will end up causing sync chunk loads, which will unload with Chunk GC,
|
|
|
|
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
|
2018-08-31 22:56:57 +00:00
|
|
|
index 27e6d2b5f2..b3882930ea 100644
|
2018-07-16 20:08:09 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockChest.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockChest.java
|
2018-08-31 22:56:57 +00:00
|
|
|
@@ -181,7 +181,12 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC
|
|
|
|
return (ITileInventory)object;
|
2018-07-16 20:08:09 +00:00
|
|
|
} else {
|
2018-07-22 05:27:46 +00:00
|
|
|
BlockPosition blockposition1 = blockposition.shift(k(iblockdata));
|
2018-07-16 20:08:09 +00:00
|
|
|
- IBlockData iblockdata1 = world.getType(blockposition1);
|
|
|
|
+ // Paper start - don't load chunks if the other side of the chest is in unloaded chunk
|
|
|
|
+ final IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition1); // Paper
|
|
|
|
+ if (iblockdata1 == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
if (iblockdata1.getBlock() == this) {
|
2018-08-31 22:56:57 +00:00
|
|
|
BlockPropertyChestType blockpropertychesttype1 = (BlockPropertyChestType)iblockdata1.get(b);
|
|
|
|
if (blockpropertychesttype1 != BlockPropertyChestType.SINGLE && blockpropertychesttype != blockpropertychesttype1 && iblockdata1.get(FACING) == iblockdata.get(FACING)) {
|
2018-07-16 20:08:09 +00:00
|
|
|
--
|
|
|
|
2.18.0
|
|
|
|
|