mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@79e2cb6 Update upstream (Bukkit/CraftBukkit/Spigot) (#10875)
922 lines
52 KiB
Diff
922 lines
52 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
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;
|
|
}
|
|
}
|
|
- }
|
|
+ //} // Purpur
|
|
|
|
return executedUnloadTask | canSaveChunk | canSaveEntities | canSavePOI ? new SaveStat(executedUnloadTask || canSaveChunk, canSaveEntities, canSavePOI): null;
|
|
}
|
|
diff --git a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
|
index 0c3c82b28e581286b798ee58ca4193efc2faff4a..24121a43aeb5e9bce013f30c92dddd15f99736c6 100644
|
|
--- a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
|
+++ b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
|
@@ -80,16 +80,16 @@ public class BukkitCommandNode extends LiteralCommandNode<CommandSourceStack> {
|
|
|
|
// Plugins do weird things to workaround normal registration
|
|
if (this.command.timings == null) {
|
|
- this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command);
|
|
+ //this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command); // Purpur
|
|
}
|
|
|
|
String content = context.getRange().get(context.getInput());
|
|
String[] args = org.apache.commons.lang3.StringUtils.split(content, ' '); // fix adjacent spaces (from console/plugins) causing empty array elements
|
|
|
|
- try (Timing ignored = this.command.timings.startTiming()) {
|
|
+ //try (Timing ignored = this.command.timings.startTiming()) { // Purpur
|
|
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
|
this.command.execute(sender, this.literal, Arrays.copyOfRange(args, 1, args.length));
|
|
- }
|
|
+ //} // Purpur
|
|
|
|
// 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
|
|
--- 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 {
|
|
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
|
|
- try (co.aikar.timings.Timing ignored = timing.startTiming()) { // Paper - timings
|
|
+ try { // Paper - timings // Purpur
|
|
packet.handle(listener);
|
|
} 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
|
|
--- 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
|
|
}
|
|
|
|
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
|
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
|
|
+ //co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper // Purpur
|
|
long i = Util.getNanos();
|
|
|
|
// Paper start - move oversleep into full server tick
|
|
- isOversleep = true;MinecraftTimings.serverOversleep.startTiming();
|
|
+ //isOversleep = true;MinecraftTimings.serverOversleep.startTiming(); // Purpur
|
|
this.managedBlock(() -> {
|
|
return !this.canOversleep();
|
|
});
|
|
- isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
|
|
+ //isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); // Purpur
|
|
// 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
|
|
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()) {
|
|
+ //try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { // Purpur
|
|
this.runAllTasks();
|
|
- }
|
|
+ //} // Purpur
|
|
// Paper end
|
|
// Paper start - Server Tick Events
|
|
long endTime = System.nanoTime();
|
|
@@ -1649,7 +1649,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.logTickMethodTime(i);
|
|
this.profiler.pop();
|
|
org.spigotmc.WatchdogThread.tick(); // Spigot
|
|
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
|
|
+ //co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
|
|
}
|
|
|
|
private void logTickMethodTime(long tickStartTime) {
|
|
@@ -1720,9 +1720,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
|
entityplayer.connection.suspendFlushing();
|
|
});
|
|
- MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
|
|
- MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
// 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
|
|
// Paper end - Folia scheduler API
|
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
|
this.profiler.push("commandFunctions");
|
|
- MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.getFunctions().tick();
|
|
- MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
this.profiler.popPush("levels");
|
|
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
|
|
|
|
// CraftBukkit start
|
|
// Run tasks that are waiting on processing
|
|
- MinecraftTimings.processQueueTimer.startTiming(); // Spigot
|
|
+ //MinecraftTimings.processQueueTimer.startTiming(); // Spigot // Purpur
|
|
while (!this.processQueue.isEmpty()) {
|
|
this.processQueue.remove().run();
|
|
}
|
|
- MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
|
|
+ //MinecraftTimings.processQueueTimer.stopTiming(); // Spigot // Purpur
|
|
|
|
- MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper // Purpur
|
|
// 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
|
|
}
|
|
}
|
|
// Paper end - Perf: Optimize time updates
|
|
- MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
|
|
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
|
|
this.profiler.push("tick");
|
|
|
|
try {
|
|
- worldserver.timings.doTick.startTiming(); // Spigot
|
|
+ //worldserver.timings.doTick.startTiming(); // Spigot // Purpur
|
|
worldserver.tick(shouldKeepTicking);
|
|
// Paper start
|
|
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
|
|
regionManager.recalculateRegions();
|
|
}
|
|
// Paper end
|
|
- worldserver.timings.doTick.stopTiming(); // Spigot
|
|
+ //worldserver.timings.doTick.stopTiming(); // Spigot // Purpur
|
|
} catch (Throwable throwable) {
|
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
|
|
|
@@ -1823,24 +1823,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
|
|
|
this.profiler.popPush("connection");
|
|
- MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
|
|
+ // MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.getConnection().tick();
|
|
- MinecraftTimings.connectionTimer.stopTiming(); // Spigot // Paper
|
|
+ // MinecraftTimings.connectionTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
this.profiler.popPush("players");
|
|
- MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.playerList.tick();
|
|
- MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
if (SharedConstants.IS_RUNNING_IN_IDE && this.tickRateManager.runsNormally()) {
|
|
GameTestTicker.SINGLETON.tick();
|
|
}
|
|
|
|
this.profiler.popPush("server gui refresh");
|
|
|
|
- MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
|
|
for (int i = 0; i < this.tickables.size(); ++i) {
|
|
((Runnable) this.tickables.get(i)).run();
|
|
}
|
|
- MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
|
|
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
|
|
--- 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
|
|
}
|
|
|
|
public void handleConsoleInputs() {
|
|
- MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
|
|
+ //MinecraftTimings.serverCommandTimer.startTiming(); // Spigot // Purpur
|
|
// 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
|
|
// CraftBukkit end
|
|
}
|
|
|
|
- MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot
|
|
+ //MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot // Purpur
|
|
}
|
|
|
|
@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
|
|
--- 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
|
|
List<ServerPlayer> list = Lists.newArrayList();
|
|
List<ServerPlayer> list1 = this.level.players();
|
|
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
|
- level.timings.tracker1.startTiming(); // Paper
|
|
+ //this.level.timings.tracker1.startTiming(); // Paper // Purpur
|
|
|
|
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
|
|
|
@@ -1214,17 +1214,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
|
}
|
|
}
|
|
- level.timings.tracker1.stopTiming(); // Paper
|
|
+ //this.level.timings.tracker1.stopTiming(); // Paper // Purpur
|
|
|
|
if (!list.isEmpty()) {
|
|
objectiterator = this.entityMap.values().iterator();
|
|
|
|
- level.timings.tracker2.startTiming(); // Paper
|
|
+ //this.level.timings.tracker2.startTiming(); // Paper // Purpur
|
|
while (objectiterator.hasNext()) {
|
|
playerchunkmap_entitytracker = (ChunkMap.TrackedEntity) objectiterator.next();
|
|
playerchunkmap_entitytracker.updatePlayers(list);
|
|
}
|
|
- level.timings.tracker2.stopTiming(); // Paper
|
|
+ //this.level.timings.tracker2.stopTiming(); // Paper // Purpur
|
|
}
|
|
|
|
}
|
|
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
|
|
--- 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 {
|
|
|
|
public void save(boolean flush) {
|
|
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.saveAllChunks(flush);
|
|
- } // Paper - Timings
|
|
+ //} // 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
|
|
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
|
|
this.level.getProfiler().push("purge");
|
|
- this.level.timings.doChunkMap.startTiming(); // Spigot
|
|
+ //this.level.timings.doChunkMap.startTiming(); // Spigot // Purpur
|
|
if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot
|
|
this.distanceManager.purgeStaleTickets();
|
|
}
|
|
-
|
|
this.runDistanceManagerUpdates();
|
|
- this.level.timings.doChunkMap.stopTiming(); // Spigot
|
|
+ //this.level.timings.doChunkMap.stopTiming(); // Spigot // Purpur
|
|
this.level.getProfiler().popPush("chunks");
|
|
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
|
|
this.tickChunks();
|
|
- this.level.timings.chunks.stopTiming(); // Paper - timings
|
|
+ //this.level.timings.chunks.stopTiming(); // Paper - timings // Purpur
|
|
this.chunkMap.tick();
|
|
}
|
|
|
|
- this.level.timings.doChunkUnload.startTiming(); // Spigot
|
|
+ //this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur
|
|
this.level.getProfiler().popPush("unload");
|
|
this.chunkMap.tick(shouldKeepTicking);
|
|
- this.level.timings.doChunkUnload.stopTiming(); // Spigot
|
|
+ //this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur
|
|
this.level.getProfiler().pop();
|
|
this.clearCache();
|
|
}
|
|
@@ -507,13 +506,13 @@ public class ServerChunkCache extends ChunkSource {
|
|
gameprofilerfiller.push("pollingChunks");
|
|
gameprofilerfiller.push("filteringLoadedChunks");
|
|
// Paper - optimise chunk tick iteration
|
|
- 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
|
|
|
|
if (this.level.tickRateManager().runsNormally()) {
|
|
gameprofilerfiller.popPush("naturalSpawnCount");
|
|
- this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
|
|
+ //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
|
|
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
|
// Paper start - Optional per player mob spawns
|
|
int naturalSpawnChunkCount = k;
|
|
@@ -538,7 +537,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
|
|
- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
|
+ // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
|
|
|
|
this.lastSpawnState = spawnercreature_d;
|
|
gameprofilerfiller.popPush("spawnAndTick");
|
|
@@ -647,19 +646,19 @@ public class ServerChunkCache extends ChunkSource {
|
|
}
|
|
}
|
|
// Paper end - optimise chunk tick iteration
|
|
- this.level.timings.chunkTicks.stopTiming(); // Paper
|
|
+ // this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
|
|
|
|
gameprofilerfiller.popPush("customSpawners");
|
|
if (flag) {
|
|
- try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings
|
|
+ //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur
|
|
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
|
|
- } // Paper - timings
|
|
+ //} // Paper - timings // Purpur
|
|
}
|
|
}
|
|
|
|
gameprofilerfiller.popPush("broadcast");
|
|
// Paper - optimise chunk tick iteration
|
|
- 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
|
|
- 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
|
|
--- 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 {
|
|
}
|
|
|
|
gameprofilerfiller.popPush("tickPending");
|
|
- this.timings.scheduledBlocks.startTiming(); // Paper
|
|
+ //this.timings.scheduledBlocks.startTiming(); // Paper // Purpur
|
|
if (!this.isDebug() && flag) {
|
|
j = this.getGameTime();
|
|
gameprofilerfiller.push("blockTicks");
|
|
@@ -881,24 +881,24 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
|
|
gameprofilerfiller.pop();
|
|
}
|
|
- this.timings.scheduledBlocks.stopTiming(); // Paper
|
|
+ //this.timings.scheduledBlocks.stopTiming(); // Paper // Purpur
|
|
|
|
gameprofilerfiller.popPush("raid");
|
|
if (flag) {
|
|
- this.timings.raids.startTiming(); // Paper - timings
|
|
+ // this.timings.raids.startTiming(); // Paper - timings // Purpur
|
|
this.raids.tick();
|
|
- this.timings.raids.stopTiming(); // Paper - timings
|
|
+ // this.timings.raids.stopTiming(); // Paper - timings // Purpur
|
|
}
|
|
|
|
gameprofilerfiller.popPush("chunkSource");
|
|
- this.timings.chunkProviderTick.startTiming(); // Paper - timings
|
|
+ //this.timings.chunkProviderTick.startTiming(); // Paper - timings // Purpur
|
|
this.getChunkSource().tick(shouldKeepTicking, true);
|
|
- this.timings.chunkProviderTick.stopTiming(); // Paper - timings
|
|
+ //this.timings.chunkProviderTick.stopTiming(); // Paper - timings // Purpur
|
|
gameprofilerfiller.popPush("blockEvents");
|
|
if (flag) {
|
|
- this.timings.doSounds.startTiming(); // Spigot
|
|
+ // this.timings.doSounds.startTiming(); // Spigot // Purpur
|
|
this.runBlockEvents();
|
|
- this.timings.doSounds.stopTiming(); // Spigot
|
|
+ // this.timings.doSounds.stopTiming(); // Spigot // Purpur
|
|
}
|
|
|
|
this.handlingTick = false;
|
|
@@ -911,7 +911,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
if (flag1 || this.emptyTime++ < 300) {
|
|
gameprofilerfiller.push("entities");
|
|
- this.timings.tickEntities.startTiming(); // Spigot
|
|
+ //this.timings.tickEntities.startTiming(); // Spigot // Purpur
|
|
if (this.dragonFight != null && flag) {
|
|
gameprofilerfiller.push("dragonFight");
|
|
this.dragonFight.tick();
|
|
@@ -919,7 +919,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
}
|
|
|
|
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
|
- this.timings.entityTick.startTiming(); // Spigot
|
|
+ //this.timings.entityTick.startTiming(); // Spigot // Purpur
|
|
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 {
|
|
}
|
|
}
|
|
});
|
|
- this.timings.entityTick.stopTiming(); // Spigot
|
|
- this.timings.tickEntities.stopTiming(); // Spigot
|
|
+ //this.timings.entityTick.stopTiming(); // Spigot // Purpur
|
|
+ //this.timings.tickEntities.stopTiming(); // Spigot // Purpur
|
|
gameprofilerfiller.pop();
|
|
this.tickBlockEntities();
|
|
}
|
|
@@ -1089,7 +1089,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
} // 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 {
|
|
}
|
|
// 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 {
|
|
// Spigot end
|
|
// Paper start- timings
|
|
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity);
|
|
- timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper
|
|
- try {
|
|
+ //timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper // Purpur
|
|
+ //try { // Purpur
|
|
// Paper end - timings
|
|
entity.setOldPosAndRot();
|
|
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
|
@@ -1484,7 +1484,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
entity.postTick(); // CraftBukkit
|
|
} else { entity.inactiveTick(); } // Paper - EAR 2
|
|
this.getProfiler().pop();
|
|
- } finally { timer.stopTiming(); } // Paper - timings
|
|
+ //} finally { timer.stopTiming(); } // Paper - timings // Purpur
|
|
Iterator iterator = entity.getPassengers().iterator();
|
|
|
|
while (iterator.hasNext()) {
|
|
@@ -1507,8 +1507,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
|
// Paper - EAR 2
|
|
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
|
|
- co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper
|
|
- try {
|
|
+ //co.aikar.timings.Timing timer = isActive ? passenger.getType().passengerTickTimer.startTiming() : passenger.getType().passengerInactiveTickTimer.startTiming(); // Paper // Purpur
|
|
+ //try { // Purpur
|
|
// Paper end
|
|
passenger.setOldPosAndRot();
|
|
++passenger.tickCount;
|
|
@@ -1538,7 +1538,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
this.tickPassenger(passenger, entity2);
|
|
}
|
|
|
|
- } finally { timer.stopTiming(); }// Paper - EAR2 timings
|
|
+ //} finally { timer.stopTiming(); }// Paper - EAR2 timings // Purpur
|
|
}
|
|
} 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 {
|
|
|
|
if (!savingDisabled) {
|
|
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
|
|
- try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
|
|
+ //try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper // Purpur // Purpur
|
|
if (progressListener != null) {
|
|
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
|
|
}
|
|
@@ -1601,11 +1601,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
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
|
|
- timings.worldSaveChunks.stopTiming(); // Paper
|
|
- }// Paper
|
|
+ //timings.worldSaveChunks.stopTiming(); // Paper // Purpur
|
|
+ //}// Paper // Purpur
|
|
// Paper - rewrite chunk system - entity saving moved into ChunkHolder
|
|
|
|
} 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
|
|
--- 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 {
|
|
|
|
public void saveAll(int interval) {
|
|
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
|
|
}
|
|
- MinecraftTimings.savePlayers.stopTiming(); // Paper
|
|
+ //MinecraftTimings.savePlayers.stopTiming(); // Paper // Purpur
|
|
return null; }); // Paper - ensure main
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
index 9379dd4056018b52c93ed4888dcdc94579bd9691..612a14806ec63b0dcf31814396282f4b7f4a527c 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
@@ -59,9 +59,9 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
|
|
this.status = Behavior.Status.RUNNING;
|
|
int i = this.minDuration + world.getRandom().nextInt(this.maxDuration + 1 - this.minDuration);
|
|
this.endTimestamp = time + (long)i;
|
|
- this.timing.startTiming(); // Paper - behavior timings
|
|
+ //this.timing.startTiming(); // Paper - behavior timings // Purpur
|
|
this.start(world, entity, time);
|
|
- this.timing.stopTiming(); // Paper - behavior timings
|
|
+ //this.timing.stopTiming(); // Paper - behavior timings // Purpur
|
|
return true;
|
|
} else {
|
|
return false;
|
|
@@ -73,13 +73,13 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
|
|
|
|
@Override
|
|
public final void tickOrStop(ServerLevel world, E entity, long time) {
|
|
- this.timing.startTiming(); // Paper - behavior timings
|
|
+ //this.timing.startTiming(); // Paper - behavior timings // Purpur
|
|
if (!this.timedOut(time) && this.canStillUse(world, entity, time)) {
|
|
this.tick(world, entity, time);
|
|
} else {
|
|
this.doStop(world, entity, time);
|
|
}
|
|
- this.timing.stopTiming(); // Paper - behavior timings
|
|
+ //this.timing.stopTiming(); // Paper - behavior timings // Purpur
|
|
}
|
|
|
|
protected void tick(ServerLevel world, E entity, long time) {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
index 85b4b24361e785acf75571ff98f924c00ae80748..09a7b418ddf564c0be13297f7c216db2e7ae1578 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
@@ -53,10 +53,10 @@ public abstract class Sensor<E extends LivingEntity> {
|
|
if (--this.timeToTick <= 0L) {
|
|
// Paper start - configurable sensor tick rate and timings
|
|
this.timeToTick = java.util.Objects.requireNonNullElse(world.paperConfig().tickRates.sensor.get(entity.getType(), this.configKey), this.scanRate);
|
|
- this.timing.startTiming();
|
|
+ //this.timing.startTiming(); // Purpur
|
|
// Paper end
|
|
this.doTick(world, entity);
|
|
- this.timing.stopTiming(); // Paper - sensor timings
|
|
+ //this.timing.stopTiming(); // Paper - sensor timings // Purpur
|
|
}
|
|
}
|
|
|
|
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
|
|
--- 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 {
|
|
ProfilerFiller gameprofilerfiller = this.getProfiler();
|
|
|
|
gameprofilerfiller.push("blockEntities");
|
|
- this.timings.tileEntityPending.startTiming(); // Spigot
|
|
+ //this.timings.tileEntityPending.startTiming(); // Spigot // Purpur
|
|
this.tickingBlockEntities = true;
|
|
if (!this.pendingBlockEntityTickers.isEmpty()) {
|
|
this.blockEntityTickers.addAll(this.pendingBlockEntityTickers);
|
|
this.pendingBlockEntityTickers.clear();
|
|
}
|
|
- this.timings.tileEntityPending.stopTiming(); // Spigot
|
|
+ //this.timings.tileEntityPending.stopTiming(); // Spigot // Purpur
|
|
|
|
- this.timings.tileEntityTick.startTiming(); // Spigot
|
|
+ //this.timings.tileEntityTick.startTiming(); // Spigot // Purpur
|
|
// Spigot start
|
|
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
|
|
boolean flag = this.tickRateManager().runsNormally();
|
|
@@ -1335,7 +1335,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
}
|
|
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
|
|
|
- this.timings.tileEntityTick.stopTiming(); // Spigot
|
|
+ //this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur
|
|
this.tickingBlockEntities = false;
|
|
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
|
|
gameprofilerfiller.pop();
|
|
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
index ed8032495af9ce9c23419224814b8d27e4a97c17..2812505185df691e8f08932aa0bba162a7d9db86 100644
|
|
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
@@ -128,7 +128,7 @@ public final class NaturalSpawner {
|
|
|
|
public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, boolean spawnAnimals, boolean spawnMonsters, boolean rareSpawn) {
|
|
world.getProfiler().push("spawner");
|
|
- world.timings.mobSpawn.startTiming(); // Spigot
|
|
+ //world.timings.mobSpawn.startTiming(); // Spigot // Purpur
|
|
MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES;
|
|
int i = aenumcreaturetype.length;
|
|
|
|
@@ -181,7 +181,7 @@ public final class NaturalSpawner {
|
|
}
|
|
}
|
|
|
|
- world.timings.mobSpawn.stopTiming(); // Spigot
|
|
+ //world.timings.mobSpawn.stopTiming(); // Spigot // Purpur
|
|
world.getProfiler().pop();
|
|
}
|
|
|
|
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
|
|
--- 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
|
|
|
|
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 // Purpur
|
|
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 {
|
|
}
|
|
}
|
|
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
|
- } // Paper
|
|
+ //} // Paper // Purpur
|
|
}
|
|
}
|
|
}
|
|
@@ -1161,7 +1161,7 @@ public class LevelChunk extends ChunkAccess {
|
|
ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler();
|
|
|
|
gameprofilerfiller.push(this::getType);
|
|
- this.blockEntity.tickTimer.startTiming(); // Spigot
|
|
+ //this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur
|
|
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
|
|
|
if (this.blockEntity.getType().isValid(iblockdata)) {
|
|
@@ -1188,7 +1188,7 @@ public class LevelChunk extends ChunkAccess {
|
|
// Paper end - Prevent block entity and entity crashes
|
|
// Spigot start
|
|
} finally {
|
|
- this.blockEntity.tickTimer.stopTiming();
|
|
+ //this.blockEntity.tickTimer.stopTiming(); // Purpur
|
|
// Spigot end
|
|
}
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
index c1e2d3a75b9d4710ab6d8b5c62af4bc136a2b668..ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
@@ -515,10 +515,10 @@ public class CraftScheduler implements BukkitScheduler {
|
|
this.runners.remove(task.getTaskId());
|
|
}
|
|
}
|
|
- MinecraftTimings.bukkitSchedulerFinishTimer.startTiming(); // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerFinishTimer.startTiming(); // Paper // Purpur
|
|
this.pending.addAll(temp);
|
|
temp.clear();
|
|
- MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper // Purpur
|
|
//this.debugHead = this.debugHead.getNextHead(currentTick); // Paper
|
|
}
|
|
|
|
@@ -561,7 +561,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
}
|
|
|
|
void parsePending() { // Paper
|
|
- if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.startTiming(); // Paper
|
|
+ //if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.startTiming(); // Paper // Purpur
|
|
CraftTask head = this.head;
|
|
CraftTask task = head.getNext();
|
|
CraftTask lastTask = head;
|
|
@@ -580,7 +580,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
task.setNext(null);
|
|
}
|
|
this.head = lastTask;
|
|
- if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.stopTiming(); // Paper
|
|
+ //if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.stopTiming(); // Paper // Purpur
|
|
}
|
|
|
|
private boolean isReady(final int currentTick) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
index ea26d9464644b5217879b8c21b4da28e57708dcb..5835dc236b3f5291a804f7fb14a12eb466d4e0ba 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
@@ -96,13 +96,13 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
|
|
|
@Override
|
|
public void run() {
|
|
- try (Timing ignored = timings.startTiming()) { // Paper
|
|
+ //try (Timing ignored = timings.startTiming()) { // Paper // Purpur
|
|
if (this.rTask != null) {
|
|
this.rTask.run();
|
|
} else {
|
|
this.cTask.accept(this);
|
|
}
|
|
- } // Paper
|
|
+ //} // Paper // Purpur
|
|
}
|
|
|
|
long getCreatedAt() {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
|
index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..d3ec817e95628f1fc8be4a29c9a0f13c7d5fd552 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
|
@@ -115,7 +115,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
|
public void forAllObjectives(ObjectiveCriteria criteria, ScoreHolder holder, Consumer<ScoreAccess> consumer) {
|
|
// Paper start - add timings for scoreboard search
|
|
// plugins leaking scoreboards will make this very expensive, let server owners debug it easily
|
|
- co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.startTimingIfSync();
|
|
+ //co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.startTimingIfSync(); // Purpur
|
|
try {
|
|
// Paper end - add timings for scoreboard search
|
|
for (CraftScoreboard scoreboard : this.scoreboards) {
|
|
@@ -123,7 +123,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
|
board.forAllObjectives(criteria, holder, (score) -> consumer.accept(score));
|
|
}
|
|
} finally { // Paper start - add timings for scoreboard search
|
|
- co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.stopTimingIfSync();
|
|
+ //co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.stopTimingIfSync(); // Purpur
|
|
}
|
|
// 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
|
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
@@ -167,7 +167,7 @@ public class ActivationRange
|
|
*/
|
|
public static void activateEntities(Level world)
|
|
{
|
|
- MinecraftTimings.entityActivationCheckTimer.startTiming();
|
|
+ //MinecraftTimings.entityActivationCheckTimer.startTiming(); // Purpur
|
|
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
|
|
}
|
|
// Paper end
|
|
}
|
|
- MinecraftTimings.entityActivationCheckTimer.stopTiming();
|
|
+ //MinecraftTimings.entityActivationCheckTimer.stopTiming(); // Purpur
|
|
}
|
|
|
|
/**
|