mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
f100b5d921
A recent commit has been made that caused patches to be out of order, rebuilding
57 lines
No EOL
2.5 KiB
Diff
57 lines
No EOL
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: willies952002 <admin@domnian.com>
|
|
Date: Wed, 29 Aug 2018 00:37:42 -0400
|
|
Subject: [PATCH] Implement Force-Loaded Chunk API
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
|
index 49809372d8..2b5b0c4df6 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 IEntityAccess, GeneratorAccess, IIBlockAc
|
|
return forcedchunk != null && forcedchunk.a().contains(ChunkCoordIntPair.a(i, j));
|
|
}
|
|
|
|
+ public boolean setForcedChunk(int i, int j, boolean flag) { return b(i, j, flag); } // Paper - OBFHELPER
|
|
public boolean b(int i, int j, boolean flag) {
|
|
String s = "chunks";
|
|
ForcedChunk forcedchunk = (ForcedChunk) this.a(this.worldProvider.getDimensionManager(), ForcedChunk::new, "chunks");
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
|
index 12c6d850d2..55394e0c15 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
|
@@ -0,0 +0,0 @@ public class CraftChunk implements Chunk {
|
|
Preconditions.checkArgument(0 <= z && z <= 15, "z out of range (expected 0-15, got %s)", z);
|
|
}
|
|
|
|
+ // Paper start - Force-Loaded Chunk API
|
|
+ @Override
|
|
+ public boolean isForceLoaded() {
|
|
+ return getHandle().getWorld().isForcedChunk(this.x, this.z);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setForceLoaded(boolean force) {
|
|
+ getHandle().getWorld().setForcedChunk(this.x, this.z, force);
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
static {
|
|
Arrays.fill(emptySkyLight, (byte) 0xFF);
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index 1ccf2a7609..755d2632fd 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
|
public boolean isChunkGenerated(int x, int z) {
|
|
return this.getHandle().getChunkProviderServer().isChunkGenerated(x, z);
|
|
}
|
|
+
|
|
+ public boolean isChunkForceLoaded(int x, int z) {
|
|
+ return this.isChunkGenerated(x, z) && this.getHandle().isForcedChunk(x, z);
|
|
+ }
|
|
// Paper end
|
|
|
|
public ChunkGenerator getGenerator() {
|
|
--
|