mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Prevent Hoppers from loading chunks by double chest
This commit is contained in:
parent
c15001e24d
commit
5fe1de30c9
1 changed files with 34 additions and 0 deletions
|
@ -0,0 +1,34 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockChest.java
|
||||
@@ -0,0 +0,0 @@ public class BlockChest extends BlockTileEntity {
|
||||
while (iterator.hasNext()) {
|
||||
EnumDirection enumdirection = (EnumDirection) iterator.next();
|
||||
BlockPosition blockposition1 = blockposition.shift(enumdirection);
|
||||
- Block block = world.getType(blockposition1).getBlock();
|
||||
+ // Paper start - don't load chunks if the other side of the chest is in unloaded chunk
|
||||
+ final IBlockData type = world.getTypeIfLoaded(blockposition1); // Paper
|
||||
+ if (type == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ Block block = type.getBlock();
|
||||
+ // Paper end
|
||||
|
||||
if (block == this) {
|
||||
if (this.e(world, blockposition1)) {
|
||||
--
|
Loading…
Reference in a new issue