mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fix Nether/End world unloading spawn chunks - Fixes #92
This commit is contained in:
parent
ef6b4cafc0
commit
0726de949b
2 changed files with 34 additions and 0 deletions
|
@ -0,0 +1,33 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aikar <aikar@aikar.co>
|
||||||
|
Date: Tue, 5 Apr 2016 19:42:22 -0400
|
||||||
|
Subject: [PATCH] Don't spam reload spawn chunks in nether/end
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/World.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/World.java
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||||
|
return this.N;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public boolean shouldStayLoaded(int i, int j) { return c(i, j); } // Paper - OBFHELPER
|
||||||
|
public boolean c(int i, int j) {
|
||||||
|
BlockPosition blockposition = this.getSpawn();
|
||||||
|
int k = i * 16 + 8 - blockposition.getX();
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/WorldProvider.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class WorldProvider {
|
||||||
|
|
||||||
|
public void r() {}
|
||||||
|
|
||||||
|
- public boolean c(int i, int j) {
|
||||||
|
- return true;
|
||||||
|
+ public boolean c(int i, int j) { // Method is "can chunk unload"
|
||||||
|
+ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
|
@ -61,6 +61,7 @@ import PathfinderAbstract
|
||||||
import PathfinderGoalFloat
|
import PathfinderGoalFloat
|
||||||
import PersistentVillage
|
import PersistentVillage
|
||||||
import TileEntityEnderChest
|
import TileEntityEnderChest
|
||||||
|
import WorldProvider
|
||||||
|
|
||||||
cd "$workdir/Spigot/Spigot-Server/"
|
cd "$workdir/Spigot/Spigot-Server/"
|
||||||
git add src -A
|
git add src -A
|
||||||
|
|
Loading…
Reference in a new issue