|
|
|
|
@@ -4,38 +4,13 @@ Date: Fri, 1 Jul 2022 04:03:37 -0500
|
|
|
|
|
Subject: [PATCH] Remove Timings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
|
|
|
|
index 6bc7c6f16a1649fc9e24e7cf90fca401e5bd4875..e1ffd62f4ebceecb9bc5471df3da406cffea0483 100644
|
|
|
|
|
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
|
|
|
|
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
|
|
|
|
@@ -1316,9 +1316,9 @@ public final class ChunkHolderManager {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean processTicketUpdates() {
|
|
|
|
|
- co.aikar.timings.MinecraftTimings.distanceManagerTick.startTiming(); try { // Paper - add timings for distance manager
|
|
|
|
|
+ //co.aikar.timings.MinecraftTimings.distanceManagerTick.startTiming(); try { // Paper - add timings for distance manager // Purpur
|
|
|
|
|
return this.processTicketUpdates(true, true, null);
|
|
|
|
|
- } finally { co.aikar.timings.MinecraftTimings.distanceManagerTick.stopTiming(); } // Paper - add timings for distance manager
|
|
|
|
|
+ //} finally { co.aikar.timings.MinecraftTimings.distanceManagerTick.stopTiming(); } // Paper - add timings for distance manager // Purpur
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final ThreadLocal<List<ChunkProgressionTask>> CURRENT_TICKET_UPDATE_SCHEDULING = new ThreadLocal<>();
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java
|
|
|
|
|
index 56b07a3306e5735816c8d89601b519cb0db6379a..604de7aed6db44c9c84d541765e57da48883cf00 100644
|
|
|
|
|
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java
|
|
|
|
|
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java
|
|
|
|
|
@@ -1779,7 +1779,7 @@ public final class NewChunkHolder {
|
|
|
|
|
boolean canSavePOI = !(chunk instanceof LevelChunk levelChunk && levelChunk.mustNotSave) && (poi != null && poi.isDirty());
|
|
|
|
|
boolean canSaveEntities = entities != null;
|
|
|
|
|
|
|
|
|
|
- try (co.aikar.timings.Timing ignored = this.world.timings.chunkSave.startTiming()) { // Paper
|
|
|
|
|
+ //try (co.aikar.timings.Timing ignored = this.world.timings.chunkSave.startTiming()) { // Paper // Purpur
|
|
|
|
|
if (canSaveChunk) {
|
|
|
|
|
canSaveChunk = this.saveChunk(chunk, unloading);
|
|
|
|
|
}
|
|
|
|
|
@@ -1793,7 +1793,7 @@ public final class NewChunkHolder {
|
|
|
|
|
this.lastEntityUnload = null;
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
index 545624cfeefacc7bff3bb24adc9b6d52672db701..57ab4dcd53bf4df7d0c70951d9c2ab139b77fc31 100644
|
|
|
|
|
--- 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
|
|
|
|
|
@@ -1694,7 +1694,7 @@ public final class NewChunkHolder {
|
|
|
|
|
if (shutdown) {
|
|
|
|
|
this.lastEntityUnload = null;
|
|
|
|
|
}
|
|
|
|
|
- }
|
|
|
|
|
+ //} // Purpur
|
|
|
|
|
@@ -67,10 +42,10 @@ index 0c3c82b28e581286b798ee58ca4193efc2faff4a..24121a43aeb5e9bce013f30c92dddd15
|
|
|
|
|
// return true as command was handled
|
|
|
|
|
return 1;
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
|
|
|
index 57e76b53e5e314c3e6b8856010f7a84188121582..8c134a642ccaf3530022f2e675a858d726e1dda4 100644
|
|
|
|
|
index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..0c8fe5b2500480c3a9e9ab3285ad22e0e599d953 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
|
|
|
@@ -51,7 +51,7 @@ public class PacketUtils {
|
|
|
|
|
@@ -32,7 +32,7 @@ public class PacketUtils {
|
|
|
|
|
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
|
|
|
|
|
if (listener.shouldHandleMessage(packet)) {
|
|
|
|
|
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
|
|
|
|
|
@@ -80,28 +55,10 @@ index 57e76b53e5e314c3e6b8856010f7a84188121582..8c134a642ccaf3530022f2e675a858d7
|
|
|
|
|
} catch (Exception exception) {
|
|
|
|
|
if (exception instanceof ReportedException) {
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec1f334fb9 100644
|
|
|
|
|
index 59938afbf2d3add16b6a7f0acdba81806054bbbb..f0a85af9681e30937b60d1325d2b719ae2b442b4 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
@@ -1477,7 +1477,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- co.aikar.timings.MinecraftTimings.midTickChunkTasks.startTiming();
|
|
|
|
|
+ // co.aikar.timings.MinecraftTimings.midTickChunkTasks.startTiming(); // Purpur
|
|
|
|
|
try {
|
|
|
|
|
for (;;) {
|
|
|
|
|
boolean moreTasks = this.tickMidTickTasks();
|
|
|
|
|
@@ -1504,7 +1504,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
- co.aikar.timings.MinecraftTimings.midTickChunkTasks.stopTiming();
|
|
|
|
|
+ // co.aikar.timings.MinecraftTimings.midTickChunkTasks.stopTiming(); // Purpur
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end - execute chunk tasks mid tick
|
|
|
|
|
@@ -1579,15 +1579,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1494,15 +1494,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
|
|
|
|
@@ -120,8 +77,8 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
// Paper end
|
|
|
|
|
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
|
|
|
|
|
|
|
|
|
@@ -1624,9 +1624,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper end - Incremental chunk and player saving
|
|
|
|
|
@@ -1527,9 +1527,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
io.papermc.paper.util.CachedLists.reset(); // Paper
|
|
|
|
|
// Paper start - move executeAll() into full server tick timing
|
|
|
|
|
- try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
|
|
|
|
|
@@ -132,7 +89,7 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
// Paper end
|
|
|
|
|
// Paper start - Server Tick Events
|
|
|
|
|
long endTime = System.nanoTime();
|
|
|
|
|
@@ -1649,7 +1649,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1552,7 +1552,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.logTickMethodTime(i);
|
|
|
|
|
this.profiler.pop();
|
|
|
|
|
org.spigotmc.WatchdogThread.tick(); // Spigot
|
|
|
|
|
@@ -141,7 +98,7 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void logTickMethodTime(long tickStartTime) {
|
|
|
|
|
@@ -1720,9 +1720,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1623,9 +1623,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
|
|
|
|
entityplayer.connection.suspendFlushing();
|
|
|
|
|
});
|
|
|
|
|
@@ -153,7 +110,7 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
// Paper start - Folia scheduler API
|
|
|
|
|
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
|
|
|
|
getAllLevels().forEach(level -> {
|
|
|
|
|
@@ -1739,21 +1739,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1642,21 +1642,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper end - Folia scheduler API
|
|
|
|
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
|
|
|
|
this.profiler.push("commandFunctions");
|
|
|
|
|
@@ -180,7 +137,7 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
// Send time updates to everyone, it will get the right time from the world the player is in.
|
|
|
|
|
// Paper start - Perf: Optimize time updates
|
|
|
|
|
for (final ServerLevel level : this.getAllLevels()) {
|
|
|
|
|
@@ -1773,7 +1773,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1676,7 +1676,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end - Perf: Optimize time updates
|
|
|
|
|
@@ -189,7 +146,7 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
|
|
|
|
|
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
|
|
|
|
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
|
|
|
|
@@ -1801,14 +1801,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1703,14 +1703,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.profiler.push("tick");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
@@ -206,7 +163,7 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
} catch (Throwable throwable) {
|
|
|
|
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
|
|
|
|
|
|
|
|
|
@@ -1823,24 +1823,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1725,24 +1725,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
|
|
|
|
|
|
|
|
|
this.profiler.popPush("connection");
|
|
|
|
|
@@ -238,10 +195,10 @@ index f9d975002b7ed5dc6b31562d05f8be4c96b2d515..bf9e17659305680dc0262a0bc82246ec
|
|
|
|
|
this.profiler.popPush("send chunks");
|
|
|
|
|
iterator = this.playerList.getPlayers().iterator();
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
|
index 9ec4be84bd3aceacdc0c02cd928f60886c2824ee..8fb5b1769d0dc25f93945105bc56bf849d85265b 100644
|
|
|
|
|
index 7a579cdb6bb9dced485f86d1bfe8ab432db51ab1..d9b299cde538db9bc07a267274551cc9893615db 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
|
@@ -540,7 +540,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
@@ -516,7 +516,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void handleConsoleInputs() {
|
|
|
|
|
@@ -250,7 +207,7 @@ index 9ec4be84bd3aceacdc0c02cd928f60886c2824ee..8fb5b1769d0dc25f93945105bc56bf84
|
|
|
|
|
// Paper start - Perf: use proper queue
|
|
|
|
|
ConsoleInput servercommand;
|
|
|
|
|
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
|
|
|
|
@@ -557,7 +557,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
@@ -533,7 +533,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -260,59 +217,10 @@ index 9ec4be84bd3aceacdc0c02cd928f60886c2824ee..8fb5b1769d0dc25f93945105bc56bf84
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
|
|
|
index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..2b8448ccb0e4750b722933b0b5de02d8f4f38788 100644
|
|
|
|
|
index df00ea382915480be1279a5347872cf7a1417341..b27cb90a52bc7d96d4318979c678a49a884562b2 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
|
|
|
@@ -543,15 +543,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
|
|
|
protected void tick(BooleanSupplier shouldKeepTicking) {
|
|
|
|
|
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
|
|
|
|
|
|
|
|
|
- try (Timing ignored = this.level.timings.poiUnload.startTiming()) { // Paper
|
|
|
|
|
+ //try (Timing ignored = this.level.timings.poiUnload.startTiming()) { // Paper // Purpur
|
|
|
|
|
gameprofilerfiller.push("poi");
|
|
|
|
|
this.poiManager.tick(shouldKeepTicking);
|
|
|
|
|
- } // Paper
|
|
|
|
|
+ //} // Paper // Purpur
|
|
|
|
|
gameprofilerfiller.popPush("chunk_unload");
|
|
|
|
|
if (!this.level.noSave()) {
|
|
|
|
|
- try (Timing ignored = this.level.timings.chunkUnload.startTiming()) { // Paper
|
|
|
|
|
+ //try (Timing ignored = this.level.timings.chunkUnload.startTiming()) { // Paper // Purpur
|
|
|
|
|
this.processUnloads(shouldKeepTicking);
|
|
|
|
|
- } // Paper
|
|
|
|
|
+ //} // Paper // Purpur
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.pop();
|
|
|
|
|
@@ -1157,24 +1157,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
|
|
|
|
|
|
|
|
// Paper start - optimised tracker
|
|
|
|
|
private final void processTrackQueue() {
|
|
|
|
|
- this.level.timings.tracker1.startTiming();
|
|
|
|
|
+ //this.level.timings.tracker1.startTiming(); // Purpur
|
|
|
|
|
try {
|
|
|
|
|
for (TrackedEntity tracker : this.entityMap.values()) {
|
|
|
|
|
// update tracker entry
|
|
|
|
|
tracker.updatePlayers(tracker.entity.getPlayersInTrackRange());
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
- this.level.timings.tracker1.stopTiming();
|
|
|
|
|
+ //this.level.timings.tracker1.stopTiming(); // Purpur
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- this.level.timings.tracker2.startTiming();
|
|
|
|
|
+ //this.level.timings.tracker2.startTiming(); // Purpur
|
|
|
|
|
try {
|
|
|
|
|
for (TrackedEntity tracker : this.entityMap.values()) {
|
|
|
|
|
tracker.serverEntity.sendChanges();
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
- this.level.timings.tracker2.stopTiming();
|
|
|
|
|
+ //this.level.timings.tracker2.stopTiming(); // Purpur
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end - optimised tracker
|
|
|
|
|
@@ -1189,7 +1189,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
|
|
|
@@ -984,7 +984,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
|
|
|
List<ServerPlayer> list = Lists.newArrayList();
|
|
|
|
|
List<ServerPlayer> list1 = this.level.players();
|
|
|
|
|
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
|
|
|
|
@@ -321,7 +229,7 @@ index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..2b8448ccb0e4750b722933b0b5de02d8
|
|
|
|
|
|
|
|
|
|
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
|
|
|
|
|
|
|
|
|
@@ -1214,17 +1214,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
|
|
|
@@ -1009,17 +1009,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
|
|
|
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -343,26 +251,13 @@ index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..2b8448ccb0e4750b722933b0b5de02d8
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
|
|
|
index fcecfda569d2a8d6b8a7e228831f822fb7327748..e8906613073ba5dfe36f197c519953d391300ec4 100644
|
|
|
|
|
index 7dc2ecd8a80b063cec922021bd978ba2c6f8c0fb..8bead89ad6f54f5dbc6b03d90b6bb111fd2c983b 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
|
|
|
@@ -274,10 +274,10 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
if (!completablefuture.isDone()) { // Paper
|
|
|
|
|
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, x1, z1); // Paper - rewrite chunk system
|
|
|
|
|
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads
|
|
|
|
|
- this.level.timings.syncChunkLoad.startTiming(); // Paper
|
|
|
|
|
+ //this.level.timings.syncChunkLoad.startTiming(); // Paper // Purpur
|
|
|
|
|
chunkproviderserver_b.managedBlock(completablefuture::isDone);
|
|
|
|
|
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - rewrite chunk system
|
|
|
|
|
- this.level.timings.syncChunkLoad.stopTiming(); // Paper
|
|
|
|
|
+ //this.level.timings.syncChunkLoad.stopTiming(); // Paper // Purpur
|
|
|
|
|
} // Paper
|
|
|
|
|
ChunkResult<ChunkAccess> chunkresult = (ChunkResult) completablefuture.join();
|
|
|
|
|
ChunkAccess ichunkaccess1 = (ChunkAccess) chunkresult.orElse(null); // CraftBukkit - decompile error
|
|
|
|
|
@@ -425,17 +425,17 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
@@ -418,9 +418,9 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
|
|
|
|
|
public void save(boolean flush) {
|
|
|
|
|
this.runDistanceManagerUpdates();
|
|
|
|
|
// Paper - rewrite chunk system
|
|
|
|
|
- try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
|
|
|
|
+ //try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings // Purpur
|
|
|
|
|
this.chunkMap.saveAllChunks(flush);
|
|
|
|
|
@@ -370,18 +265,8 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..e8906613073ba5dfe36f197c519953d3
|
|
|
|
|
+ //} // Paper - Timings // Purpur
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Paper start - Incremental chunk and player saving; duplicate save, but call incremental
|
|
|
|
|
public void saveIncrementally() {
|
|
|
|
|
this.runDistanceManagerUpdates();
|
|
|
|
|
- try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
|
|
|
|
+ //try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings // Purpur
|
|
|
|
|
this.chunkMap.saveIncrementally();
|
|
|
|
|
- } // Paper - Timings
|
|
|
|
|
+ //} // Paper - Timings // Purpur
|
|
|
|
|
}
|
|
|
|
|
// Paper end - Incremental chunk and player saving
|
|
|
|
|
|
|
|
|
|
@@ -472,26 +472,25 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
@Override
|
|
|
|
|
@@ -448,26 +448,25 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
@Override
|
|
|
|
|
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
|
|
|
|
|
this.level.getProfiler().push("purge");
|
|
|
|
|
@@ -398,7 +283,7 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..e8906613073ba5dfe36f197c519953d3
|
|
|
|
|
if (tickChunks) {
|
|
|
|
|
- this.level.timings.chunks.startTiming(); // Paper - timings
|
|
|
|
|
+ //this.level.timings.chunks.startTiming(); // Paper - timings // Purpur
|
|
|
|
|
this.chunkMap.level.playerChunkLoader.tick(); // Paper - replace player chunk loader - this is mostly required to account for view distance changes
|
|
|
|
|
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system
|
|
|
|
|
this.tickChunks();
|
|
|
|
|
- this.level.timings.chunks.stopTiming(); // Paper - timings
|
|
|
|
|
+ //this.level.timings.chunks.stopTiming(); // Paper - timings // Purpur
|
|
|
|
|
@@ -414,14 +299,16 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..e8906613073ba5dfe36f197c519953d3
|
|
|
|
|
this.level.getProfiler().pop();
|
|
|
|
|
this.clearCache();
|
|
|
|
|
}
|
|
|
|
|
@@ -507,13 +506,13 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
gameprofilerfiller.push("pollingChunks");
|
|
|
|
|
@@ -484,7 +483,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
gameprofilerfiller.push("filteringLoadedChunks");
|
|
|
|
|
// Paper - optimise chunk tick iteration
|
|
|
|
|
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
|
|
|
|
Iterator iterator = this.chunkMap.getChunks().iterator();
|
|
|
|
|
- if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper
|
|
|
|
|
+ //if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur
|
|
|
|
|
|
|
|
|
|
// Paper - optimise chunk tick iteration
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
|
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
|
|
|
|
|
@@ -497,7 +496,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
|
|
|
|
|
if (this.level.tickRateManager().runsNormally()) {
|
|
|
|
|
gameprofilerfiller.popPush("naturalSpawnCount");
|
|
|
|
|
@@ -430,7 +317,7 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..e8906613073ba5dfe36f197c519953d3
|
|
|
|
|
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
|
|
|
|
// Paper start - Optional per player mob spawns
|
|
|
|
|
int naturalSpawnChunkCount = k;
|
|
|
|
|
@@ -538,7 +537,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
@@ -522,7 +521,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
|
|
|
|
|
}
|
|
|
|
|
// Paper end - Optional per player mob spawns
|
|
|
|
|
@@ -439,12 +326,12 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..e8906613073ba5dfe36f197c519953d3
|
|
|
|
|
|
|
|
|
|
this.lastSpawnState = spawnercreature_d;
|
|
|
|
|
gameprofilerfiller.popPush("spawnAndTick");
|
|
|
|
|
@@ -647,19 +646,19 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
@@ -558,21 +557,21 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end - optimise chunk tick iteration
|
|
|
|
|
- this.level.timings.chunkTicks.stopTiming(); // Paper
|
|
|
|
|
+ // this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
|
|
|
|
|
+ //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.popPush("customSpawners");
|
|
|
|
|
if (flag) {
|
|
|
|
|
@@ -457,26 +344,20 @@ index fcecfda569d2a8d6b8a7e228831f822fb7327748..e8906613073ba5dfe36f197c519953d3
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.popPush("broadcast");
|
|
|
|
|
// Paper - optimise chunk tick iteration
|
|
|
|
|
list.forEach((chunkproviderserver_a1) -> {
|
|
|
|
|
- this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing
|
|
|
|
|
+ //this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur
|
|
|
|
|
// Paper start - optimise chunk tick iteration
|
|
|
|
|
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
|
|
|
|
|
it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
|
|
|
|
|
@@ -673,7 +672,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end - optimise chunk tick iteration
|
|
|
|
|
chunkproviderserver_a1.holder.broadcastChanges(chunkproviderserver_a1.chunk);
|
|
|
|
|
- this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing
|
|
|
|
|
+ //this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur
|
|
|
|
|
// Paper - optimise chunk tick iteration
|
|
|
|
|
});
|
|
|
|
|
gameprofilerfiller.pop();
|
|
|
|
|
gameprofilerfiller.pop();
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6baff1c74 100644
|
|
|
|
|
index 49f77274309befcdef1548e875480b9f667a414e..40f02c3871928be26cefca3afc62286cbee15e69 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
@@ -872,7 +872,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -687,7 +687,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.popPush("tickPending");
|
|
|
|
|
@@ -485,7 +366,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
if (!this.isDebug() && flag) {
|
|
|
|
|
j = this.getGameTime();
|
|
|
|
|
gameprofilerfiller.push("blockTicks");
|
|
|
|
|
@@ -881,24 +881,24 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -696,24 +696,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
|
|
|
|
|
gameprofilerfiller.pop();
|
|
|
|
|
}
|
|
|
|
|
@@ -517,7 +398,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.handlingTick = false;
|
|
|
|
|
@@ -911,7 +911,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -726,7 +726,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
|
|
|
|
|
if (flag1 || this.emptyTime++ < 300) {
|
|
|
|
|
gameprofilerfiller.push("entities");
|
|
|
|
|
@@ -526,7 +407,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
if (this.dragonFight != null && flag) {
|
|
|
|
|
gameprofilerfiller.push("dragonFight");
|
|
|
|
|
this.dragonFight.tick();
|
|
|
|
|
@@ -919,7 +919,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -734,7 +734,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
|
|
|
|
@@ -535,7 +416,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
this.entityTickList.forEach((entity) -> {
|
|
|
|
|
if (!entity.isRemoved()) {
|
|
|
|
|
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
|
|
|
|
@@ -946,8 +946,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -761,8 +761,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@@ -546,25 +427,25 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
gameprofilerfiller.pop();
|
|
|
|
|
this.tickBlockEntities();
|
|
|
|
|
}
|
|
|
|
|
@@ -1089,7 +1089,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -895,7 +895,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
} // Paper - Option to disable ice and snow
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.popPush("tickBlocks");
|
|
|
|
|
- timings.chunkTicksBlocks.startTiming(); // Paper
|
|
|
|
|
+ //timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
|
|
|
|
|
if (randomTickSpeed > 0) {
|
|
|
|
|
// Paper start - optimize random block ticking
|
|
|
|
|
LevelChunkSection[] sections = chunk.getSections();
|
|
|
|
|
@@ -1123,7 +1123,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
LevelChunkSection[] achunksection = chunk.getSections();
|
|
|
|
|
|
|
|
|
|
@@ -928,7 +928,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end - optimise random block ticking
|
|
|
|
|
|
|
|
|
|
- timings.chunkTicksBlocks.stopTiming(); // Paper
|
|
|
|
|
+ //timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
|
|
|
|
|
gameprofilerfiller.pop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1467,8 +1467,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -1242,8 +1242,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
// Spigot end
|
|
|
|
|
// Paper start- timings
|
|
|
|
|
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity);
|
|
|
|
|
@@ -575,7 +456,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
// Paper end - timings
|
|
|
|
|
entity.setOldPosAndRot();
|
|
|
|
|
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
|
|
|
|
@@ -1484,7 +1484,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -1259,7 +1259,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
entity.postTick(); // CraftBukkit
|
|
|
|
|
} else { entity.inactiveTick(); } // Paper - EAR 2
|
|
|
|
|
this.getProfiler().pop();
|
|
|
|
|
@@ -584,7 +465,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
Iterator iterator = entity.getPassengers().iterator();
|
|
|
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
|
@@ -1507,8 +1507,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -1276,8 +1276,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
|
|
|
|
// Paper - EAR 2
|
|
|
|
|
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
|
|
|
|
|
@@ -595,7 +476,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
// Paper end
|
|
|
|
|
passenger.setOldPosAndRot();
|
|
|
|
|
++passenger.tickCount;
|
|
|
|
|
@@ -1538,7 +1538,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -1307,7 +1307,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
this.tickPassenger(passenger, entity2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -604,34 +485,7 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
passenger.stopRiding();
|
|
|
|
|
@@ -1558,14 +1558,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) {
|
|
|
|
|
+ //try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) { // Purpur
|
|
|
|
|
if (doFull) {
|
|
|
|
|
this.saveLevelData(true); // Paper - Write SavedData IO async
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- this.timings.worldSaveChunks.startTiming(); // Paper
|
|
|
|
|
+ //this.timings.worldSaveChunks.startTiming(); // Paper // Purpur
|
|
|
|
|
if (!this.noSave()) chunkproviderserver.saveIncrementally();
|
|
|
|
|
- this.timings.worldSaveChunks.stopTiming(); // Paper
|
|
|
|
|
+ //this.timings.worldSaveChunks.stopTiming(); // Paper // Purpur
|
|
|
|
|
|
|
|
|
|
// Copied from save()
|
|
|
|
|
// CraftBukkit start - moved from MinecraftServer.saveChunks
|
|
|
|
|
@@ -1577,7 +1577,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
- }
|
|
|
|
|
+ //} // Purpur
|
|
|
|
|
}
|
|
|
|
|
// Paper end - Incremental chunk and player saving
|
|
|
|
|
|
|
|
|
|
@@ -1591,7 +1591,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -1329,7 +1329,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
|
|
|
|
|
if (!savingDisabled) {
|
|
|
|
|
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
|
|
|
|
|
@@ -640,37 +494,30 @@ index 5d20af55a3a8fa1b585a9fe36c817eb0bd609d16..b727c707ef46a9387fc225b51ef050c6
|
|
|
|
|
if (progressListener != null) {
|
|
|
|
|
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
|
|
|
|
|
}
|
|
|
|
|
@@ -1601,11 +1601,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -1339,9 +1339,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
|
|
|
progressListener.progressStage(Component.translatable("menu.savingChunks"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- timings.worldSaveChunks.startTiming(); // Paper
|
|
|
|
|
+ //timings.worldSaveChunks.startTiming(); // Paper // Purpur
|
|
|
|
|
if (!close) chunkproviderserver.save(flush); // Paper - rewrite chunk system
|
|
|
|
|
if (close) chunkproviderserver.close(true); // Paper - rewrite chunk system
|
|
|
|
|
if (!close) { chunkproviderserver.save(flush); } // Paper - add close param
|
|
|
|
|
- timings.worldSaveChunks.stopTiming(); // Paper
|
|
|
|
|
- }// Paper
|
|
|
|
|
+ //timings.worldSaveChunks.stopTiming(); // Paper // Purpur
|
|
|
|
|
+ //}// Paper // Purpur
|
|
|
|
|
// Paper - rewrite chunk system - entity saving moved into ChunkHolder
|
|
|
|
|
}// Paper
|
|
|
|
|
// Paper - rewrite chunk system
|
|
|
|
|
|
|
|
|
|
} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
|
index d20a7a79e27db1092ff78910df5d45982971cc3e..b863f6fe65c796a1d3102cc3eddb5d6c5becd3ac 100644
|
|
|
|
|
index f4f965a51628a096f6697f4008ec9dba04d30fd2..224ee4649a8e2d3c99ac5ca298233bcb89248fc3 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
|
@@ -1273,7 +1273,7 @@ public abstract class PlayerList {
|
|
|
|
|
@@ -1220,11 +1220,11 @@ public abstract class PlayerList {
|
|
|
|
|
|
|
|
|
|
public void saveAll(int interval) {
|
|
|
|
|
public void saveAll() {
|
|
|
|
|
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
|
|
|
|
|
- MinecraftTimings.savePlayers.startTiming(); // Paper
|
|
|
|
|
+ //MinecraftTimings.savePlayers.startTiming(); // Paper // Purpur
|
|
|
|
|
int numSaved = 0;
|
|
|
|
|
long now = MinecraftServer.currentTick;
|
|
|
|
|
for (int i = 0; i < this.players.size(); ++i) {
|
|
|
|
|
@@ -1284,7 +1284,7 @@ public abstract class PlayerList {
|
|
|
|
|
}
|
|
|
|
|
// Paper end - Incremental chunk and player saving
|
|
|
|
|
this.save(this.players.get(i));
|
|
|
|
|
}
|
|
|
|
|
- MinecraftTimings.savePlayers.stopTiming(); // Paper
|
|
|
|
|
+ //MinecraftTimings.savePlayers.stopTiming(); // Paper // Purpur
|
|
|
|
|
@@ -727,10 +574,10 @@ index 85b4b24361e785acf75571ff98f924c00ae80748..09a7b418ddf564c0be13297f7c216db2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
|
|
|
index f81a73b0ca751086cb13a9e4fef227356429209b..a09e27a34631b779ca0170da7abc0bcb2559c5d2 100644
|
|
|
|
|
index 6b1dc40787e53723ff48b1ed4d408bb935f2cca8..e94e6cc538094de4ce0fc0f615e6fed8bcdcb828 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
|
|
|
@@ -1298,15 +1298,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -987,15 +987,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
|
|
|
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.push("blockEntities");
|
|
|
|
|
@@ -749,7 +596,7 @@ index f81a73b0ca751086cb13a9e4fef227356429209b..a09e27a34631b779ca0170da7abc0bcb
|
|
|
|
|
// Spigot start
|
|
|
|
|
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
|
|
|
|
|
boolean flag = this.tickRateManager().runsNormally();
|
|
|
|
|
@@ -1335,7 +1335,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -1019,7 +1019,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
|
|
|
}
|
|
|
|
|
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
|
|
|
|
|
|
|
|
|
@@ -781,11 +628,11 @@ index ed8032495af9ce9c23419224814b8d27e4a97c17..2812505185df691e8f08932aa0bba162
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 14ee7b5b9b804bebd4e2a846b238547a28a36035..a9ed6255be8505cb8d067dbf8f665aacda618716 100644
|
|
|
|
|
index d869607853ad27032df072c1f1d74a74e4911baf..b29e8136f2bf7af0dd37bd030cee67e310de6faa 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
|
|
|
@@ -785,7 +785,7 @@ public class LevelChunk extends ChunkAccess {
|
|
|
|
|
this.chunkHolder.getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system
|
|
|
|
|
@@ -739,7 +739,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
|
|
|
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration));
|
|
|
|
|
|
|
|
|
|
if (this.needsDecoration) {
|
|
|
|
|
- try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
|
|
|
|
|
@@ -793,7 +640,7 @@ index 14ee7b5b9b804bebd4e2a846b238547a28a36035..a9ed6255be8505cb8d067dbf8f665aac
|
|
|
|
|
this.needsDecoration = false;
|
|
|
|
|
java.util.Random random = new java.util.Random();
|
|
|
|
|
random.setSeed(this.level.getSeed());
|
|
|
|
|
@@ -805,7 +805,7 @@ public class LevelChunk extends ChunkAccess {
|
|
|
|
|
@@ -759,7 +759,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
|
|
|
|
@@ -802,7 +649,7 @@ index 14ee7b5b9b804bebd4e2a846b238547a28a36035..a9ed6255be8505cb8d067dbf8f665aac
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -1161,7 +1161,7 @@ public class LevelChunk extends ChunkAccess {
|
|
|
|
|
@@ -1109,7 +1109,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
|
|
|
ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler();
|
|
|
|
|
|
|
|
|
|
gameprofilerfiller.push(this::getType);
|
|
|
|
|
@@ -811,7 +658,7 @@ index 14ee7b5b9b804bebd4e2a846b238547a28a36035..a9ed6255be8505cb8d067dbf8f665aac
|
|
|
|
|
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
|
|
|
|
|
|
|
|
|
if (this.blockEntity.getType().isValid(iblockdata)) {
|
|
|
|
|
@@ -1188,7 +1188,7 @@ public class LevelChunk extends ChunkAccess {
|
|
|
|
|
@@ -1135,7 +1135,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
|
|
|
// Paper end - Prevent block entity and entity crashes
|
|
|
|
|
// Spigot start
|
|
|
|
|
} finally {
|
|
|
|
|
@@ -898,7 +745,7 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..d3ec817e95628f1fc8be4a29c9a0f13c
|
|
|
|
|
// Paper end - add timings for scoreboard search
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
|
|
|
|
index 2ed85c0aa7d3053e338927fa308b86bcbf9eb7b6..f7644c5045b1accae4c0aaf44df26286c6cc5125 100644
|
|
|
|
|
index 9bec373c470a4f2bc0f1f4101469ec8be903ab83..1e8100be8d443d43e99e0c5f777e20872f6e1a7f 100644
|
|
|
|
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
|
|
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
|
|
|
@@ -167,7 +167,7 @@ public class ActivationRange
|
|
|
|
|
@@ -910,7 +757,7 @@ index 2ed85c0aa7d3053e338927fa308b86bcbf9eb7b6..f7644c5045b1accae4c0aaf44df26286
|
|
|
|
|
final int miscActivationRange = world.spigotConfig.miscActivationRange;
|
|
|
|
|
final int raiderActivationRange = world.spigotConfig.raiderActivationRange;
|
|
|
|
|
final int animalActivationRange = world.spigotConfig.animalActivationRange;
|
|
|
|
|
@@ -227,7 +227,7 @@ public class ActivationRange
|
|
|
|
|
@@ -228,7 +228,7 @@ public class ActivationRange
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
}
|