Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 02:50:09 +01:00
Cleanup MCUtils patch for chunk system
Remove utilities that are unused, as well as replacing the full chunk map with a concurrentutil implementation. Additionally, fix the addition/removal of chunks to/from the full chunk map so that getChunkIfLoaded correctly returns a non-null chunk when calling the load or unload events.
Dieser Commit ist enthalten in:
Ursprung
c0268ca86e
Commit
38428c0d6c
@ -1,13 +1,4 @@
|
|||||||
- note: for paper, the chunk debug command
|
- note: for paper, the chunk debug command
|
||||||
- rebase IntervalledCounter into util patch
|
|
||||||
- mcutil diff
|
- mcutil diff
|
||||||
- paper debug chunks --async in DedicatedServer
|
- paper debug chunks --async in DedicatedServer
|
||||||
- TODO keep around region file lock?
|
- TODO keep around region file lock?
|
||||||
- mcutil#getTicketLevelFor is wrong, just delete it later
|
|
||||||
|
|
||||||
on another note, clean up mcutils...
|
|
||||||
|
|
||||||
apply todo in levelmixin
|
|
||||||
|
|
||||||
to fix later:
|
|
||||||
- Change loadedChunkMap in ServerChunkCache to use concurrent long map
|
|
||||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
@ -2606,7 +2606,7 @@ index bb97fdb9aa6167083442a928276ebe4225a586ef..5d1758086ed4fce5b36a5b31df44ccea
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index b1325e090f2c7aff31d27fc38ca7173efe31ed7c..0742aaf07f37e51d24295e7819ac6cec961c7626 100644
|
index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c898f7b9c0 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -201,6 +201,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
@@ -201,6 +201,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||||
@ -2644,7 +2644,7 @@ index b1325e090f2c7aff31d27fc38ca7173efe31ed7c..0742aaf07f37e51d24295e7819ac6cec
|
|||||||
this.profiler.push("commandFunctions");
|
this.profiler.push("commandFunctions");
|
||||||
SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot
|
SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot
|
||||||
this.getFunctions().tick();
|
this.getFunctions().tick();
|
||||||
@@ -1805,10 +1806,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1800,10 +1801,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMotd() {
|
public String getMotd() {
|
||||||
@ -2666,7 +2666,7 @@ index b1325e090f2c7aff31d27fc38ca7173efe31ed7c..0742aaf07f37e51d24295e7819ac6cec
|
|||||||
this.motd = motd;
|
this.motd = motd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2570,23 +2581,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2565,23 +2576,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
|
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
|
||||||
|
@ -260,7 +260,7 @@ index 8323f135d6bf2e1f12525e05094ffa3f2420e7e1..a143ea1e58464a3122fbd8ccafe417bd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 0742aaf07f37e51d24295e7819ac6cec961c7626..e82218de79759dfaa7fe2a5a78e150f135bf01a3 100644
|
index 25d6be308be03815301cfbefdc4199c898f7b9c0..b67cb9b027c33494f0ed3c6c6ac354a5c79fbf47 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -154,7 +154,7 @@ import com.mojang.serialization.Dynamic;
|
@@ -154,7 +154,7 @@ import com.mojang.serialization.Dynamic;
|
||||||
@ -308,7 +308,7 @@ index 0742aaf07f37e51d24295e7819ac6cec961c7626..e82218de79759dfaa7fe2a5a78e150f1
|
|||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -1664,7 +1667,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1659,7 +1662,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendSystemMessage(Component message) {
|
public void sendSystemMessage(Component message) {
|
||||||
|
@ -1553,7 +1553,7 @@ index 0000000000000000000000000000000000000000..badff5d6ae6dd8d209c82bc7e8afe370
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index e82218de79759dfaa7fe2a5a78e150f135bf01a3..202a6510d9d093119ff88b910cef6e47fce2e6b8 100644
|
index b67cb9b027c33494f0ed3c6c6ac354a5c79fbf47..cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -643,6 +643,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -643,6 +643,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -714,7 +714,7 @@ index f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233..d0d36a57ec4896bcb74970f8fb24d8f3
|
|||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
if (exception instanceof ReportedException) {
|
if (exception instanceof ReportedException) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 202a6510d9d093119ff88b910cef6e47fce2e6b8..4137cf4d716680ff1b1ab0b8a3e8f7cb4bae7dbe 100644
|
index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25d8c8f553 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -196,7 +196,7 @@ import org.bukkit.craftbukkit.Main;
|
@@ -196,7 +196,7 @@ import org.bukkit.craftbukkit.Main;
|
||||||
@ -861,7 +861,7 @@ index 202a6510d9d093119ff88b910cef6e47fce2e6b8..4137cf4d716680ff1b1ab0b8a3e8f7cb
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||||
@@ -1499,24 +1522,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1494,24 +1517,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
this.profiler.popPush("connection");
|
this.profiler.popPush("connection");
|
||||||
@ -978,7 +978,7 @@ index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..b51c3f8c485496734ea58c15377a1215
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 319f51eb8adde7584c74780ac0539f4b8ef8fe7f..ddadb0f13b96a39ec89cdaeea7bc02ee62ef2a06 100644
|
index d3caadb3e884d7d0468daf5eff9abd6629ac4b49..a7de9d6bbbd0b3d60b1d49e116c388b1846f33e4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1,8 +1,10 @@
|
@@ -1,8 +1,10 @@
|
||||||
@ -992,7 +992,7 @@ index 319f51eb8adde7584c74780ac0539f4b8ef8fe7f..ddadb0f13b96a39ec89cdaeea7bc02ee
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Queues;
|
import com.google.common.collect.Queues;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
@@ -1363,6 +1365,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1336,6 +1338,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
List<ServerPlayer> list = Lists.newArrayList();
|
List<ServerPlayer> list = Lists.newArrayList();
|
||||||
List<ServerPlayer> list1 = this.level.players();
|
List<ServerPlayer> list1 = this.level.players();
|
||||||
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
||||||
@ -1000,7 +1000,7 @@ index 319f51eb8adde7584c74780ac0539f4b8ef8fe7f..ddadb0f13b96a39ec89cdaeea7bc02ee
|
|||||||
|
|
||||||
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
||||||
|
|
||||||
@@ -1387,14 +1390,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1360,14 +1363,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1019,10 +1019,10 @@ index 319f51eb8adde7584c74780ac0539f4b8ef8fe7f..ddadb0f13b96a39ec89cdaeea7bc02ee
|
|||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index ab57071cc6ce8b79d883f2426855c1abf577e90d..c627d32e7dbc83b9fc60b89c73bff5c9992ad548 100644
|
index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f6454f8b7c3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -269,13 +269,15 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -197,13 +197,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
gameprofilerfiller.incrementCounter("getChunkCacheMiss");
|
gameprofilerfiller.incrementCounter("getChunkCacheMiss");
|
||||||
@ -1040,7 +1040,7 @@ index ab57071cc6ce8b79d883f2426855c1abf577e90d..c627d32e7dbc83b9fc60b89c73bff5c9
|
|||||||
ChunkResult<ChunkAccess> chunkresult = (ChunkResult) completablefuture.join();
|
ChunkResult<ChunkAccess> chunkresult = (ChunkResult) completablefuture.join();
|
||||||
ChunkAccess ichunkaccess1 = (ChunkAccess) chunkresult.orElse(null); // CraftBukkit - decompile error
|
ChunkAccess ichunkaccess1 = (ChunkAccess) chunkresult.orElse(null); // CraftBukkit - decompile error
|
||||||
|
|
||||||
@@ -440,7 +442,9 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -368,7 +370,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
|
|
||||||
public void save(boolean flush) {
|
public void save(boolean flush) {
|
||||||
this.runDistanceManagerUpdates();
|
this.runDistanceManagerUpdates();
|
||||||
@ -1050,7 +1050,7 @@ index ab57071cc6ce8b79d883f2426855c1abf577e90d..c627d32e7dbc83b9fc60b89c73bff5c9
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -482,10 +486,10 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -410,10 +414,10 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
this.level.timings.doChunkMap.stopTiming(); // Spigot
|
this.level.timings.doChunkMap.stopTiming(); // Spigot
|
||||||
this.level.getProfiler().popPush("chunks");
|
this.level.getProfiler().popPush("chunks");
|
||||||
if (tickChunks) {
|
if (tickChunks) {
|
||||||
@ -1063,7 +1063,7 @@ index ab57071cc6ce8b79d883f2426855c1abf577e90d..c627d32e7dbc83b9fc60b89c73bff5c9
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.level.timings.doChunkUnload.startTiming(); // Spigot
|
this.level.timings.doChunkUnload.startTiming(); // Spigot
|
||||||
@@ -508,6 +512,7 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -436,6 +440,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
gameprofilerfiller.push("filteringLoadedChunks");
|
gameprofilerfiller.push("filteringLoadedChunks");
|
||||||
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
||||||
Iterator iterator = this.chunkMap.getChunks().iterator();
|
Iterator iterator = this.chunkMap.getChunks().iterator();
|
||||||
@ -1071,7 +1071,7 @@ index ab57071cc6ce8b79d883f2426855c1abf577e90d..c627d32e7dbc83b9fc60b89c73bff5c9
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
|
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
|
||||||
@@ -520,8 +525,10 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -448,8 +453,10 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
|
|
||||||
if (this.level.tickRateManager().runsNormally()) {
|
if (this.level.tickRateManager().runsNormally()) {
|
||||||
gameprofilerfiller.popPush("naturalSpawnCount");
|
gameprofilerfiller.popPush("naturalSpawnCount");
|
||||||
@ -1082,7 +1082,7 @@ index ab57071cc6ce8b79d883f2426855c1abf577e90d..c627d32e7dbc83b9fc60b89c73bff5c9
|
|||||||
|
|
||||||
this.lastSpawnState = spawnercreature_d;
|
this.lastSpawnState = spawnercreature_d;
|
||||||
gameprofilerfiller.popPush("spawnAndTick");
|
gameprofilerfiller.popPush("spawnAndTick");
|
||||||
@@ -544,22 +551,25 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -472,22 +479,25 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
|
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
|
||||||
@ -1545,10 +1545,10 @@ index e6c586eb85c6c477a3c130e1e1a37b41f17c30c8..6e35709f2a7c32050908e7e5af5529c9
|
|||||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||||
public CraftPersistentDataContainer persistentDataContainer;
|
public CraftPersistentDataContainer persistentDataContainer;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 7898e1aaf82f096fa74bd3f5859f0f4303ea677f..05d959ccc424aaaa465ec256213f2ec4d44ef8b5 100644
|
index c664021dbfffcf0db3247041270ce9a1ee6940de..332351b78fa22cd354b916c4a29bea5b4b223e40 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -710,6 +710,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -597,6 +597,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration));
|
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration));
|
||||||
|
|
||||||
if (this.needsDecoration) {
|
if (this.needsDecoration) {
|
||||||
@ -1556,7 +1556,7 @@ index 7898e1aaf82f096fa74bd3f5859f0f4303ea677f..05d959ccc424aaaa465ec256213f2ec4
|
|||||||
this.needsDecoration = false;
|
this.needsDecoration = false;
|
||||||
java.util.Random random = new java.util.Random();
|
java.util.Random random = new java.util.Random();
|
||||||
random.setSeed(this.level.getSeed());
|
random.setSeed(this.level.getSeed());
|
||||||
@@ -729,6 +730,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -616,6 +617,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
||||||
|
@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly.
|
|||||||
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
|
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 4137cf4d716680ff1b1ab0b8a3e8f7cb4bae7dbe..8fbc764fd2802f735b9d5fac2dabca6a7cebe58e 100644
|
index a720743149f9d1f90eda3b7b928b9d25d8c8f553..c09f3dc29c86fef9edfe7831776a77fc73e52210 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -296,7 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -296,7 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -472,7 +472,7 @@ index 0000000000000000000000000000000000000000..790bad0494454ca12ee152e3de6da3da
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 8fbc764fd2802f735b9d5fac2dabca6a7cebe58e..3d9c7105bfdb1b0c63a036ba3213d51b2fb6425f 100644
|
index c09f3dc29c86fef9edfe7831776a77fc73e52210..6f5b04a59fa1173bfdea2c59a9c13ca3710abb0c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -43,7 +43,6 @@ import java.util.Set;
|
@@ -43,7 +43,6 @@ import java.util.Set;
|
||||||
@ -492,7 +492,7 @@ index 8fbc764fd2802f735b9d5fac2dabca6a7cebe58e..3d9c7105bfdb1b0c63a036ba3213d51b
|
|||||||
import org.bukkit.event.server.ServerLoadEvent;
|
import org.bukkit.event.server.ServerLoadEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -1708,7 +1705,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1703,7 +1700,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
|
@ -44,10 +44,10 @@ index 6e35709f2a7c32050908e7e5af5529c9f342b787..d20f71a2098b327423cbdbbc096aa9e3
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 05d959ccc424aaaa465ec256213f2ec4d44ef8b5..329f2210b73a75fc91a5ba06a1ed7f66c5aa2680 100644
|
index 332351b78fa22cd354b916c4a29bea5b4b223e40..7bfe757b605f4e5a16b28214ac3b497e738b45b5 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -1073,11 +1073,11 @@ public class LevelChunk extends ChunkAccess {
|
@@ -948,11 +948,11 @@ public class LevelChunk extends ChunkAccess {
|
||||||
|
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
|
@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving
|
|||||||
an entity's exposure during an explosion.
|
an entity's exposure during an explosion.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 3d9c7105bfdb1b0c63a036ba3213d51b2fb6425f..5c82bf57575bbe8bea8d39bead51c6860ac86e37 100644
|
index 6f5b04a59fa1173bfdea2c59a9c13ca3710abb0c..0b666bbe75a97a8e1e6153533416d156adb64a0a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1579,6 +1579,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1574,6 +1574,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
|
@ -123,10 +123,10 @@ index 6a80479554f0c860a8dd6baa1a6506858fca83e3..6324689f52363f19501143c1649f0885
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 329f2210b73a75fc91a5ba06a1ed7f66c5aa2680..3df1ad6a4804832f4edb79a8c8fc60909a1aaa24 100644
|
index 7bfe757b605f4e5a16b28214ac3b497e738b45b5..fb953b2172c322e8abf5aa50060adbc00fe92832 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -565,8 +565,13 @@ public class LevelChunk extends ChunkAccess {
|
@@ -466,8 +466,13 @@ public class LevelChunk extends ChunkAccess {
|
||||||
BlockState iblockdata = this.getBlockState(blockposition);
|
BlockState iblockdata = this.getBlockState(blockposition);
|
||||||
|
|
||||||
if (!iblockdata.hasBlockEntity()) {
|
if (!iblockdata.hasBlockEntity()) {
|
||||||
@ -142,7 +142,7 @@ index 329f2210b73a75fc91a5ba06a1ed7f66c5aa2680..3df1ad6a4804832f4edb79a8c8fc6090
|
|||||||
} else {
|
} else {
|
||||||
BlockState iblockdata1 = blockEntity.getBlockState();
|
BlockState iblockdata1 = blockEntity.getBlockState();
|
||||||
|
|
||||||
@@ -1076,6 +1081,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -951,6 +956,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
// Paper start - Prevent block entity and entity crashes
|
// Paper start - Prevent block entity and entity crashes
|
||||||
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
||||||
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
|
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
|
||||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
|
|||||||
Saves on some object allocation and processing when no plugin listens to this
|
Saves on some object allocation and processing when no plugin listens to this
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 5c82bf57575bbe8bea8d39bead51c6860ac86e37..4fd88b63ae6e6aa3265f72f4f0ae1b1895b70be9 100644
|
index 0b666bbe75a97a8e1e6153533416d156adb64a0a..c38f932fe1c22dbe9b2583aab43ae879e4e5d4ad 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1545,6 +1545,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1545,6 +1545,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -11,10 +11,10 @@ For people who want all chunks to be treated equally, you can chose a fixed valu
|
|||||||
This allows to fine-tune vanilla gameplay.
|
This allows to fine-tune vanilla gameplay.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 3df1ad6a4804832f4edb79a8c8fc60909a1aaa24..9a94b0513e8b75c8acf0117bc0fbf563655ec3d8 100644
|
index fb953b2172c322e8abf5aa50060adbc00fe92832..a0f9fb2ac15f2fa51a3bbe915550155ac2e76649 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -271,6 +271,13 @@ public class LevelChunk extends ChunkAccess {
|
@@ -172,6 +172,13 @@ public class LevelChunk extends ChunkAccess {
|
||||||
return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks);
|
return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ index 9a1a961eabd4362c171da78c6be82c867f3696a4..1d0c473442b5c72245c356054440323e
|
|||||||
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(buf, this.playerPrefix);
|
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(buf, this.playerPrefix);
|
||||||
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(buf, this.playerSuffix);
|
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(buf, this.playerSuffix);
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 4fd88b63ae6e6aa3265f72f4f0ae1b1895b70be9..8f0a0384d12b738553a6bec02e3b9438671715a9 100644
|
index c38f932fe1c22dbe9b2583aab43ae879e4e5d4ad..785e033064ac8067baba2b471797ca34cf323825 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -640,6 +640,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -640,6 +640,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton
|
|||||||
to stop IDE complaining about potential NPE
|
to stop IDE complaining about potential NPE
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 8f0a0384d12b738553a6bec02e3b9438671715a9..fa55700e61d10cc071e55dfe43b48aee2113cd44 100644
|
index 785e033064ac8067baba2b471797ca34cf323825..75de08945200289b715d80f27adcfe2d22f42fbd 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -197,6 +197,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
|
@@ -197,6 +197,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
|
||||||
@ -25,7 +25,7 @@ index 8f0a0384d12b738553a6bec02e3b9438671715a9..fa55700e61d10cc071e55dfe43b48aee
|
|||||||
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
||||||
this.profiler = this.metricsRecorder.getProfiler();
|
this.profiler = this.metricsRecorder.getProfiler();
|
||||||
this.onMetricsRecordingStopped = (methodprofilerresults) -> {
|
this.onMetricsRecordingStopped = (methodprofilerresults) -> {
|
||||||
@@ -2554,9 +2556,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2549,9 +2551,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Async GameProfileCache saving
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index fa55700e61d10cc071e55dfe43b48aee2113cd44..56d51073eb0cd902fa2c1e790201f74d120b149f 100644
|
index 75de08945200289b715d80f27adcfe2d22f42fbd..451b6fef2c13a35eb00370fccd92581c97810137 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -999,7 +999,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -999,7 +999,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -30,7 +30,7 @@ will have plugins and worlds saving to the disk has a high potential to result
|
|||||||
in corruption/dataloss.
|
in corruption/dataloss.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 56d51073eb0cd902fa2c1e790201f74d120b149f..7335f9bb936eeb585ee077b0b9c461d7946d6134 100644
|
index 451b6fef2c13a35eb00370fccd92581c97810137..6c46ce47d1460dcd9b387f02a09d85048a45b049 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -242,6 +242,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -242,6 +242,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -559,7 +559,7 @@ index 0000000000000000000000000000000000000000..7ac27392a8647ef7d0dc78efe78703e9
|
|||||||
+ @NotNull GameProfile buildGameProfile();
|
+ @NotNull GameProfile buildGameProfile();
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
index eb36bef19e6729c1cc44aefa927317963aba929e..4f5badb9429b34ed999183321c98b60978715638 100644
|
index c6c723d9378c593c8608d5940f63c98dff097cd0..02d6c98b7a2212b13ffd9859ebfdc0a8357ebe65 100644
|
||||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||||
@@ -1,5 +1,7 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
@ -9,10 +9,10 @@ from triggering monster spawns on a server.
|
|||||||
Also a highly more effecient way to blanket block spawns in a world
|
Also a highly more effecient way to blanket block spawns in a world
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index ddadb0f13b96a39ec89cdaeea7bc02ee62ef2a06..d04b69838c6f5fd1808782cacb31c6e00087bbac 100644
|
index a7de9d6bbbd0b3d60b1d49e116c388b1846f33e4..767e3aed729b630d67a702d5e5bda02e9865e6e1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1101,7 +1101,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1074,7 +1074,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
chunkRange = (chunkRange > this.level.spigotConfig.viewDistance) ? (byte) this.level.spigotConfig.viewDistance : chunkRange;
|
chunkRange = (chunkRange > this.level.spigotConfig.viewDistance) ? (byte) this.level.spigotConfig.viewDistance : chunkRange;
|
||||||
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
|
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ index ddadb0f13b96a39ec89cdaeea7bc02ee62ef2a06..d04b69838c6f5fd1808782cacb31c6e0
|
|||||||
// Spigot end
|
// Spigot end
|
||||||
if (!this.distanceManager.hasPlayersNearby(chunkcoordintpair.toLong())) {
|
if (!this.distanceManager.hasPlayersNearby(chunkcoordintpair.toLong())) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1116,6 +1118,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1089,6 +1091,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
entityplayer = (ServerPlayer) iterator.next();
|
entityplayer = (ServerPlayer) iterator.next();
|
||||||
@ -40,10 +40,10 @@ index ddadb0f13b96a39ec89cdaeea7bc02ee62ef2a06..d04b69838c6f5fd1808782cacb31c6e0
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index c627d32e7dbc83b9fc60b89c73bff5c9992ad548..f4451bb402abbc8e6506132b9b9702bb5d75e097 100644
|
index 0ff45d4ce6ae0b7feac53c7a9f361f6454f8b7c3..035c33b1e1be4f41e5cbe09bf6c3abd617258cad 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -535,6 +535,15 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -463,6 +463,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
||||||
|
|
||||||
Util.shuffle(list, this.level.random);
|
Util.shuffle(list, this.level.random);
|
||||||
|
@ -162,7 +162,7 @@ index 0000000000000000000000000000000000000000..874dcbefea469440a9028ddc399a37c9
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 7335f9bb936eeb585ee077b0b9c461d7946d6134..1c024fb7f682c81c465f59f4ab5fbeac964d73e1 100644
|
index 6c46ce47d1460dcd9b387f02a09d85048a45b049..f71b1c2497594b592bcc51be9fa6a6d8fe8e819b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -3,6 +3,9 @@ package net.minecraft.server;
|
@@ -3,6 +3,9 @@ package net.minecraft.server;
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index d04b69838c6f5fd1808782cacb31c6e00087bbac..96b7f0ac35a1e87c3f78a24180b207c32749fb71 100644
|
index 767e3aed729b630d67a702d5e5bda02e9865e6e1..27eaeea3f0719167d89e39b0b60f91ad9cc9f64e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1321,6 +1321,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1294,6 +1294,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
} else {
|
} else {
|
||||||
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
|
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ index d04b69838c6f5fd1808782cacb31c6e00087bbac..96b7f0ac35a1e87c3f78a24180b207c3
|
|||||||
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
|
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
|
||||||
playerchunkmap_entitytracker.updatePlayers(this.level.players());
|
playerchunkmap_entitytracker.updatePlayers(this.level.players());
|
||||||
if (entity instanceof ServerPlayer) {
|
if (entity instanceof ServerPlayer) {
|
||||||
@@ -1361,7 +1362,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1334,7 +1335,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
if (playerchunkmap_entitytracker1 != null) {
|
if (playerchunkmap_entitytracker1 != null) {
|
||||||
playerchunkmap_entitytracker1.broadcastRemoved();
|
playerchunkmap_entitytracker1.broadcastRemoved();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash.
|
|||||||
This will help diagnose what was going on in that time before the crash.
|
This will help diagnose what was going on in that time before the crash.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 1c024fb7f682c81c465f59f4ab5fbeac964d73e1..3fbe9a4981c682ec602d8ad1c390a10f26505f08 100644
|
index f71b1c2497594b592bcc51be9fa6a6d8fe8e819b..6a97ab5e8a435e67df77b1d0480ccb397314ee05 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1108,6 +1108,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1108,6 +1108,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -92,7 +92,7 @@ index 54562fa04d14a937451ea7aa9d80194f2c31b471..4cf88f6d815d60cfbf8e4ecf9d96d0cf
|
|||||||
return executorService;
|
return executorService;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 3fbe9a4981c682ec602d8ad1c390a10f26505f08..51cd2b33c89f2ba92ad926456551e789c8627c3b 100644
|
index 6a97ab5e8a435e67df77b1d0480ccb397314ee05..c8b5714ad87b501fdf820ae2ad8e6a4bdef82651 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -323,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -323,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -8,7 +8,7 @@ the updates per world, so that we can re-use the same packet
|
|||||||
object for every player unless they have per-player time enabled.
|
object for every player unless they have per-player time enabled.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 51cd2b33c89f2ba92ad926456551e789c8627c3b..3d9a333c0f8175fd3b961185f52ea9a83a2fbeb3 100644
|
index c8b5714ad87b501fdf820ae2ad8e6a4bdef82651..2e96a4c61f9053c20060e9f45a313a6135ea4f16 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1563,12 +1563,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1563,12 +1563,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -53,7 +53,7 @@ index 72756ef14b8ec8afd80313b9f6aaf76722cb18cf..a05aea8561ac102476ee1b3068942b09
|
|||||||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 3d9a333c0f8175fd3b961185f52ea9a83a2fbeb3..6494b92c6a6444a66ea0e5f8f2890c47f334c938 100644
|
index 2e96a4c61f9053c20060e9f45a313a6135ea4f16..df5b553b8d1525f14dbb88ea86e1bf9d9c9e6950 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -931,6 +931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -931,6 +931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Server Tick Events
|
|||||||
Fires event at start and end of a server tick
|
Fires event at start and end of a server tick
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 6494b92c6a6444a66ea0e5f8f2890c47f334c938..12f530044d918ddc1ba4b2376419f9ed72283b98 100644
|
index df5b553b8d1525f14dbb88ea86e1bf9d9c9e6950..ee86f2cb71b2c8dc85c27635efca3666de7a3cbe 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1435,6 +1435,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1435,6 +1435,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
|
|||||||
Also ignores Enderdragon, defaulting it to Mojang's setting
|
Also ignores Enderdragon, defaulting it to Mojang's setting
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 96b7f0ac35a1e87c3f78a24180b207c32749fb71..795c81c8f6fa59eded8b5a5084a8acb46d118fdb 100644
|
index 27eaeea3f0719167d89e39b0b60f91ad9cc9f64e..5b62b6ebfc1b2a9d4673953c20b12a97c50ef3a5 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1613,6 +1613,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1586,6 +1586,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Entity entity = (Entity) iterator.next();
|
Entity entity = (Entity) iterator.next();
|
||||||
int j = entity.getType().clientTrackingRange() * 16;
|
int j = entity.getType().clientTrackingRange() * 16;
|
||||||
|
@ -7,10 +7,10 @@ bypass the need to get a player chunk, then get the either,
|
|||||||
then unwrap it...
|
then unwrap it...
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index f4451bb402abbc8e6506132b9b9702bb5d75e097..ef35e5a9fc0bfcd13f02f9193fdd1e7a811e88fd 100644
|
index 035c33b1e1be4f41e5cbe09bf6c3abd617258cad..097a333487d646c773349cde3cd08026986fd038 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -253,6 +253,12 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -181,6 +181,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
return this.getChunk(x, z, leastStatus, create);
|
return this.getChunk(x, z, leastStatus, create);
|
||||||
}, this.mainThreadProcessor).join();
|
}, this.mainThreadProcessor).join();
|
||||||
} else {
|
} else {
|
||||||
@ -23,7 +23,7 @@ index f4451bb402abbc8e6506132b9b9702bb5d75e097..ef35e5a9fc0bfcd13f02f9193fdd1e7a
|
|||||||
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||||
|
|
||||||
gameprofilerfiller.incrementCounter("getChunk");
|
gameprofilerfiller.incrementCounter("getChunk");
|
||||||
@@ -296,33 +302,7 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -224,33 +230,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
if (Thread.currentThread() != this.mainThread) {
|
if (Thread.currentThread() != this.mainThread) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
@ -300,10 +300,10 @@ index 0000000000000000000000000000000000000000..95d6022c9cfb2e36ec5a71be6e343540
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index ef35e5a9fc0bfcd13f02f9193fdd1e7a811e88fd..a94833f58eb823332890d07c147161e9e0a938e9 100644
|
index 097a333487d646c773349cde3cd08026986fd038..be9604a0f267558c95125852d86761a2f175732a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -280,6 +280,7 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -208,6 +208,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
|
|
||||||
Objects.requireNonNull(completablefuture);
|
Objects.requireNonNull(completablefuture);
|
||||||
if (!completablefuture.isDone()) { // Paper
|
if (!completablefuture.isDone()) { // Paper
|
||||||
|
@ -8,10 +8,10 @@ faster on its own, however removing the try catch makes it
|
|||||||
easier to inline due to code size
|
easier to inline due to code size
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 9a94b0513e8b75c8acf0117bc0fbf563655ec3d8..46a5d9270aaaccb2df7131fb9c921cccf914085c 100644
|
index a0f9fb2ac15f2fa51a3bbe915550155ac2e76649..c7be1f8fdca34bcc12ecbe40ee5f426e0cd068d7 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -369,18 +369,20 @@ public class LevelChunk extends ChunkAccess {
|
@@ -270,18 +270,20 @@ public class LevelChunk extends ChunkAccess {
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidState getFluidState(int x, int y, int z) {
|
public FluidState getFluidState(int x, int y, int z) {
|
||||||
@ -38,7 +38,7 @@ index 9a94b0513e8b75c8acf0117bc0fbf563655ec3d8..46a5d9270aaaccb2df7131fb9c921ccc
|
|||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Getting fluid state");
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Getting fluid state");
|
||||||
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Block being got");
|
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Block being got");
|
||||||
@@ -390,6 +392,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -291,6 +293,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
});
|
});
|
||||||
throw new ReportedException(crashreport);
|
throw new ReportedException(crashreport);
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ index 72f2e81b9905a0d57ed8e2a88578f62d5235c456..7b58b2d6297800c2dcdbf7539e5ab8e7
|
|||||||
|
|
||||||
public static void registerCommands(final MinecraftServer server) {
|
public static void registerCommands(final MinecraftServer server) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 12f530044d918ddc1ba4b2376419f9ed72283b98..2a2b5205692573c9886a2696f376958809b899ac 100644
|
index ee86f2cb71b2c8dc85c27635efca3666de7a3cbe..1e6546637c5c2ddf4aacc7a3ea8623ce55059203 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -258,6 +258,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -258,6 +258,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -152,7 +152,7 @@ index 12f530044d918ddc1ba4b2376419f9ed72283b98..2a2b5205692573c9886a2696f3769588
|
|||||||
this.logTickMethodTime(i);
|
this.logTickMethodTime(i);
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||||
@@ -2863,4 +2873,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2858,4 +2868,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
|
|||||||
Stack will identify any causer of this and warn instead of crashing.
|
Stack will identify any causer of this and warn instead of crashing.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 795c81c8f6fa59eded8b5a5084a8acb46d118fdb..1709821c73362b2ae54681ec1d59b40bfa9335b3 100644
|
index 5b62b6ebfc1b2a9d4673953c20b12a97c50ef3a5..02ea2b2d5463909663bb599b6ca57198b8513456 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1308,6 +1308,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1281,6 +1281,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
|
|
||||||
public void addEntity(Entity entity) {
|
public void addEntity(Entity entity) {
|
||||||
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
|
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
|
||||||
|
@ -31,10 +31,10 @@ delays anymore.
|
|||||||
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
|
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 1709821c73362b2ae54681ec1d59b40bfa9335b3..68a1cc5f4f7f5997dfb7d40647e3e027c23ffb14 100644
|
index 02ea2b2d5463909663bb599b6ca57198b8513456..37bfe3d315210462ed69bb1cb161604e9eb85c36 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1315,6 +1315,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1288,6 +1288,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Paper end - ignore and warn about illegal addEntity calls instead of crashing server
|
// Paper end - ignore and warn about illegal addEntity calls instead of crashing server
|
||||||
|
@ -49,7 +49,7 @@ index e25fc35716aff1d1805884b18f67b0eb33d8c05c..8ca9ac8eff9d605baa878ca24e165ac5
|
|||||||
StackTraceElement[] astacktraceelement = exception.getStackTrace();
|
StackTraceElement[] astacktraceelement = exception.getStackTrace();
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 2a2b5205692573c9886a2696f376958809b899ac..15938074ad20133f5ccdab0c8566556d7b807d8f 100644
|
index 1e6546637c5c2ddf4aacc7a3ea8623ce55059203..af83b1c762239fe7c8c11d3904f30504b0a1ca67 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -916,6 +916,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -916,6 +916,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -10,7 +10,7 @@ Adds a 5 second grace period for any async tasks to finish and warns
|
|||||||
if any are still running after that delay just as reload does.
|
if any are still running after that delay just as reload does.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 15938074ad20133f5ccdab0c8566556d7b807d8f..095215a5cbf1abeb7836a6ccc87c195019a7f019 100644
|
index af83b1c762239fe7c8c11d3904f30504b0a1ca67..badd42d84b6367f6926bcff0ec8426fb6402ae80 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -943,6 +943,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -943,6 +943,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -8,7 +8,7 @@ makes it so that the server keeps the last difficulty used instead
|
|||||||
of restoring the server.properties every single load.
|
of restoring the server.properties every single load.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 095215a5cbf1abeb7836a6ccc87c195019a7f019..1d141c9ee7b8193d46ba47a8586fc334cabb62a1 100644
|
index badd42d84b6367f6926bcff0ec8426fb6402ae80..331ed639496a73dbfdde795b6d6154a9c8ea78b4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -837,7 +837,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -837,7 +837,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -20,7 +20,7 @@ index 095215a5cbf1abeb7836a6ccc87c195019a7f019..1d141c9ee7b8193d46ba47a8586fc334
|
|||||||
|
|
||||||
this.forceTicks = false;
|
this.forceTicks = false;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -1854,11 +1854,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1849,11 +1849,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ index 095215a5cbf1abeb7836a6ccc87c195019a7f019..1d141c9ee7b8193d46ba47a8586fc334
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1872,7 +1875,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1867,7 +1870,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 1d141c9ee7b8193d46ba47a8586fc334cabb62a1..eddb8792be0581d8f1c87d18b5ab7a02571addc7 100644
|
index 331ed639496a73dbfdde795b6d6154a9c8ea78b4..5b7f2b2993844cbcc13742f69b0521832d1970da 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2153,6 +2153,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2148,6 +2148,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.getPlayerList().reloadResources();
|
this.getPlayerList().reloadResources();
|
||||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index eddb8792be0581d8f1c87d18b5ab7a02571addc7..b47110e9b5d8effdc9e768488f99a614c1070814 100644
|
index 5b7f2b2993844cbcc13742f69b0521832d1970da..e39cfc9750bf1d3f20abb3a2e9d46fa51ccdc248 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2278,13 +2278,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2273,13 +2273,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
if (this.isEnforceWhitelist()) {
|
if (this.isEnforceWhitelist()) {
|
||||||
PlayerList playerlist = source.getServer().getPlayerList();
|
PlayerList playerlist = source.getServer().getPlayerList();
|
||||||
UserWhiteList whitelist = playerlist.getWhiteList();
|
UserWhiteList whitelist = playerlist.getWhiteList();
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index b47110e9b5d8effdc9e768488f99a614c1070814..691d9d18e72a07b85bf13c6990b44e5cf56dffb5 100644
|
index e39cfc9750bf1d3f20abb3a2e9d46fa51ccdc248..3511b578f137c94ed562690901952e81e6f90ee5 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2122,7 +2122,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2117,7 +2117,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return this.functionManager;
|
return this.functionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ index b47110e9b5d8effdc9e768488f99a614c1070814..691d9d18e72a07b85bf13c6990b44e5c
|
|||||||
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||||
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
|
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
|
||||||
PackRepository resourcepackrepository = this.packRepository;
|
PackRepository resourcepackrepository = this.packRepository;
|
||||||
@@ -2154,6 +2160,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2149,6 +2155,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||||
org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings; they can be defined by datapacks so refresh it here
|
org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings; they can be defined by datapacks so refresh it here
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityMoveEvent
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 691d9d18e72a07b85bf13c6990b44e5cf56dffb5..64a334c368152656f0dbb811220ae20fbd3d5f85 100644
|
index 3511b578f137c94ed562690901952e81e6f90ee5..93c92146c2c7961a5de970e1c18eb7a1907c551b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1608,6 +1608,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1608,6 +1608,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 64a334c368152656f0dbb811220ae20fbd3d5f85..fa37c6b43f76af0b82b056cf87ba350abf92e7bb 100644
|
index 93c92146c2c7961a5de970e1c18eb7a1907c551b..84bc3fac67c8db28a7102f99bffe762cf34a4a7a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2294,7 +2294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2289,7 +2289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
||||||
|
|
||||||
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
|
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
|
||||||
|
@ -43,10 +43,10 @@ index dbcf183483766f39334d7f7e8336033906625f3f..300929a406905f5ff1ede664d5b99fb0
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index fa37c6b43f76af0b82b056cf87ba350abf92e7bb..ee212ed5538357830ea8b69da650ab67d67634bb 100644
|
index 84bc3fac67c8db28a7102f99bffe762cf34a4a7a..695d6265b4a9f98ba630593ba6c47769240bed93 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2294,7 +2294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2289,7 +2289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
||||||
|
|
||||||
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
|
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
|
||||||
|
@ -10,22 +10,22 @@ chunks did get inlined, but the standard CPS.getChunkAt
|
|||||||
method was not inlined.
|
method was not inlined.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index ed1fc466151ebebf7c3ac135c6893f4ea9a55a52..481248ef82d4257ca4cc88ab28a1a7946e22aef6 100644
|
index ed1fc466151ebebf7c3ac135c6893f4ea9a55a52..38bcf9f410e8a9d47c7d486c28dbc16a6225b650 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -352,6 +352,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -352,7 +352,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline
|
public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline
|
||||||
|
- return (LevelChunk) this.getChunk(chunkX, chunkZ, ChunkStatus.FULL, true); // Paper - avoid a method jump
|
||||||
+ // Paper start - Perf: make sure loaded chunks get the inlined variant of this function
|
+ // Paper start - Perf: make sure loaded chunks get the inlined variant of this function
|
||||||
+ net.minecraft.server.level.ServerChunkCache cps = ((ServerLevel)this).getChunkSource();
|
+ net.minecraft.server.level.ServerChunkCache cps = ((ServerLevel)this).getChunkSource();
|
||||||
+ if (cps.mainThread == Thread.currentThread()) {
|
+ LevelChunk ifLoaded = cps.getChunkAtIfLoadedImmediately(chunkX, chunkZ);
|
||||||
+ LevelChunk ifLoaded = cps.getChunkAtIfLoadedMainThread(chunkX, chunkZ);
|
+ if (ifLoaded != null) {
|
||||||
+ if (ifLoaded != null) {
|
+ return ifLoaded;
|
||||||
+ return ifLoaded;
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
|
+ return (LevelChunk) cps.getChunk(chunkX, chunkZ, ChunkStatus.FULL, true); // Paper - avoid a method jump
|
||||||
+ // Paper end - Perf: make sure loaded chunks get the inlined variant of this function
|
+ // Paper end - Perf: make sure loaded chunks get the inlined variant of this function
|
||||||
return (LevelChunk) this.getChunk(chunkX, chunkZ, ChunkStatus.FULL, true); // Paper - avoid a method jump
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - if loaded
|
||||||
|
@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have
|
|||||||
better lookups than HashMap.
|
better lookups than HashMap.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 68a1cc5f4f7f5997dfb7d40647e3e027c23ffb14..77f064fb4437c1d98cf91dde98d4d88b28afa7c8 100644
|
index 37bfe3d315210462ed69bb1cb161604e9eb85c36..be0f4a2a9c7fbc359fe79ecf82340db8f7436b22 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1529,7 +1529,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1502,7 +1502,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
final Entity entity;
|
final Entity entity;
|
||||||
private final int range;
|
private final int range;
|
||||||
SectionPos lastSectionPos;
|
SectionPos lastSectionPos;
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index ee212ed5538357830ea8b69da650ab67d67634bb..22f8e49536658fabe6136dbeec6b77eaf4ae5ee8 100644
|
index 695d6265b4a9f98ba630593ba6c47769240bed93..2559a40546701fefa7f28603cb637108bfc659da 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -612,7 +612,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -612,7 +612,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -9,7 +9,7 @@ This might result in chunks loading far slower in the nether,
|
|||||||
for example.
|
for example.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 22f8e49536658fabe6136dbeec6b77eaf4ae5ee8..e5017b66b6b8b5f17fc49f0fbc5d342241cd9cad 100644
|
index 2559a40546701fefa7f28603cb637108bfc659da..f728c5b75ee7db5522e558891988079c52df5e72 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1371,6 +1371,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1371,6 +1371,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -10,7 +10,7 @@ just looking at the LevelStem key, look at the DimensionType key which
|
|||||||
is one level below that. Defaults to off to keep vanilla behavior.
|
is one level below that. Defaults to off to keep vanilla behavior.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index e5017b66b6b8b5f17fc49f0fbc5d342241cd9cad..f979bfd78e2d19b525e973be0ffef5bda0068c4b 100644
|
index f728c5b75ee7db5522e558891988079c52df5e72..0ec8f1c94279b75369ab6bae98789c60a971502c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -632,7 +632,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -632,7 +632,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -7,7 +7,7 @@ Some parts of legacy conversion will need the overworld
|
|||||||
to get the legacy structure data storage
|
to get the legacy structure data storage
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index f979bfd78e2d19b525e973be0ffef5bda0068c4b..833ec409e3f79e1ae2b664418f219adb3af2957f 100644
|
index 0ec8f1c94279b75369ab6bae98789c60a971502c..4e2ce30bc67b0033107715a5a2dbb419bdf17a4f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -644,9 +644,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -644,9 +644,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -96,10 +96,10 @@ index 0000000000000000000000000000000000000000..7ea357ac2f3a93db4ebdf24b5072be7d
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 833ec409e3f79e1ae2b664418f219adb3af2957f..29011d222434cbb2c71797786b8376ea37c8023a 100644
|
index 4e2ce30bc67b0033107715a5a2dbb419bdf17a4f..2408e5afb9096aa991742983bb573040fbfdb5cb 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2166,6 +2166,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2161,6 +2161,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
this.worldData.setDataConfiguration(worlddataconfiguration);
|
this.worldData.setDataConfiguration(worlddataconfiguration);
|
||||||
this.resources.managers.updateRegistryTags();
|
this.resources.managers.updateRegistryTags();
|
||||||
|
@ -7,7 +7,7 @@ There are no plans to support creating worlds while worlds are
|
|||||||
being ticked themselvess.
|
being ticked themselvess.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 29011d222434cbb2c71797786b8376ea37c8023a..4b44447360b75b6dbe93d8176dcba2db02d77f1e 100644
|
index 2408e5afb9096aa991742983bb573040fbfdb5cb..56ab40965ca6034ed430d4d5c4be99fa69a3a453 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -318,6 +318,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -318,6 +318,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -36,7 +36,7 @@ index 29011d222434cbb2c71797786b8376ea37c8023a..4b44447360b75b6dbe93d8176dcba2db
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||||
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
||||||
@@ -1655,6 +1658,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1650,6 +1653,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.profiler.pop();
|
this.profiler.pop();
|
||||||
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Warn on plugins accessing faraway chunks
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 481248ef82d4257ca4cc88ab28a1a7946e22aef6..b97427789d6162e16b9c3a56b89b2dd08a04297f 100644
|
index 38bcf9f410e8a9d47c7d486c28dbc16a6225b650..210c3b6167dac93e550fe849e34b5aa404ab6dce 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -339,7 +339,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -339,7 +339,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 4b44447360b75b6dbe93d8176dcba2db02d77f1e..ba382397e39311598d044faf6b74665810d2e510 100644
|
index 56ab40965ca6034ed430d4d5c4be99fa69a3a453..eef519384b5f8f6b2551ed61affe6cb1f3489702 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1239,6 +1239,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1239,6 +1239,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -85,10 +85,10 @@ index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c5346520
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 77f064fb4437c1d98cf91dde98d4d88b28afa7c8..ccbd527803a2a4e911a01f815cc9c7ab785af836 100644
|
index be0f4a2a9c7fbc359fe79ecf82340db8f7436b22..b6b15e8ce98603d6e580a31ba458fedc8b3f663a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1091,7 +1091,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1064,7 +1064,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,10 +47,10 @@ index 4d9f1fc884050993287adfa4578a87da710623fb..a8dfe7a4b3d01bf75587be078f471d1e
|
|||||||
this.disconnect((Component) Component.translatable("multiplayer.disconnect.server_shutdown"));
|
this.disconnect((Component) Component.translatable("multiplayer.disconnect.server_shutdown"));
|
||||||
} catch (ClassCastException classcastexception) {
|
} catch (ClassCastException classcastexception) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index ba382397e39311598d044faf6b74665810d2e510..fcf450f9fefda8cf2391dcb61075cbd855475d6c 100644
|
index eef519384b5f8f6b2551ed61affe6cb1f3489702..374c20e530d2abd41674d80c711bd3737c6f6941 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -2099,7 +2099,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2094,7 +2094,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@Override
|
@Override
|
||||||
public void executeIfPossible(Runnable runnable) {
|
public void executeIfPossible(Runnable runnable) {
|
||||||
if (this.isStopped()) {
|
if (this.isStopped()) {
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Player Entity Tracking Events
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index ccbd527803a2a4e911a01f815cc9c7ab785af836..e2521e1a56df8dcb1de815e5973de952408d3b8b 100644
|
index b6b15e8ce98603d6e580a31ba458fedc8b3f663a..91ca37605bf7ba65875b588fe9764b30214f63b6 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1601,7 +1601,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1574,7 +1574,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
if (flag) {
|
if (flag) {
|
||||||
if (this.seenBy.add(player.connection)) {
|
if (this.seenBy.add(player.connection)) {
|
||||||
|
@ -22,10 +22,10 @@ index 7d76cdc59984b156628273c8357485eb10046007..7180996027f70aef7afe32fb2adfce64
|
|||||||
itemstack.consume(1, entityhuman);
|
itemstack.consume(1, entityhuman);
|
||||||
return InteractionResult.sidedSuccess(world.isClientSide);
|
return InteractionResult.sidedSuccess(world.isClientSide);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index b97427789d6162e16b9c3a56b89b2dd08a04297f..b8d8041aecc2ff008247449cba8d9f192cf51073 100644
|
index 210c3b6167dac93e550fe849e34b5aa404ab6dce..ed1c50d31fc077e4e009719fa622a44edefcdf2c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -554,17 +554,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -552,17 +552,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
|
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
|
||||||
CraftWorld world = ((ServerLevel) this).getWorld();
|
CraftWorld world = ((ServerLevel) this).getWorld();
|
||||||
|
@ -1148,7 +1148,7 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index fcf450f9fefda8cf2391dcb61075cbd855475d6c..b7254c342501f2d7fbbe8959a6e88a5d1f6e076e 100644
|
index 374c20e530d2abd41674d80c711bd3737c6f6941..cbceb0ddea32781f89a19b1edb258bc23b96ee92 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1579,6 +1579,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1579,6 +1579,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -29,10 +29,10 @@ index 92be749721f26e9385e592a985db58cf05c67801..1f2e6f57ffb827ef9bf3623bfdde07db
|
|||||||
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
|
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index b8d8041aecc2ff008247449cba8d9f192cf51073..ffaf6e65a7314479a129fed41f58bf2d75ea5dae 100644
|
index ed1c50d31fc077e4e009719fa622a44edefcdf2c..8337f2f1d650fc7efb830a7034e3676dc0695ee4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1380,4 +1380,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1378,4 +1378,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
|
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
|
||||||
}
|
}
|
||||||
// Paper end - respect global sound events gamerule
|
// Paper end - respect global sound events gamerule
|
||||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
|
|||||||
Options to configure entity tracking by Y coordinate, also for each entity category.
|
Options to configure entity tracking by Y coordinate, also for each entity category.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index e2521e1a56df8dcb1de815e5973de952408d3b8b..6c5557aad2455b79bb2adf8939eb9a6127ccc3c3 100644
|
index 91ca37605bf7ba65875b588fe9764b30214f63b6..2943390c0ec7e542d2bb1996dbbd626445c3108e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1593,6 +1593,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1566,6 +1566,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
|
double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
|
||||||
double d2 = d0 * d0;
|
double d2 = d0 * d0;
|
||||||
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z);
|
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z);
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't check if we can see non-visible entities
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 6c5557aad2455b79bb2adf8939eb9a6127ccc3c3..469f1dcb22c06025681e727e281b5b53f2b21c1f 100644
|
index 2943390c0ec7e542d2bb1996dbbd626445c3108e..7bc142fd0ba58846f1b2ac57df0bfc044966f4ed 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1604,7 +1604,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1577,7 +1577,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
// Paper end - Configurable entity tracking range by Y
|
// Paper end - Configurable entity tracking range by Y
|
||||||
|
|
||||||
// CraftBukkit start - respect vanish API
|
// CraftBukkit start - respect vanish API
|
||||||
|
@ -133,7 +133,7 @@ index cf8258e8d46ca7286a66c38fa24af369bd9a279f..0555abfda468c343af8244a122ebe769
|
|||||||
// return Optional.empty();
|
// return Optional.empty();
|
||||||
// }
|
// }
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
index 0794d92c42b0db6b367505ae28f09f1fd39fa312..cd7f1309cf01a5f01a28aded03a36fe15adb1756 100644
|
index 524b51a0ab808a0629c871ad813115abd4b49dbd..fceed3d08ee6f4c171685986bb19d2be592eedc6 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
@@ -92,15 +92,17 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
|
@@ -92,15 +92,17 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
|
||||||
|
@ -7,10 +7,10 @@ This causes spawnAfterBreak to spawn xp by default, removing the need to manuall
|
|||||||
For classes that use custom xp amounts, they can drop the resources with disabling
|
For classes that use custom xp amounts, they can drop the resources with disabling
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index ffaf6e65a7314479a129fed41f58bf2d75ea5dae..16478e2b2368636394cec8a9b30c6fb03e190851 100644
|
index 8337f2f1d650fc7efb830a7034e3676dc0695ee4..2f1acea765d1b6726863cdc89707ca6148548493 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -619,7 +619,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -617,7 +617,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
if (drop) {
|
if (drop) {
|
||||||
BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null;
|
BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null;
|
||||||
|
|
||||||
|
@ -18,10 +18,10 @@ index a043ac10834562d357ef0b5aded2e916e2a0d056..74276c368016fcc4dbf9579b2ecbadc9
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static long encode(double value) {
|
static long encode(double value) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 469f1dcb22c06025681e727e281b5b53f2b21c1f..2ce7da9707d7c1a48b5609ae51a516d599d7aee8 100644
|
index 7bc142fd0ba58846f1b2ac57df0bfc044966f4ed..a03385b1b0a2f9b98319137b87d917856d3c632c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1587,10 +1587,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1560,10 +1560,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
public void updatePlayer(ServerPlayer player) {
|
public void updatePlayer(ServerPlayer player) {
|
||||||
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
|
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
|
||||||
if (player != this.entity) {
|
if (player != this.entity) {
|
||||||
|
@ -29,7 +29,7 @@ index cc847dce0116b8260790b890b1d5452c280e186c..2a5453707bc172d8d0efe3f11959cb0b
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index b7254c342501f2d7fbbe8959a6e88a5d1f6e076e..837fc12dfc57f36f06bd8e49681bb4b98a87397c 100644
|
index cbceb0ddea32781f89a19b1edb258bc23b96ee92..fc0f17cd7ed4fcf10e0396aeeed115280318128d 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1136,6 +1136,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1136,6 +1136,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -36,10 +36,10 @@ index 682c8cfbd917c086072f1756861a340800ea40da..b26a4a38144ec1b171db911bbf949b53
|
|||||||
|
|
||||||
nbttagcompound.putInt("x", pos.getX());
|
nbttagcompound.putInt("x", pos.getX());
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 46a5d9270aaaccb2df7131fb9c921cccf914085c..8ae6a4311aa52f84130a1eba61a1ad84e2272350 100644
|
index c7be1f8fdca34bcc12ecbe40ee5f426e0cd068d7..7f8983a2102787b13e5d28d6981055da6acd1012 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -1081,9 +1081,14 @@ public class LevelChunk extends ChunkAccess {
|
@@ -956,9 +956,14 @@ public class LevelChunk extends ChunkAccess {
|
||||||
if (this.blockEntity.getType().isValid(iblockdata)) {
|
if (this.blockEntity.getType().isValid(iblockdata)) {
|
||||||
this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), iblockdata, this.blockEntity);
|
this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), iblockdata, this.blockEntity);
|
||||||
this.loggedInvalidBlockState = false;
|
this.loggedInvalidBlockState = false;
|
||||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Per world ticks per spawn settings
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 16478e2b2368636394cec8a9b30c6fb03e190851..4d6409875771413de7ae20def2aaad4049709c30 100644
|
index 2f1acea765d1b6726863cdc89707ca6148548493..81bdb6e64e04641f741c2c3350236685b097ec7a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -186,6 +186,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -186,6 +186,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
@ -25,10 +25,10 @@ index 69914a048987c21ee2ed2c489aab269862fda8f2..bff83fe413c7baef4ba56a3270ea4463
|
|||||||
|
|
||||||
if (!this.level.isInWorldBounds(blockposition)) {
|
if (!this.level.isInWorldBounds(blockposition)) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 4d6409875771413de7ae20def2aaad4049709c30..dd519eacd6d4bea5447bea471f0ac6540d9bb49c 100644
|
index 81bdb6e64e04641f741c2c3350236685b097ec7a..c6c9400fa155831ab11d0f059971d0123617e622 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -449,6 +449,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -447,6 +447,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
|
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
|
||||||
// CraftBukkit start - tree generation
|
// CraftBukkit start - tree generation
|
||||||
if (this.captureTreeGeneration) {
|
if (this.captureTreeGeneration) {
|
||||||
|
@ -2213,7 +2213,7 @@ index 982b2bab27e3d55d0ba07060862c0c3183ad91b0..5fa8a3343ffc11e82c20b78a73205fd8
|
|||||||
Component component = message.resolveComponent(commandSourceStack);
|
Component component = message.resolveComponent(commandSourceStack);
|
||||||
CommandSigningContext commandSigningContext = commandSourceStack.getSigningContext();
|
CommandSigningContext commandSigningContext = commandSourceStack.getSigningContext();
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 837fc12dfc57f36f06bd8e49681bb4b98a87397c..6915522f669631779c1fb8a8e2db330f4b9fb921 100644
|
index fc0f17cd7ed4fcf10e0396aeeed115280318128d..e14c0e1ccf526f81e28db5545d9e2351641e1bc8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -306,7 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -306,7 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -2243,7 +2243,7 @@ index 837fc12dfc57f36f06bd8e49681bb4b98a87397c..6915522f669631779c1fb8a8e2db330f
|
|||||||
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
|
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
|
||||||
this.connection.acceptConnections();
|
this.connection.acceptConnections();
|
||||||
}
|
}
|
||||||
@@ -2187,9 +2189,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2182,9 +2184,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return new MinecraftServer.ReloadableResources(resourcemanager, datapackresources);
|
return new MinecraftServer.ReloadableResources(resourcemanager, datapackresources);
|
||||||
});
|
});
|
||||||
}).thenAcceptAsync((minecraftserver_reloadableresources) -> {
|
}).thenAcceptAsync((minecraftserver_reloadableresources) -> {
|
||||||
@ -2254,7 +2254,7 @@ index 837fc12dfc57f36f06bd8e49681bb4b98a87397c..6915522f669631779c1fb8a8e2db330f
|
|||||||
this.packRepository.setSelected(dataPacks);
|
this.packRepository.setSelected(dataPacks);
|
||||||
WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures());
|
WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures());
|
||||||
|
|
||||||
@@ -2200,8 +2202,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2195,8 +2197,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.getPlayerList().reloadResources();
|
this.getPlayerList().reloadResources();
|
||||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||||
|
@ -21,7 +21,7 @@ index b800b03ae034b276740c3b41555a52b778ad9aad..86197725f0f2ac1e650297ae7a799075
|
|||||||
|
|
||||||
// Brute force all possible updates
|
// Brute force all possible updates
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index dd519eacd6d4bea5447bea471f0ac6540d9bb49c..6f822e9487bef5b9766d5ae86ebbd687e4eadc42 100644
|
index c6c9400fa155831ab11d0f059971d0123617e622..e27d3547d1e19c137e05e6b8d075127a8bafb237 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -151,6 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -151,6 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@ -33,10 +33,10 @@ index dd519eacd6d4bea5447bea471f0ac6540d9bb49c..6f822e9487bef5b9766d5ae86ebbd687
|
|||||||
public Map<BlockPos, BlockEntity> capturedTileEntities = new java.util.LinkedHashMap<>(); // Paper - Retain block place order when capturing blockstates
|
public Map<BlockPos, BlockEntity> capturedTileEntities = new java.util.LinkedHashMap<>(); // Paper - Retain block place order when capturing blockstates
|
||||||
public List<ItemEntity> captureDrops;
|
public List<ItemEntity> captureDrops;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 8ae6a4311aa52f84130a1eba61a1ad84e2272350..6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e 100644
|
index 7f8983a2102787b13e5d28d6981055da6acd1012..602ad80c2b93d320bf2a25832d25a58cb8c72e4b 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -444,7 +444,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -345,7 +345,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
|
|
||||||
boolean flag3 = iblockdata1.hasBlockEntity();
|
boolean flag3 = iblockdata1.hasBlockEntity();
|
||||||
|
|
||||||
|
@ -3105,10 +3105,10 @@ index 0000000000000000000000000000000000000000..e95cc73ddf20050aa4a241b0a309240e
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java
|
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..532a8c15009a4514d2682f52129785feb34a56f8
|
index 0000000000000000000000000000000000000000..c2ff037e180393de6576f12c32c665ef640d6f50
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java
|
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java
|
||||||
@@ -0,0 +1,156 @@
|
@@ -0,0 +1,162 @@
|
||||||
+package ca.spottedleaf.moonrise.patches.chunk_system;
|
+package ca.spottedleaf.moonrise.patches.chunk_system;
|
||||||
+
|
+
|
||||||
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
|
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
|
||||||
@ -3194,22 +3194,28 @@ index 0000000000000000000000000000000000000000..532a8c15009a4514d2682f52129785fe
|
|||||||
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(level, holder);
|
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(level, holder);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static void onChunkBorder(final LevelChunk chunk, final ChunkHolder holder) {
|
+ public static void onChunkPreBorder(final LevelChunk chunk, final ChunkHolder holder) {
|
||||||
+ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
|
+ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
|
||||||
+ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, chunk);
|
+ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, chunk);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public static void onChunkBorder(final LevelChunk chunk, final ChunkHolder holder) {
|
||||||
+ // TODO move hook
|
+ // TODO move hook
|
||||||
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkBorder(chunk, holder);
|
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkBorder(chunk, holder);
|
||||||
+ chunk.loadCallback(); // Paper
|
+ chunk.loadCallback(); // Paper
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static void onChunkNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
|
+ public static void onChunkNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
|
||||||
+ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
|
|
||||||
+ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, null);
|
|
||||||
+ // TODO move hook
|
+ // TODO move hook
|
||||||
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotBorder(chunk, holder);
|
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotBorder(chunk, holder);
|
||||||
+ chunk.unloadCallback(); // Paper
|
+ chunk.unloadCallback(); // Paper
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ public static void onChunkPostNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
|
||||||
|
+ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
|
||||||
|
+ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, null);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ public static void onChunkTicking(final LevelChunk chunk, final ChunkHolder holder) {
|
+ public static void onChunkTicking(final LevelChunk chunk, final ChunkHolder holder) {
|
||||||
+ // TODO move hook
|
+ // TODO move hook
|
||||||
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkTicking(chunk, holder);
|
+ io.papermc.paper.chunk.system.ChunkSystem.onChunkTicking(chunk, holder);
|
||||||
@ -11034,10 +11040,10 @@ index 0000000000000000000000000000000000000000..faf76a5c2f9fa2eea38d2c7f2ab1c438
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
|
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..05381b2c58c1b60f222eed672dddede047b663c5
|
index 0000000000000000000000000000000000000000..d5fc5756ea960096ff23376a6b7ac68a2a462d22
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
|
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
|
||||||
@@ -0,0 +1,2032 @@
|
@@ -0,0 +1,2034 @@
|
||||||
+package ca.spottedleaf.moonrise.patches.chunk_system.scheduling;
|
+package ca.spottedleaf.moonrise.patches.chunk_system.scheduling;
|
||||||
+
|
+
|
||||||
+import ca.spottedleaf.concurrentutil.completable.Completable;
|
+import ca.spottedleaf.concurrentutil.completable.Completable;
|
||||||
@ -12314,6 +12320,7 @@ index 0000000000000000000000000000000000000000..05381b2c58c1b60f222eed672dddede0
|
|||||||
+ // state upgrade
|
+ // state upgrade
|
||||||
+ if (!current.isOrAfter(FullChunkStatus.FULL) && pending.isOrAfter(FullChunkStatus.FULL)) {
|
+ if (!current.isOrAfter(FullChunkStatus.FULL) && pending.isOrAfter(FullChunkStatus.FULL)) {
|
||||||
+ this.updateCurrentState(FullChunkStatus.FULL);
|
+ this.updateCurrentState(FullChunkStatus.FULL);
|
||||||
|
+ ChunkSystem.onChunkPreBorder(chunk, this.vanillaChunkHolder);
|
||||||
+ this.scheduler.chunkHolderManager.ensureInAutosave(this);
|
+ this.scheduler.chunkHolderManager.ensureInAutosave(this);
|
||||||
+ this.changeEntityChunkStatus(FullChunkStatus.FULL);
|
+ this.changeEntityChunkStatus(FullChunkStatus.FULL);
|
||||||
+ ChunkSystem.onChunkBorder(chunk, this.vanillaChunkHolder);
|
+ ChunkSystem.onChunkBorder(chunk, this.vanillaChunkHolder);
|
||||||
@ -12351,6 +12358,7 @@ index 0000000000000000000000000000000000000000..05381b2c58c1b60f222eed672dddede0
|
|||||||
+ this.onFullChunkLoadChange(false, changedFullStatus);
|
+ this.onFullChunkLoadChange(false, changedFullStatus);
|
||||||
+ this.changeEntityChunkStatus(FullChunkStatus.INACCESSIBLE);
|
+ this.changeEntityChunkStatus(FullChunkStatus.INACCESSIBLE);
|
||||||
+ ChunkSystem.onChunkNotBorder(chunk, this.vanillaChunkHolder);
|
+ ChunkSystem.onChunkNotBorder(chunk, this.vanillaChunkHolder);
|
||||||
|
+ ChunkSystem.onChunkPostNotBorder(chunk, this.vanillaChunkHolder);
|
||||||
+ this.updateCurrentState(FullChunkStatus.INACCESSIBLE);
|
+ this.updateCurrentState(FullChunkStatus.INACCESSIBLE);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
@ -21949,7 +21957,7 @@ index 0000000000000000000000000000000000000000..57692a503e147a00ac4e1586cd78e12b
|
|||||||
+ private SaveUtil() {}
|
+ private SaveUtil() {}
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
|
||||||
index 0d0cb3e63acd5156b6f9d6d78cc949b0af36a77b..dd1649abe57d7191c15a9b2862d5fd11ff0706b1 100644
|
index a79abe9b26f68d573812e91554124783075ae17a..183d99ec9b94ca20a823c46a2d6bf0a215046d48 100644
|
||||||
--- a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
|
--- a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
|
||||||
+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
|
+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
|
||||||
@@ -25,6 +25,10 @@ import java.util.List;
|
@@ -25,6 +25,10 @@ import java.util.List;
|
||||||
@ -21963,7 +21971,7 @@ index 0d0cb3e63acd5156b6f9d6d78cc949b0af36a77b..dd1649abe57d7191c15a9b2862d5fd11
|
|||||||
public final class ChunkSystem {
|
public final class ChunkSystem {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogUtils.getLogger();
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
@@ -35,31 +39,17 @@ public final class ChunkSystem {
|
@@ -35,35 +39,17 @@ public final class ChunkSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run) {
|
public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run) {
|
||||||
@ -21985,12 +21993,16 @@ index 0d0cb3e63acd5156b6f9d6d78cc949b0af36a77b..dd1649abe57d7191c15a9b2862d5fd11
|
|||||||
- }
|
- }
|
||||||
- scheduleChunkLoad(level, chunkX, chunkZ, ChunkStatus.EMPTY, addTicket, priority, (final ChunkAccess chunk) -> {
|
- scheduleChunkLoad(level, chunkX, chunkZ, ChunkStatus.EMPTY, addTicket, priority, (final ChunkAccess chunk) -> {
|
||||||
- if (chunk == null) {
|
- if (chunk == null) {
|
||||||
- onComplete.accept(null);
|
- if (onComplete != null) {
|
||||||
|
- onComplete.accept(null);
|
||||||
|
- }
|
||||||
- } else {
|
- } else {
|
||||||
- if (chunk.getPersistedStatus().isOrAfter(toStatus)) {
|
- if (chunk.getPersistedStatus().isOrAfter(toStatus)) {
|
||||||
- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
|
- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
|
||||||
- } else {
|
- } else {
|
||||||
- onComplete.accept(null);
|
- if (onComplete != null) {
|
||||||
|
- onComplete.accept(null);
|
||||||
|
- }
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
- });
|
- });
|
||||||
@ -21998,7 +22010,7 @@ index 0d0cb3e63acd5156b6f9d6d78cc949b0af36a77b..dd1649abe57d7191c15a9b2862d5fd11
|
|||||||
}
|
}
|
||||||
|
|
||||||
static final TicketType<Long> CHUNK_LOAD = TicketType.create("chunk_load", Long::compareTo);
|
static final TicketType<Long> CHUNK_LOAD = TicketType.create("chunk_load", Long::compareTo);
|
||||||
@@ -67,164 +57,29 @@ public final class ChunkSystem {
|
@@ -71,160 +57,29 @@ public final class ChunkSystem {
|
||||||
private static long chunkLoadCounter = 0L;
|
private static long chunkLoadCounter = 0L;
|
||||||
public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final ChunkStatus toStatus,
|
public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final ChunkStatus toStatus,
|
||||||
final boolean addTicket, final PrioritisedExecutor.Priority priority, final Consumer<ChunkAccess> onComplete) {
|
final boolean addTicket, final PrioritisedExecutor.Priority priority, final Consumer<ChunkAccess> onComplete) {
|
||||||
@ -22023,8 +22035,6 @@ index 0d0cb3e63acd5156b6f9d6d78cc949b0af36a77b..dd1649abe57d7191c15a9b2862d5fd11
|
|||||||
- if (onComplete != null) {
|
- if (onComplete != null) {
|
||||||
- onComplete.accept(chunk);
|
- onComplete.accept(chunk);
|
||||||
- }
|
- }
|
||||||
- } catch (final ThreadDeath death) {
|
|
||||||
- throw death;
|
|
||||||
- } catch (final Throwable thr) {
|
- } catch (final Throwable thr) {
|
||||||
- LOGGER.error("Exception handling chunk load callback", thr);
|
- LOGGER.error("Exception handling chunk load callback", thr);
|
||||||
- SneakyThrow.sneaky(thr);
|
- SneakyThrow.sneaky(thr);
|
||||||
@ -22092,8 +22102,6 @@ index 0d0cb3e63acd5156b6f9d6d78cc949b0af36a77b..dd1649abe57d7191c15a9b2862d5fd11
|
|||||||
- if (onComplete != null) {
|
- if (onComplete != null) {
|
||||||
- onComplete.accept(chunk);
|
- onComplete.accept(chunk);
|
||||||
- }
|
- }
|
||||||
- } catch (final ThreadDeath death) {
|
|
||||||
- throw death;
|
|
||||||
- } catch (final Throwable thr) {
|
- } catch (final Throwable thr) {
|
||||||
- LOGGER.error("Exception handling chunk load callback", thr);
|
- LOGGER.error("Exception handling chunk load callback", thr);
|
||||||
- SneakyThrow.sneaky(thr);
|
- SneakyThrow.sneaky(thr);
|
||||||
@ -22169,7 +22177,7 @@ index 0d0cb3e63acd5156b6f9d6d78cc949b0af36a77b..dd1649abe57d7191c15a9b2862d5fd11
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasAnyChunkHolders(final ServerLevel level) {
|
public static boolean hasAnyChunkHolders(final ServerLevel level) {
|
||||||
@@ -274,27 +129,19 @@ public final class ChunkSystem {
|
@@ -268,27 +123,19 @@ public final class ChunkSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChunkHolder getUnloadingChunkHolder(final ServerLevel level, final int chunkX, final int chunkZ) {
|
public static ChunkHolder getUnloadingChunkHolder(final ServerLevel level, final int chunkX, final int chunkZ) {
|
||||||
@ -22571,7 +22579,7 @@ index c33f85b570f159ab465b5a10a8044a81f2797f43..244a19ecd0234fa1d7a6ecfea2075159
|
|||||||
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::createFromGameruleRadius);
|
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::createFromGameruleRadius);
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 6915522f669631779c1fb8a8e2db330f4b9fb921..3aecd55b9a069710c5d383b2f9113b147ad1ab57 100644
|
index e14c0e1ccf526f81e28db5545d9e2351641e1bc8..3c230ae060998bfb79d5812fef21a80a9df8c8ff 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -198,7 +198,7 @@ import org.bukkit.event.server.ServerLoadEvent;
|
@@ -198,7 +198,7 @@ import org.bukkit.event.server.ServerLoadEvent;
|
||||||
@ -22699,7 +22707,7 @@ index 6915522f669631779c1fb8a8e2db330f4b9fb921..3aecd55b9a069710c5d383b2f9113b14
|
|||||||
if (entity.isRemoved()) {
|
if (entity.isRemoved()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2661,6 +2671,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2656,6 +2666,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23253,7 +23261,7 @@ index d9ad32acdf46a43a649334a3b736aeb7b3af21d1..fae17a075d7efaf24d916877dd5968eb
|
|||||||
public static final int RADIUS_AROUND_FULL_CHUNK = FULL_CHUNK_STEP.accumulatedDependencies().getRadius();
|
public static final int RADIUS_AROUND_FULL_CHUNK = FULL_CHUNK_STEP.accumulatedDependencies().getRadius();
|
||||||
public static final int MAX_LEVEL = 33 + RADIUS_AROUND_FULL_CHUNK;
|
public static final int MAX_LEVEL = 33 + RADIUS_AROUND_FULL_CHUNK;
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887b8fb816e 100644
|
index a03385b1b0a2f9b98319137b87d917856d3c632c..1363dda031d1b541d76241812a957a12521cbc05 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -122,10 +122,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -122,10 +122,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@ -23294,9 +23302,9 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
|
|
||||||
// CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback()
|
// CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback()
|
||||||
public final CallbackExecutor callbackExecutor = new CallbackExecutor();
|
public final CallbackExecutor callbackExecutor = new CallbackExecutor();
|
||||||
@@ -223,23 +218,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -198,23 +193,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
// Paper end
|
||||||
|
// Paper start
|
||||||
public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) {
|
public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) {
|
||||||
- return this.pendingUnloads.get(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
- return this.pendingUnloads.get(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
||||||
+ return null; // Paper - rewrite chunk system
|
+ return null; // Paper - rewrite chunk system
|
||||||
@ -23321,7 +23329,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
Path path = session.getDimensionPath(world.dimension());
|
Path path = session.getDimensionPath(world.dimension());
|
||||||
|
|
||||||
this.storageName = path.getFileName().toString();
|
this.storageName = path.getFileName().toString();
|
||||||
@@ -270,15 +263,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -245,15 +238,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
this.chunkStatusListener = chunkStatusChangeListener;
|
this.chunkStatusListener = chunkStatusChangeListener;
|
||||||
ProcessorMailbox<Runnable> threadedmailbox1 = ProcessorMailbox.create(executor, "light");
|
ProcessorMailbox<Runnable> threadedmailbox1 = ProcessorMailbox.create(executor, "light");
|
||||||
|
|
||||||
@ -23338,9 +23346,9 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
- this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, this.mainThreadMailbox);
|
- this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, this.mainThreadMailbox);
|
||||||
+ this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, null); // Paper - rewrite chunk system
|
+ this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, null); // Paper - rewrite chunk system
|
||||||
// Paper start
|
// Paper start
|
||||||
this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
|
this.nearbyPlayers = new io.papermc.paper.util.player.NearbyPlayers(this.level);
|
||||||
this.regionManagers.add(this.dataRegionManager);
|
// Paper end
|
||||||
@@ -319,23 +310,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -292,23 +283,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isChunkTracked(ServerPlayer player, int chunkX, int chunkZ) {
|
boolean isChunkTracked(ServerPlayer player, int chunkX, int chunkZ) {
|
||||||
@ -23366,7 +23374,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected ThreadedLevelLightEngine getLightEngine() {
|
protected ThreadedLevelLightEngine getLightEngine() {
|
||||||
@@ -344,20 +323,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -317,20 +296,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected ChunkHolder getUpdatingChunkIfPresent(long pos) {
|
protected ChunkHolder getUpdatingChunkIfPresent(long pos) {
|
||||||
@ -23396,7 +23404,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getChunkDebugData(ChunkPos chunkPos) {
|
public String getChunkDebugData(ChunkPos chunkPos) {
|
||||||
@@ -386,55 +367,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -359,55 +340,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
private CompletableFuture<ChunkResult<List<ChunkAccess>>> getChunkRangeFuture(ChunkHolder centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
|
private CompletableFuture<ChunkResult<List<ChunkAccess>>> getChunkRangeFuture(ChunkHolder centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
|
||||||
@ -23453,7 +23461,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ReportedException debugFuturesAndCreateReportedException(IllegalStateException exception, String details) {
|
public ReportedException debugFuturesAndCreateReportedException(IllegalStateException exception, String details) {
|
||||||
@@ -464,93 +397,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -437,93 +370,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<ChunkResult<LevelChunk>> prepareEntityTickingChunk(ChunkHolder holder) {
|
public CompletableFuture<ChunkResult<LevelChunk>> prepareEntityTickingChunk(ChunkHolder holder) {
|
||||||
@ -23553,7 +23561,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void tick(BooleanSupplier shouldKeepTicking) {
|
protected void tick(BooleanSupplier shouldKeepTicking) {
|
||||||
@@ -567,134 +430,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -540,134 +403,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasWork() {
|
public boolean hasWork() {
|
||||||
@ -23694,7 +23702,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isChunkDataValid(CompoundTag nbt) {
|
private static boolean isChunkDataValid(CompoundTag nbt) {
|
||||||
@@ -754,137 +508,44 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -727,137 +481,44 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GenerationChunkHolder acquireGeneration(long pos) {
|
public GenerationChunkHolder acquireGeneration(long pos) {
|
||||||
@ -23841,7 +23849,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getTickingGenerated() {
|
public int getTickingGenerated() {
|
||||||
@@ -892,135 +553,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -865,135 +526,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean saveChunkIfNeeded(ChunkHolder chunkHolder) {
|
private boolean saveChunkIfNeeded(ChunkHolder chunkHolder) {
|
||||||
@ -24029,7 +24037,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
@Nullable
|
@Nullable
|
||||||
public LevelChunk getChunkToSend(long pos) {
|
public LevelChunk getChunkToSend(long pos) {
|
||||||
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
|
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
|
||||||
@@ -1086,7 +696,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1059,7 +669,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -24038,7 +24046,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
return this.upgradeChunkTag(this.level.getTypeKey(), this.overworldDataStorage, nbttagcompound, this.generator().getTypeNameForDataFixer(), chunkcoordintpair, this.level);
|
return this.upgradeChunkTag(this.level.getTypeKey(), this.overworldDataStorage, nbttagcompound, this.generator().getTypeNameForDataFixer(), chunkcoordintpair, this.level);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
@@ -1180,7 +790,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1153,7 +763,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setChunkTrackingView(ChunkTrackingView.EMPTY);
|
player.setChunkTrackingView(ChunkTrackingView.EMPTY);
|
||||||
@ -24047,7 +24055,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
this.addPlayerToDistanceMaps(player); // Paper - distance maps
|
this.addPlayerToDistanceMaps(player); // Paper - distance maps
|
||||||
} else {
|
} else {
|
||||||
SectionPos sectionposition = player.getLastSectionPos();
|
SectionPos sectionposition = player.getLastSectionPos();
|
||||||
@@ -1191,7 +801,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1164,7 +774,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
this.removePlayerFromDistanceMaps(player); // Paper - distance maps
|
this.removePlayerFromDistanceMaps(player); // Paper - distance maps
|
||||||
@ -24056,7 +24064,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1239,71 +849,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1212,71 +822,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
this.playerMap.unIgnorePlayer(player);
|
this.playerMap.unIgnorePlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24139,7 +24147,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addEntity(Entity entity) {
|
public void addEntity(Entity entity) {
|
||||||
@@ -1374,13 +944,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1347,13 +917,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void tick() {
|
protected void tick() {
|
||||||
@ -24154,7 +24162,7 @@ index 2ce7da9707d7c1a48b5609ae51a516d599d7aee8..b849e0cf15f894aa87b1bb397d85b887
|
|||||||
|
|
||||||
List<ServerPlayer> list = Lists.newArrayList();
|
List<ServerPlayer> list = Lists.newArrayList();
|
||||||
List<ServerPlayer> list1 = this.level.players();
|
List<ServerPlayer> list1 = this.level.players();
|
||||||
@@ -1487,27 +1051,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1460,27 +1024,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
public void waitForLightBeforeSending(ChunkPos centerPos, int radius) {
|
public void waitForLightBeforeSending(ChunkPos centerPos, int radius) {
|
||||||
@ -24944,7 +24952,7 @@ index 3dc1daa3c6a04d3ff1a2353773b465fc380994a2..3575782f13a7f3c52e64dc5046803305
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c51f9a50d 100644
|
index be9604a0f267558c95125852d86761a2f175732a..014e7d3c3b9e8f6c2b456d63bcf885f55b01ded9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -46,7 +46,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp
|
@@ -46,7 +46,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp
|
||||||
@ -24956,12 +24964,11 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
|
|
||||||
public static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger(); // Paper
|
public static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger(); // Paper
|
||||||
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
|
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
|
||||||
@@ -75,6 +75,62 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -73,6 +73,61 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
|
private final ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<net.minecraft.world.level.chunk.LevelChunk> fullChunks = new ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<>();
|
||||||
long chunkFutureAwaitCounter;
|
long chunkFutureAwaitCounter;
|
||||||
private final LevelChunk[] lastLoadedChunks = new LevelChunk[4 * 4];
|
|
||||||
// Paper end
|
// Paper end
|
||||||
+ // Paper start - rewrite chunk system
|
+ // Paper start - rewrite chunk system
|
||||||
+ private final ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<LevelChunk> fullChunks = new ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<>();
|
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public final void moonrise$setFullChunk(final int chunkX, final int chunkZ, final LevelChunk chunk) {
|
+ public final void moonrise$setFullChunk(final int chunkX, final int chunkZ, final LevelChunk chunk) {
|
||||||
@ -25019,7 +25026,22 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
|
|
||||||
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
|
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
|
||||||
this.level = world;
|
this.level = world;
|
||||||
@@ -248,63 +304,25 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -99,13 +154,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
// Paper start
|
||||||
|
- public void addLoadedChunk(LevelChunk chunk) {
|
||||||
|
- this.fullChunks.put(chunk.coordinateKey, chunk);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- public void removeLoadedChunk(LevelChunk chunk) {
|
||||||
|
- this.fullChunks.remove(chunk.coordinateKey);
|
||||||
|
- }
|
||||||
|
+ // Paper - rewrite chunk system
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public ChunkAccess getChunkAtImmediately(int x, int z) {
|
||||||
|
@@ -176,63 +225,25 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
|
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
|
||||||
@ -25035,13 +25057,13 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
- }
|
- }
|
||||||
- // Paper end - Perf: Optimise getChunkAt calls for loaded chunks
|
- // Paper end - Perf: Optimise getChunkAt calls for loaded chunks
|
||||||
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||||
-
|
|
||||||
- gameprofilerfiller.incrementCounter("getChunk");
|
|
||||||
- long k = ChunkPos.asLong(x, z);
|
|
||||||
+ // Paper start - rewrite chunk system
|
+ // Paper start - rewrite chunk system
|
||||||
+ if (leastStatus == ChunkStatus.FULL) {
|
+ if (leastStatus == ChunkStatus.FULL) {
|
||||||
+ final LevelChunk ret = this.fullChunks.get(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(x, z));
|
+ final LevelChunk ret = this.fullChunks.get(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(x, z));
|
||||||
|
|
||||||
|
- gameprofilerfiller.incrementCounter("getChunk");
|
||||||
|
- long k = ChunkPos.asLong(x, z);
|
||||||
|
-
|
||||||
- for (int l = 0; l < 4; ++l) {
|
- for (int l = 0; l < 4; ++l) {
|
||||||
- if (k == this.lastChunkPos[l] && leastStatus == this.lastChunkStatus[l]) {
|
- if (k == this.lastChunkPos[l] && leastStatus == this.lastChunkStatus[l]) {
|
||||||
- ChunkAccess ichunkaccess = this.lastChunk[l];
|
- ChunkAccess ichunkaccess = this.lastChunk[l];
|
||||||
@ -25093,7 +25115,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void clearCache() {
|
private void clearCache() {
|
||||||
@@ -335,56 +353,59 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -263,56 +274,59 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
private CompletableFuture<ChunkResult<ChunkAccess>> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
|
private CompletableFuture<ChunkResult<ChunkAccess>> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
|
||||||
@ -25110,7 +25132,14 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
- FullChunkStatus oldChunkState = ChunkLevel.fullStatus(playerchunk.oldTicketLevel);
|
- FullChunkStatus oldChunkState = ChunkLevel.fullStatus(playerchunk.oldTicketLevel);
|
||||||
- FullChunkStatus currentChunkState = ChunkLevel.fullStatus(playerchunk.getTicketLevel());
|
- FullChunkStatus currentChunkState = ChunkLevel.fullStatus(playerchunk.getTicketLevel());
|
||||||
- currentlyUnloading = (oldChunkState.isOrAfter(FullChunkStatus.FULL) && !currentChunkState.isOrAfter(FullChunkStatus.FULL));
|
- currentlyUnloading = (oldChunkState.isOrAfter(FullChunkStatus.FULL) && !currentChunkState.isOrAfter(FullChunkStatus.FULL));
|
||||||
- }
|
+ final int minLevel = ChunkLevel.byStatus(leastStatus);
|
||||||
|
+ final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder chunkHolder = ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(chunkX, chunkZ);
|
||||||
|
+
|
||||||
|
+ final boolean needsFullScheduling = leastStatus == ChunkStatus.FULL && (chunkHolder == null || !chunkHolder.getChunkStatus().isOrAfter(FullChunkStatus.FULL));
|
||||||
|
+
|
||||||
|
+ if ((chunkHolder == null || chunkHolder.getTicketLevel() > minLevel || needsFullScheduling) && !create) {
|
||||||
|
+ return ChunkHolder.UNLOADED_CHUNK_FUTURE;
|
||||||
|
}
|
||||||
- if (create && !currentlyUnloading) {
|
- if (create && !currentlyUnloading) {
|
||||||
- // CraftBukkit end
|
- // CraftBukkit end
|
||||||
- this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
|
- this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
|
||||||
@ -25123,19 +25152,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
- gameprofilerfiller.pop();
|
- gameprofilerfiller.pop();
|
||||||
- if (this.chunkAbsent(playerchunk, l)) {
|
- if (this.chunkAbsent(playerchunk, l)) {
|
||||||
- throw (IllegalStateException) Util.pauseInIde(new IllegalStateException("No chunk holder after ticket has been added"));
|
- throw (IllegalStateException) Util.pauseInIde(new IllegalStateException("No chunk holder after ticket has been added"));
|
||||||
- }
|
|
||||||
- }
|
|
||||||
+ final int minLevel = ChunkLevel.byStatus(leastStatus);
|
|
||||||
+ final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder chunkHolder = ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(chunkX, chunkZ);
|
|
||||||
+
|
+
|
||||||
+ final boolean needsFullScheduling = leastStatus == ChunkStatus.FULL && (chunkHolder == null || !chunkHolder.getChunkStatus().isOrAfter(FullChunkStatus.FULL));
|
|
||||||
+
|
|
||||||
+ if ((chunkHolder == null || chunkHolder.getTicketLevel() > minLevel || needsFullScheduling) && !create) {
|
|
||||||
+ return ChunkHolder.UNLOADED_CHUNK_FUTURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
- return this.chunkAbsent(playerchunk, l) ? GenerationChunkHolder.UNLOADED_CHUNK_FUTURE : playerchunk.scheduleChunkGenerationTask(leastStatus, this.chunkMap);
|
|
||||||
- }
|
|
||||||
+ final ChunkAccess ifPresent = chunkHolder == null ? null : chunkHolder.getChunkIfPresent(leastStatus);
|
+ final ChunkAccess ifPresent = chunkHolder == null ? null : chunkHolder.getChunkIfPresent(leastStatus);
|
||||||
+ if (needsFullScheduling || ifPresent == null) {
|
+ if (needsFullScheduling || ifPresent == null) {
|
||||||
+ // schedule
|
+ // schedule
|
||||||
@ -25145,17 +25162,21 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
+ ret.complete(ChunkHolder.UNLOADED_CHUNK);
|
+ ret.complete(ChunkHolder.UNLOADED_CHUNK);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ ret.complete(ChunkResult.of(chunk));
|
+ ret.complete(ChunkResult.of(chunk));
|
||||||
+ }
|
}
|
||||||
|
- }
|
||||||
|
- }
|
||||||
+ };
|
+ };
|
||||||
|
|
||||||
- private boolean chunkAbsent(@Nullable ChunkHolder holder, int maxLevel) {
|
- return this.chunkAbsent(playerchunk, l) ? GenerationChunkHolder.UNLOADED_CHUNK_FUTURE : playerchunk.scheduleChunkGenerationTask(leastStatus, this.chunkMap);
|
||||||
- return holder == null || holder.oldTicketLevel > maxLevel; // CraftBukkit using oldTicketLevel for isLoaded checks
|
- }
|
||||||
+ ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().scheduleChunkLoad(
|
+ ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().scheduleChunkLoad(
|
||||||
+ chunkX, chunkZ, leastStatus, true,
|
+ chunkX, chunkZ, leastStatus, true,
|
||||||
+ ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGHER,
|
+ ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGHER,
|
||||||
+ complete
|
+ complete
|
||||||
+ );
|
+ );
|
||||||
+
|
|
||||||
|
- private boolean chunkAbsent(@Nullable ChunkHolder holder, int maxLevel) {
|
||||||
|
- return holder == null || holder.oldTicketLevel > maxLevel; // CraftBukkit using oldTicketLevel for isLoaded checks
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ // can return now
|
+ // can return now
|
||||||
@ -25190,7 +25211,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -397,16 +418,7 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -325,16 +339,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean runDistanceManagerUpdates() { // Paper - public
|
public boolean runDistanceManagerUpdates() { // Paper - public
|
||||||
@ -25208,7 +25229,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
@@ -416,13 +428,14 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -344,13 +349,14 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
public boolean isPositionTicking(long pos) {
|
public boolean isPositionTicking(long pos) {
|
||||||
@ -25227,7 +25248,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
||||||
this.chunkMap.saveAllChunks(flush);
|
this.chunkMap.saveAllChunks(flush);
|
||||||
} // Paper - Timings
|
} // Paper - Timings
|
||||||
@@ -435,12 +448,7 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -363,12 +369,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close(boolean save) throws IOException {
|
public void close(boolean save) throws IOException {
|
||||||
@ -25241,7 +25262,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - modelled on below
|
// CraftBukkit start - modelled on below
|
||||||
@@ -468,6 +476,7 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -396,6 +397,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
this.level.getProfiler().popPush("chunks");
|
this.level.getProfiler().popPush("chunks");
|
||||||
if (tickChunks) {
|
if (tickChunks) {
|
||||||
this.level.timings.chunks.startTiming(); // Paper - timings
|
this.level.timings.chunks.startTiming(); // Paper - timings
|
||||||
@ -25249,7 +25270,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
this.tickChunks();
|
this.tickChunks();
|
||||||
this.level.timings.chunks.stopTiming(); // Paper - timings
|
this.level.timings.chunks.stopTiming(); // Paper - timings
|
||||||
this.chunkMap.tick();
|
this.chunkMap.tick();
|
||||||
@@ -567,11 +576,12 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -495,11 +497,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getFullChunk(long pos, Consumer<LevelChunk> chunkConsumer) {
|
private void getFullChunk(long pos, Consumer<LevelChunk> chunkConsumer) {
|
||||||
@ -25266,7 +25287,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -665,6 +675,12 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -593,6 +596,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
this.chunkMap.setServerViewDistance(watchDistance);
|
this.chunkMap.setServerViewDistance(watchDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25279,7 +25300,7 @@ index a94833f58eb823332890d07c147161e9e0a938e9..cba80945fa0d8ca55b0d422925f8c94c
|
|||||||
public void setSimulationDistance(int simulationDistance) {
|
public void setSimulationDistance(int simulationDistance) {
|
||||||
this.distanceManager.updateSimulationDistance(simulationDistance);
|
this.distanceManager.updateSimulationDistance(simulationDistance);
|
||||||
}
|
}
|
||||||
@@ -743,16 +759,14 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -671,16 +680,14 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@Override
|
@Override
|
||||||
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
|
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
|
||||||
public boolean pollTask() {
|
public boolean pollTask() {
|
||||||
@ -26763,7 +26784,7 @@ index bd20bea7f76a7307f1698fb2dfef37125032d166..70c2017400168d4fef3c14462798edcf
|
|||||||
if (shape.isEmpty()) {
|
if (shape.isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 6f822e9487bef5b9766d5ae86ebbd687e4eadc42..77c6613c39e3b266944e28cf2627483d9f32c511 100644
|
index e27d3547d1e19c137e05e6b8d075127a8bafb237..557273061fa03ebaa4b9de01ad12ed4ac859c292 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -102,7 +102,7 @@ import org.bukkit.entity.SpawnCategory;
|
@@ -102,7 +102,7 @@ import org.bukkit.entity.SpawnCategory;
|
||||||
@ -26842,7 +26863,7 @@ index 6f822e9487bef5b9766d5ae86ebbd687e4eadc42..77c6613c39e3b266944e28cf2627483d
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - Cancel hit for vanished players
|
// Paper start - Cancel hit for vanished players
|
||||||
@@ -551,7 +604,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -549,7 +602,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
this.setBlocksDirty(blockposition, iblockdata1, iblockdata2);
|
this.setBlocksDirty(blockposition, iblockdata1, iblockdata2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26851,7 +26872,7 @@ index 6f822e9487bef5b9766d5ae86ebbd687e4eadc42..77c6613c39e3b266944e28cf2627483d
|
|||||||
this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i);
|
this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -951,7 +1004,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -949,7 +1002,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
}
|
}
|
||||||
// Paper end - Perf: Optimize capturedTileEntities lookup
|
// Paper end - Perf: Optimize capturedTileEntities lookup
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@ -26860,7 +26881,7 @@ index 6f822e9487bef5b9766d5ae86ebbd687e4eadc42..77c6613c39e3b266944e28cf2627483d
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBlockEntity(BlockEntity blockEntity) {
|
public void setBlockEntity(BlockEntity blockEntity) {
|
||||||
@@ -1041,28 +1094,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1039,28 +1092,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@Override
|
@Override
|
||||||
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
||||||
this.getProfiler().incrementCounter("getEntities");
|
this.getProfiler().incrementCounter("getEntities");
|
||||||
@ -26894,7 +26915,7 @@ index 6f822e9487bef5b9766d5ae86ebbd687e4eadc42..77c6613c39e3b266944e28cf2627483d
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1077,36 +1115,77 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1075,36 +1113,77 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
this.getEntities(filter, box, predicate, result, Integer.MAX_VALUE);
|
this.getEntities(filter, box, predicate, result, Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27315,7 +27336,7 @@ index 365074be989aa4a178114fd5e9810f1a68640196..4af698930712389881601069a921f054
|
|||||||
@Override
|
@Override
|
||||||
public BlockEntity getBlockEntity(BlockPos pos) {
|
public BlockEntity getBlockEntity(BlockPos pos) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4caa357bd 100644
|
index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..443e5e1b1c0e7c93f61c1905c78c29a17860989c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -53,7 +53,7 @@ import net.minecraft.world.ticks.LevelChunkTicks;
|
@@ -53,7 +53,7 @@ import net.minecraft.world.ticks.LevelChunkTicks;
|
||||||
@ -27327,9 +27348,9 @@ index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4
|
|||||||
|
|
||||||
static final Logger LOGGER = LogUtils.getLogger();
|
static final Logger LOGGER = LogUtils.getLogger();
|
||||||
private static final TickingBlockEntity NULL_TICKER = new TickingBlockEntity() {
|
private static final TickingBlockEntity NULL_TICKER = new TickingBlockEntity() {
|
||||||
@@ -218,6 +218,14 @@ public class LevelChunk extends ChunkAccess {
|
@@ -119,6 +119,14 @@ public class LevelChunk extends ChunkAccess {
|
||||||
}
|
// Paper start
|
||||||
}
|
boolean loadedTicketLevel;
|
||||||
// Paper end
|
// Paper end
|
||||||
+ // Paper start - rewrite chunk system
|
+ // Paper start - rewrite chunk system
|
||||||
+ private boolean postProcessingDone;
|
+ private boolean postProcessingDone;
|
||||||
@ -27342,7 +27363,7 @@ index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4
|
|||||||
|
|
||||||
public LevelChunk(ServerLevel world, ProtoChunk protoChunk, @Nullable LevelChunk.PostLoadProcessor entityLoader) {
|
public LevelChunk(ServerLevel world, ProtoChunk protoChunk, @Nullable LevelChunk.PostLoadProcessor entityLoader) {
|
||||||
this(world, protoChunk.getPos(), protoChunk.getUpgradeData(), protoChunk.unpackBlockTicks(), protoChunk.unpackFluidTicks(), protoChunk.getInhabitedTime(), protoChunk.getSections(), entityLoader, protoChunk.getBlendingData());
|
this(world, protoChunk.getPos(), protoChunk.getUpgradeData(), protoChunk.unpackBlockTicks(), protoChunk.unpackFluidTicks(), protoChunk.getInhabitedTime(), protoChunk.getSections(), entityLoader, protoChunk.getBlendingData());
|
||||||
@@ -247,13 +255,19 @@ public class LevelChunk extends ChunkAccess {
|
@@ -148,13 +156,19 @@ public class LevelChunk extends ChunkAccess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27363,7 +27384,7 @@ index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -436,7 +450,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -337,7 +351,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||||
|
|
||||||
gameprofilerfiller.push("updateSkyLightSources");
|
gameprofilerfiller.push("updateSkyLightSources");
|
||||||
@ -27372,15 +27393,21 @@ index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4
|
|||||||
gameprofilerfiller.popPush("queueCheckLight");
|
gameprofilerfiller.popPush("queueCheckLight");
|
||||||
this.level.getChunkSource().getLightEngine().checkBlock(blockposition);
|
this.level.getChunkSource().getLightEngine().checkBlock(blockposition);
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
@@ -696,6 +710,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -597,11 +611,12 @@ public class LevelChunk extends ChunkAccess {
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public void loadCallback() {
|
public void loadCallback() {
|
||||||
+ if (this.loadedTicketLevel) { LOGGER.error("Double calling chunk load!", new Throwable()); } // Paper
|
+ if (this.loadedTicketLevel) { LOGGER.error("Double calling chunk load!", new Throwable()); } // Paper
|
||||||
// Paper start - neighbour cache
|
// Paper start
|
||||||
int chunkX = this.chunkPos.x;
|
this.loadedTicketLevel = true;
|
||||||
int chunkZ = this.chunkPos.z;
|
// Paper end
|
||||||
@@ -723,6 +738,7 @@ public class LevelChunk extends ChunkAccess {
|
org.bukkit.Server server = this.level.getCraftServer();
|
||||||
|
- this.level.getChunkSource().addLoadedChunk(this); // Paper
|
||||||
|
+ // Paper - rewrite chunk system
|
||||||
|
if (server != null) {
|
||||||
|
/*
|
||||||
|
* If it's a new world, the first few chunks are generated inside
|
||||||
|
@@ -610,6 +625,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
*/
|
*/
|
||||||
org.bukkit.Chunk bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
|
org.bukkit.Chunk bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
|
||||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration));
|
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration));
|
||||||
@ -27388,7 +27415,7 @@ index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4
|
|||||||
|
|
||||||
if (this.needsDecoration) {
|
if (this.needsDecoration) {
|
||||||
try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
|
try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
|
||||||
@@ -751,9 +767,11 @@ public class LevelChunk extends ChunkAccess {
|
@@ -638,13 +654,15 @@ public class LevelChunk extends ChunkAccess {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unloadCallback() {
|
public void unloadCallback() {
|
||||||
@ -27401,7 +27428,12 @@ index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4
|
|||||||
server.getPluginManager().callEvent(unloadEvent);
|
server.getPluginManager().callEvent(unloadEvent);
|
||||||
// note: saving can be prevented, but not forced if no saving is actually required
|
// note: saving can be prevented, but not forced if no saving is actually required
|
||||||
this.mustNotSave = !unloadEvent.isSaveChunk();
|
this.mustNotSave = !unloadEvent.isSaveChunk();
|
||||||
@@ -777,8 +795,27 @@ public class LevelChunk extends ChunkAccess {
|
- this.level.getChunkSource().removeLoadedChunk(this); // Paper
|
||||||
|
+ // Paper - rewrite chunk system
|
||||||
|
// Paper start
|
||||||
|
this.loadedTicketLevel = false;
|
||||||
|
// Paper end
|
||||||
|
@@ -652,8 +670,27 @@ public class LevelChunk extends ChunkAccess {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUnsaved() {
|
public boolean isUnsaved() {
|
||||||
@ -27430,7 +27462,7 @@ index 6c0e12c9c9c0fb8377cd1f48a43ca75c9fc3e58e..c4f87ff9e0c9806a1d7abc4842caa5a4
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
@@ -884,6 +921,7 @@ public class LevelChunk extends ChunkAccess {
|
@@ -759,6 +796,7 @@ public class LevelChunk extends ChunkAccess {
|
||||||
|
|
||||||
this.pendingBlockEntities.clear();
|
this.pendingBlockEntities.clear();
|
||||||
this.upgradeData.upgrade(this);
|
this.upgradeData.upgrade(this);
|
||||||
@ -29064,29 +29096,12 @@ index 5717c0e1d6df07a4613356dc78d970d2101c68d7..cab7ca4218e5903b6a5e518af55457b9
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
index cd7f1309cf01a5f01a28aded03a36fe15adb1756..43cb7b91945a72ab4bd998a3a3eca3cdcf0432a9 100644
|
index fceed3d08ee6f4c171685986bb19d2be592eedc6..bf18f9ad7dec2b09ebfcb5ec6566f2556e842f22 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||||
@@ -815,19 +815,26 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
|
@@ -829,5 +829,12 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public BlockState getBlockStateIfLoaded(final BlockPos blockposition) {
|
|
||||||
- return null;
|
|
||||||
+ return this.handle.getBlockStateIfLoaded(blockposition); // Paper - rewrite chunk system
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public FluidState getFluidIfLoaded(final BlockPos blockposition) {
|
|
||||||
- return null;
|
|
||||||
+ return this.handle.getFluidIfLoaded(blockposition); // Paper - rewrite chunk system
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public ChunkAccess getChunkIfLoadedImmediately(final int x, final int z) {
|
public ChunkAccess getChunkIfLoadedImmediately(final int x, final int z) {
|
||||||
- return null;
|
return this.handle.getChunkIfLoadedImmediately(x, z);
|
||||||
+ return this.handle.getChunkIfLoadedImmediately(x, z); // Paper - rewrite chunk system
|
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // Paper start - rewrite chunk system
|
+ // Paper start - rewrite chunk system
|
||||||
|
@ -29,7 +29,7 @@ index 02367ef1371dde94ff6c4cd40bd32e800d6ccaaf..7b0fc7135bc107103dcaed6dc0707b18
|
|||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 77c6613c39e3b266944e28cf2627483d9f32c511..b3a433786fabf6f2cfba2cdc8d21f6447191a310 100644
|
index 557273061fa03ebaa4b9de01ad12ed4ac859c292..316a72f5019d4ad65237b41ccb4ef3be729246ad 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -394,7 +394,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -394,7 +394,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
@ -62,7 +62,7 @@ index bb8e962e63c7a2d931f9bd7f7c002aa35cfa5fd3..0fa131a6c98adb498fc8d534e0e39647
|
|||||||
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
|
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
|
||||||
// Paper start - Add predicate for blocks when raytracing
|
// Paper start - Add predicate for blocks when raytracing
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index b3a433786fabf6f2cfba2cdc8d21f6447191a310..2d318964ef1f54940059b8d62bfc8f8ae87424e5 100644
|
index 316a72f5019d4ad65237b41ccb4ef3be729246ad..5ea8f51accdda2387b640d2cff1d6a8baa673bee 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -386,10 +386,87 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -386,10 +386,87 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
@ -340,7 +340,7 @@ index 0b7f52021441d633c37543e8ae485e81c292b747..d7f8464bf3eed0e42a5fc7f14a5b243d
|
|||||||
+
|
+
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 2d318964ef1f54940059b8d62bfc8f8ae87424e5..23af11c22713ac3e005fd89b4f3b3873bf74e751 100644
|
index 5ea8f51accdda2387b640d2cff1d6a8baa673bee..3fa8ae3a9afd81bf757ee1e183684442444376f4 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -156,6 +156,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -156,6 +156,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Optional per player mob spawns
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index b849e0cf15f894aa87b1bb397d85b887b8fb816e..7bebf252887ecc7594b1ce21471fb6ba7aa2c051 100644
|
index 1363dda031d1b541d76241812a957a12521cbc05..b24d5b0818abfc8b969ab715ca21959c235a9d70 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -283,8 +283,26 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -256,8 +256,26 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
return this.nearbyPlayers;
|
return this.nearbyPlayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,10 +37,10 @@ index b849e0cf15f894aa87b1bb397d85b887b8fb816e..7bebf252887ecc7594b1ce21471fb6ba
|
|||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index cba80945fa0d8ca55b0d422925f8c94c51f9a50d..a5d465a81ba6ba7dea352005bf02ae2ae424ed14 100644
|
index 014e7d3c3b9e8f6c2b456d63bcf885f55b01ded9..7bb3277883a326c436ef070eaf285343fe502a32 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -517,7 +517,19 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
@@ -438,7 +438,19 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||||
gameprofilerfiller.popPush("naturalSpawnCount");
|
gameprofilerfiller.popPush("naturalSpawnCount");
|
||||||
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
|
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
|
||||||
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
||||||
|
@ -1168,7 +1168,7 @@ index 9b1a6d8351fb473eec75a2fd08fb892b770e3586..0d0b07c9199be9ca0d5ac3feb1d44f14
|
|||||||
}
|
}
|
||||||
// Paper end - Send empty chunk
|
// Paper end - Send empty chunk
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 23af11c22713ac3e005fd89b4f3b3873bf74e751..9f2fad2f4b1e4e7eda645d53eb76ed04fc0b3451 100644
|
index 3fa8ae3a9afd81bf757ee1e183684442444376f4..392032d749b8a9077b61f4e1c5e413de048c7067 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -171,6 +171,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -171,6 +171,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
@ -1196,7 +1196,7 @@ index 23af11c22713ac3e005fd89b4f3b3873bf74e751..9f2fad2f4b1e4e7eda645d53eb76ed04
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start - Cancel hit for vanished players
|
// Paper start - Cancel hit for vanished players
|
||||||
@@ -619,6 +621,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -617,6 +619,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
BlockState iblockdata1 = chunk.setBlockState(pos, state, (flags & 64) != 0, (flags & 1024) == 0); // CraftBukkit custom NO_PLACE flag
|
BlockState iblockdata1 = chunk.setBlockState(pos, state, (flags & 64) != 0, (flags & 1024) == 0); // CraftBukkit custom NO_PLACE flag
|
||||||
@ -1231,7 +1231,7 @@ index 2822a9b010e6d45f9562950a94f1942784db9784..97f8ef86a0e398b7e4aa3445d5e413ad
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index c4f87ff9e0c9806a1d7abc4842caa5a4caa357bd..e5f301f867057ac986725a76c13f260ff40489c4 100644
|
index 443e5e1b1c0e7c93f61c1905c78c29a17860989c..b2a06fc1192cd6050d6d7ea8620a4fa5a12182cc 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -91,7 +91,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
@@ -91,7 +91,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
|
@ -2035,10 +2035,10 @@ index a463cdd3b9dbda64d52c86223e1f2e1164deac80..798016774df02c3f7ebf909c9cc125f8
|
|||||||
|
|
||||||
EntityCallbacks() {}
|
EntityCallbacks() {}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 9f2fad2f4b1e4e7eda645d53eb76ed04fc0b3451..96ad3868a93964247790134fa5f4b18e5c07aea8 100644
|
index 392032d749b8a9077b61f4e1c5e413de048c7067..55e841269585feb6a083b48ffeecea30cc65f6d6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -1570,4 +1570,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -1568,4 +1568,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end - notify observers even if grow failed
|
// Paper end - notify observers even if grow failed
|
||||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Improve cancelling PreCreatureSpawnEvent with per player mob
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 7bebf252887ecc7594b1ce21471fb6ba7aa2c051..df00ea382915480be1279a5347872cf7a1417341 100644
|
index b24d5b0818abfc8b969ab715ca21959c235a9d70..c96740a82eac9101f74edeb44edf4b64d1d633e0 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -300,8 +300,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -273,8 +273,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
++((ServerPlayer)backingSet[i]).mobCounts[index];
|
++((ServerPlayer)backingSet[i]).mobCounts[index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,10 +37,10 @@ index 7bebf252887ecc7594b1ce21471fb6ba7aa2c051..df00ea382915480be1279a5347872cf7
|
|||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index a5d465a81ba6ba7dea352005bf02ae2ae424ed14..681fdab250d924a29ca160acffbcbf7f8a3ca78a 100644
|
index 7bb3277883a326c436ef070eaf285343fe502a32..82e7f7c3c2f51bc135585f43bc5167bcde2f8a98 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -523,7 +523,17 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
@@ -444,7 +444,17 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||||
if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled
|
if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled
|
||||||
// re-set mob counts
|
// re-set mob counts
|
||||||
for (ServerPlayer player : this.level.players) {
|
for (ServerPlayer player : this.level.players) {
|
||||||
|
@ -50,7 +50,7 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 3aecd55b9a069710c5d383b2f9113b147ad1ab57..2a65c39feeb03a165ccc4afd974fb6935b2ff546 100644
|
index 3c230ae060998bfb79d5812fef21a80a9df8c8ff..64d0e04b6f9c52d90d0bc185b16a8a4768af4ac1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1659,6 +1659,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1659,6 +1659,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
@ -71,7 +71,7 @@ index 589a8bf75be6ccc59f1e5dd5d8d9afed41c4772d..b24265573fdef5d9a964bcd76146f345
|
|||||||
cause = cause.getCause();
|
cause = cause.getCause();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 2a65c39feeb03a165ccc4afd974fb6935b2ff546..b9b8a46f1de9867cc2161ac71c2993ab422cdfbf 100644
|
index 64d0e04b6f9c52d90d0bc185b16a8a4768af4ac1..68f60e77e0bfd42b6419491c1d59b6432974216b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -307,7 +307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -307,7 +307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
@ -212,7 +212,7 @@ index 2a65c39feeb03a165ccc4afd974fb6935b2ff546..b9b8a46f1de9867cc2161ac71c2993ab
|
|||||||
return new TickTask(this.tickCount, runnable);
|
return new TickTask(this.tickCount, runnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2209,7 +2261,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -2204,7 +2256,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.worldData.setDataConfiguration(worlddataconfiguration);
|
this.worldData.setDataConfiguration(worlddataconfiguration);
|
||||||
this.resources.managers.updateRegistryTags();
|
this.resources.managers.updateRegistryTags();
|
||||||
this.potionBrewing = this.potionBrewing.reload(this.worldData.enabledFeatures()); // Paper - Custom Potion Mixes
|
this.potionBrewing = this.potionBrewing.reload(this.worldData.enabledFeatures()); // Paper - Custom Potion Mixes
|
||||||
@ -287,10 +287,10 @@ index 2510589400b3012b827efcab477c6483d9d55901..43487a9ee202c5b0e5a416519939111f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 96ad3868a93964247790134fa5f4b18e5c07aea8..f1e085c712e4f128c813c3cf5340e6d2e4e55ccc 100644
|
index 55e841269585feb6a083b48ffeecea30cc65f6d6..fee155c81df385faa474e3aec777a30375ecb07d 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -984,6 +984,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
@@ -982,6 +982,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||||
try {
|
try {
|
||||||
tickConsumer.accept(entity);
|
tickConsumer.accept(entity);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@ -299,10 +299,10 @@ index 96ad3868a93964247790134fa5f4b18e5c07aea8..f1e085c712e4f128c813c3cf5340e6d2
|
|||||||
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||||
MinecraftServer.LOGGER.error(msg, throwable);
|
MinecraftServer.LOGGER.error(msg, throwable);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index e5f301f867057ac986725a76c13f260ff40489c4..589c1f13006660c28378f447ee373651257169d9 100644
|
index b2a06fc1192cd6050d6d7ea8620a4fa5a12182cc..d388fbcbff63928f0e9140c02400a63ba8f19d9c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -1131,6 +1131,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
@@ -1006,6 +1006,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
|
|
||||||
gameprofilerfiller.pop();
|
gameprofilerfiller.pop();
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren