2019-05-27 11:13:41 +02:00
|
|
|
From 95acf9aa9d57511f2f8cbffc86e02862ab67a165 Mon Sep 17 00:00:00 2001
|
2018-07-16 22:08:09 +02: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
|
2019-04-27 08:26:04 +02:00
|
|
|
index ee9d91a8c..e71178ac1 100644
|
2018-07-16 22:08:09 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockChest.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockChest.java
|
2019-04-27 08:26:04 +02:00
|
|
|
@@ -227,7 +227,12 @@ public class BlockChest extends BlockTileEntity implements IBlockWaterlogged {
|
|
|
|
return blockchest_chestfinder.b(tileentitychest);
|
2018-07-16 22:08:09 +02:00
|
|
|
} else {
|
2019-04-27 08:26:04 +02:00
|
|
|
BlockPosition blockposition1 = blockposition.shift(j(iblockdata));
|
|
|
|
- IBlockData iblockdata1 = generatoraccess.getType(blockposition1);
|
2018-07-16 22:08:09 +02:00
|
|
|
+ // Paper start - don't load chunks if the other side of the chest is in unloaded chunk
|
2019-04-27 08:26:04 +02:00
|
|
|
+ IBlockData iblockdata1 = generatoraccess.getTypeIfLoaded(blockposition1);
|
|
|
|
+ if (iblockdata1 == null) {
|
2018-07-16 22:08:09 +02:00
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2019-01-01 04:15:55 +01:00
|
|
|
|
2019-04-27 08:26:04 +02:00
|
|
|
if (iblockdata1.getBlock() == iblockdata.getBlock()) {
|
2019-01-01 04:15:55 +01:00
|
|
|
BlockPropertyChestType blockpropertychesttype1 = (BlockPropertyChestType) iblockdata1.get(BlockChest.b);
|
2018-07-16 22:08:09 +02:00
|
|
|
--
|
2019-04-22 23:36:14 +02:00
|
|
|
2.21.0
|
2018-07-16 22:08:09 +02:00
|
|
|
|