Files
Purpur/patches/server/0252-Remove-Mojang-Profiler.patch
granny 02e4e76a1d Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@2b5dc6d Update to 1.21.1
PaperMC/Paper@ad1a5e1 Fix registry crash
PaperMC/Paper@d5052b1 Disable updating mode
PaperMC/Paper@958666a diff cleanup
2024-08-08 21:24:09 -07:00

1985 lines
102 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Sat, 16 Jul 2022 21:37:10 -0500
Subject: [PATCH] Remove Mojang Profiler
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index a66e2d78722847dec4e9d4aba8e6968ef009fcf4..24cb04cd33cfe578286c85a892b20bbf3fc843e6 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -165,7 +165,7 @@ public class Commands {
DamageCommand.register(this.dispatcher, commandRegistryAccess);
DataCommands.register(this.dispatcher);
DataPackCommand.register(this.dispatcher);
- DebugCommand.register(this.dispatcher);
+ //DebugCommand.register(this.dispatcher); // Purpur
DefaultGameModeCommands.register(this.dispatcher);
DifficultyCommand.register(this.dispatcher);
EffectCommands.register(this.dispatcher, commandRegistryAccess);
@@ -346,9 +346,9 @@ public class Commands {
// Paper end
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource();
- commandlistenerwrapper.getServer().getProfiler().push(() -> {
+ /*commandlistenerwrapper.getServer().getProfiler().push(() -> { // Purpur
return "/" + s;
- });
+ });*/ // Purpur
ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - Add UnknownCommandEvent
try {
@@ -378,7 +378,7 @@ public class Commands {
Commands.LOGGER.error("'/{}' threw an exception", s, exception);
}
} finally {
- commandlistenerwrapper.getServer().getProfiler().pop();
+ //commandlistenerwrapper.getServer().getProfiler().pop(); // Purpur
}
}
diff --git a/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java b/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java
index 9f5c3ec2eae9b30bdb8dbcb328d7f701cb7aeb9d..e7cc8105fff9cb952eabfd006e0a4e4638091019 100644
--- a/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java
+++ b/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java
@@ -42,7 +42,7 @@ public class BuildContexts<T extends ExecutionCommandSource<T>> {
ChainModifiers chainModifiers = flags;
List<T> list = sources;
if (contextChain.getStage() != Stage.EXECUTE) {
- context.profiler().push(() -> "prepare " + this.commandInput);
+ //context.profiler().push(() -> "prepare " + this.commandInput); // Purpur
try {
for (int i = context.forkLimit(); contextChain.getStage() != Stage.EXECUTE; contextChain = contextChain.nextStage()) {
@@ -86,7 +86,7 @@ public class BuildContexts<T extends ExecutionCommandSource<T>> {
}
}
} finally {
- context.profiler().pop();
+ //context.profiler().pop(); // Purpur
}
}
diff --git a/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java b/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java
index e9775b4506909bee65a74964f0d5391a0513de1d..684f7f202305c09b1037c5d38a52a5ea7f00751b 100644
--- a/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java
+++ b/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java
@@ -23,7 +23,7 @@ public class ExecuteCommand<T extends ExecutionCommandSource<T>> implements Unbo
@Override
public void execute(T executionCommandSource, ExecutionContext<T> executionContext, Frame frame) {
- executionContext.profiler().push(() -> "execute " + this.commandInput);
+ //executionContext.profiler().push(() -> "execute " + this.commandInput); // Purpur
try {
executionContext.incrementCost();
@@ -37,7 +37,7 @@ public class ExecuteCommand<T extends ExecutionCommandSource<T>> implements Unbo
} catch (CommandSyntaxException var9) {
executionCommandSource.handleError(var9, this.modifiers.isForked(), executionContext.tracer());
} finally {
- executionContext.profiler().pop();
+ //executionContext.profiler().pop(); // Purpur
}
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 771c81e505974d8e3a21886eb0f0b07c87601bb0..cdb5b001ec3104a04da9a160c6c4db532c3508e1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -422,13 +422,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server");
SERVER = this; // Paper - better singleton
- this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
- this.profiler = this.metricsRecorder.getProfiler();
- this.onMetricsRecordingStopped = (methodprofilerresults) -> {
+ //this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; // Purpur
+ //this.profiler = this.metricsRecorder.getProfiler(); // Purpur
+ /*this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur
this.stopRecordingMetrics();
- };
- this.onMetricsRecordingFinished = (path) -> {
- };
+ };*/ // Purpur
+ //this.onMetricsRecordingFinished = (path) -> { // Purpur
+ //}; // Purpur
this.random = RandomSource.create();
this.port = -1;
this.levels = Maps.newLinkedHashMap();
@@ -1036,9 +1036,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.spigotmc.WatchdogThread.doStop(); // Paper
// Paper end
// CraftBukkit end
- if (this.metricsRecorder.isRecording()) {
+ /*if (this.metricsRecorder.isRecording()) { // Purpur
this.cancelRecordingMetrics();
- }
+ }*/ // Purpur
MinecraftServer.LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -1311,16 +1311,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
boolean flag = i == 0L;
- if (this.debugCommandProfilerDelayStart) {
+ /*if (this.debugCommandProfilerDelayStart) { // Purpur
this.debugCommandProfilerDelayStart = false;
this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
- }
+ }*/ // Purpur
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
lastTick = currentTime;
this.nextTickTimeNanos += i;
- this.startMetricsRecordingTick();
- this.profiler.push("tick");
+ //this.startMetricsRecordingTick(); // Purpur
+ //this.profiler.push("tick"); // Purpur
this.tickServer(flag ? () -> {
return false;
} : this::haveTime);
@@ -1331,7 +1331,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new RuntimeException("Chunk system crash propagated to tick()", crash);
}
// Paper end - rewrite chunk system
- this.profiler.popPush("nextTickWait");
+ //this.profiler.popPush("nextTickWait"); // Purpur
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
// Purpur start
@@ -1347,9 +1347,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickRateManager.endTickWork();
}
- this.profiler.pop();
- this.logFullTickTime();
- this.endMetricsRecordingTick();
+ //this.profiler.pop();// Purpur
+ //this.logFullTickTime(); // Purpur
+ //this.endMetricsRecordingTick(); // Purpur
this.isReady = true;
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
}
@@ -1559,7 +1559,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
- this.getProfiler().incrementCounter("runTask");
+ //this.getProfiler().incrementCounter("runTask"); // Purpur
super.doRunTask(ticktask);
}
@@ -1633,7 +1633,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (playerSaveInterval < 0) {
playerSaveInterval = autosavePeriod;
}
- this.profiler.push("save");
+ //this.profiler.push("save"); // Purpur
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
try {
this.isSaving = true;
@@ -1648,7 +1648,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} finally {
this.isSaving = false;
}
- this.profiler.pop();
+ //this.profiler.pop(); // Purpur
// Paper end - Incremental chunk and player saving
// Paper start - move executeAll() into full server tick timing
//try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { // Purpur
@@ -1661,7 +1661,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
this.server.spark.tickEnd(((double)(endTime - lastTick) / 1000000D)); // Paper - spark
// Paper end - Server Tick Events
- this.profiler.push("tallying");
+ //this.profiler.push("tallying"); // Purpur
long j = Util.getNanos() - i;
int k = this.tickCount % 100;
@@ -1675,7 +1675,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickTimes60s.add(this.tickCount, j);
// Paper end - Add tick times API and /mspt command
this.logTickMethodTime(i);
- this.profiler.pop();
+ //this.profiler.pop(); // Purpur
org.spigotmc.WatchdogThread.tick(); // Spigot
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
}
@@ -1766,11 +1766,11 @@ 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");
+ //this.profiler.push("commandFunctions"); // Purpur
//MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper // Purpur
this.getFunctions().tick();
//MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper // Purpur
- this.profiler.popPush("levels");
+ //this.profiler.popPush("levels"); // Purpur
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
// CraftBukkit start
@@ -1813,20 +1813,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.updateLagCompensationTick(); // Paper - lag compensation
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
- this.profiler.push(() -> {
+ /*this.profiler.push(() -> { // Purpur
String s = String.valueOf(worldserver);
return s + " " + String.valueOf(worldserver.dimension().location());
- });
+ });*/ // Purpur
/* Drop global time updates
if (this.tickCount % 20 == 0) {
- this.profiler.push("timeSync");
+ //this.profiler.push("timeSync"); // Purpur
this.synchronizeTime(worldserver);
- this.profiler.pop();
+ //this.profiler.pop(); // Purpur
}
// CraftBukkit end */
- this.profiler.push("tick");
+ //this.profiler.push("tick"); // Purpur
try {
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
@@ -1839,17 +1839,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new ReportedException(crashreport);
}
- this.profiler.pop();
- this.profiler.pop();
+ //this.profiler.pop(); // Purpur
+ //this.profiler.pop(); // Purpur
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
- this.profiler.popPush("connection");
+ //this.profiler.popPush("connection"); // Purpur
// MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper // Purpur
this.getConnection().tick();
// MinecraftTimings.connectionTimer.stopTiming(); // Spigot // Paper // Purpur
- this.profiler.popPush("players");
+ //this.profiler.popPush("players"); // Purpur
//MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
this.playerList.tick();
//MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -1857,7 +1857,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
- this.profiler.popPush("server gui refresh");
+ //this.profiler.popPush("server gui refresh"); // Purpur
//MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
for (int i = 0; i < this.tickables.size(); ++i) {
@@ -1865,7 +1865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
//MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
- this.profiler.popPush("send chunks");
+ //this.profiler.popPush("send chunks"); // Purpur
iterator = this.playerList.getPlayers().iterator();
while (iterator.hasNext()) {
@@ -1875,7 +1875,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.resumeFlushing();
}
- this.profiler.pop();
+ //this.profiler.pop(); // Purpur
}
private void synchronizeTime(ServerLevel world) {
@@ -1883,7 +1883,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void forceTimeSynchronization() {
- this.profiler.push("timeSync");
+ //this.profiler.push("timeSync"); // Purpur
Iterator iterator = this.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1892,7 +1892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.synchronizeTime(worldserver);
}
- this.profiler.pop();
+ //this.profiler.pop(); // Purpur
}
public boolean isLevelEnabled(Level world) {
@@ -2604,6 +2604,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
+ //if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur // Purpur - TODO: Pufferfish
return this.profiler;
}
@@ -2850,7 +2851,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end
private void startMetricsRecordingTick() {
- if (this.willStartRecordingMetrics) {
+ if (false && this.willStartRecordingMetrics) { // Purpur
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
this.executeBlocking(() -> {
this.saveDebugReport(path.resolve("server"));
@@ -2860,40 +2861,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.willStartRecordingMetrics = false;
}
- this.profiler = SingleTickProfiler.decorateFiller(this.metricsRecorder.getProfiler(), SingleTickProfiler.createTickProfiler("Server"));
- this.metricsRecorder.startTick();
- this.profiler.startTick();
+ //this.profiler = SingleTickProfiler.decorateFiller(this.metricsRecorder.getProfiler(), SingleTickProfiler.createTickProfiler("Server")); // Purpur
+ //this.metricsRecorder.startTick(); // Purpur
+ //this.profiler.startTick(); // Purpur
}
public void endMetricsRecordingTick() {
- this.profiler.endTick();
- this.metricsRecorder.endTick();
+ //this.profiler.endTick(); // Purpur
+ //this.metricsRecorder.endTick(); // Purpur
}
public boolean isRecordingMetrics() {
- return this.metricsRecorder.isRecording();
+ return false; //this.metricsRecorder.isRecording(); // Purpur
}
public void startRecordingMetrics(Consumer<ProfileResults> resultConsumer, Consumer<Path> dumpConsumer) {
- this.onMetricsRecordingStopped = (methodprofilerresults) -> {
+ /*this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur
this.stopRecordingMetrics();
resultConsumer.accept(methodprofilerresults);
};
this.onMetricsRecordingFinished = dumpConsumer;
- this.willStartRecordingMetrics = true;
+ this.willStartRecordingMetrics = true;*/ // Purpur
}
public void stopRecordingMetrics() {
- this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
+ //this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; // Purpur
}
public void finishRecordingMetrics() {
- this.metricsRecorder.end();
+ //this.metricsRecorder.end(); // Purpur
}
public void cancelRecordingMetrics() {
- this.metricsRecorder.cancel();
- this.profiler = this.metricsRecorder.getProfiler();
+ //this.metricsRecorder.cancel(); // Purpur
+ //this.profiler = this.metricsRecorder.getProfiler(); // Purpur
}
public Path getWorldPath(LevelResource worldSavePath) {
@@ -2946,15 +2947,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public boolean isTimeProfilerRunning() {
- return this.debugCommandProfilerDelayStart || this.debugCommandProfiler != null;
+ return false; //this.debugCommandProfilerDelayStart || this.debugCommandProfiler != null; // Purpur
}
public void startTimeProfiler() {
- this.debugCommandProfilerDelayStart = true;
+ //this.debugCommandProfilerDelayStart = true; // Purpur
}
public ProfileResults stopTimeProfiler() {
- if (this.debugCommandProfiler == null) {
+ if (true || this.debugCommandProfiler == null) { // Purpur
return EmptyProfileResults.EMPTY;
} else {
ProfileResults methodprofilerresults = this.debugCommandProfiler.stop(Util.getNanos(), this.tickCount);
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
index 9cd4f7c6910727c849ac7f5d675dc6105c4bbba2..4e4b7f2a6d7ed92a2ce06e566186027cd9077fc8 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
@@ -53,10 +53,10 @@ public class ServerFunctionManager {
}
private void executeTagFunctions(Collection<CommandFunction<CommandSourceStack>> functions, ResourceLocation label) {
- ProfilerFiller gameprofilerfiller = this.server.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.server.getProfiler(); // Purpur
Objects.requireNonNull(label);
- gameprofilerfiller.push(label::toString);
+ //gameprofilerfiller.push(label::toString); // Purpur
Iterator iterator = functions.iterator();
while (iterator.hasNext()) {
@@ -65,15 +65,15 @@ public class ServerFunctionManager {
this.execute(commandfunction, this.getGameLoopSender());
}
- this.server.getProfiler().pop();
+ //this.server.getProfiler().pop(); // Purpur
}
public void execute(CommandFunction<CommandSourceStack> function, CommandSourceStack source) {
- ProfilerFiller gameprofilerfiller = this.server.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.server.getProfiler(); // Purpur
- gameprofilerfiller.push(() -> {
+ /*gameprofilerfiller.push(() -> { // Purpur
return "function " + String.valueOf(function.id());
- });
+ });*/ // Purpur
try {
InstantiatedFunction<CommandSourceStack> instantiatedfunction = function.instantiate((CompoundTag) null, this.getDispatcher());
@@ -86,7 +86,7 @@ public class ServerFunctionManager {
} catch (Exception exception) {
ServerFunctionManager.LOGGER.warn("Failed to execute function {}", function.id(), exception);
} finally {
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 1249b81a603c09934fe8f1c91a16694ca1d787ed..30137c5d6a5416e9ccd95934d162ebc72516f37d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -392,16 +392,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected void tick(BooleanSupplier shouldKeepTicking) {
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur
- gameprofilerfiller.push("poi");
+ //gameprofilerfiller.push("poi"); // Purpur
this.poiManager.tick(shouldKeepTicking);
- gameprofilerfiller.popPush("chunk_unload");
+ //gameprofilerfiller.popPush("chunk_unload"); // Purpur
if (!this.level.noSave()) {
this.processUnloads(shouldKeepTicking);
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
public boolean hasWork() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 4aa9fbdf1eda91a5c54ff53709d94f30e9b2e62b..548549817ab5a835c1ea66676bc75fa53f7efd45 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -382,25 +382,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
public void purgeUnload() {
if (true) return; // Paper - rewrite chunk system
this.level.getProfiler().push("purge");
+ //this.level.getProfiler().push("purge"); // Purpur
this.distanceManager.purgeStaleTickets();
this.runDistanceManagerUpdates();
- this.level.getProfiler().popPush("unload");
+ //this.level.getProfiler().popPush("unload"); // Purpur
this.chunkMap.tick(() -> true);
- this.level.getProfiler().pop();
+ //this.level.getProfiler().pop(); // Purpur
this.clearCache();
}
// CraftBukkit end
@Override
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
- this.level.getProfiler().push("purge");
+ //this.level.getProfiler().push("purge"); // Purpur
//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 // Purpur
- this.level.getProfiler().popPush("chunks");
+ //this.level.getProfiler().popPush("chunks"); // Purpur
if (tickChunks) {
//this.level.timings.chunks.startTiming(); // Paper - timings // Purpur
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system
@@ -410,10 +411,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
//this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur
- this.level.getProfiler().popPush("unload");
+ //this.level.getProfiler().popPush("unload"); // Purpur
this.chunkMap.tick(shouldKeepTicking);
//this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur
- this.level.getProfiler().pop();
+ //this.level.getProfiler().pop(); // Purpur
this.clearCache();
}
@@ -424,10 +425,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
this.lastInhabitedUpdate = i;
if (!this.level.isDebug()) {
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur
- gameprofilerfiller.push("pollingChunks");
- gameprofilerfiller.push("filteringLoadedChunks");
+ //gameprofilerfiller.push("pollingChunks"); // Purpur
+ //gameprofilerfiller.push("filteringLoadedChunks"); // Purpur
// Paper start - chunk tick iteration optimisations
List<ServerChunkCache.ChunkAndHolder> list;
{
@@ -453,7 +454,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
// Paper - chunk tick iteration optimisations
if (this.level.tickRateManager().runsNormally()) {
- gameprofilerfiller.popPush("naturalSpawnCount");
+ //gameprofilerfiller.popPush("naturalSpawnCount"); // Purpur
//this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
int k = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - Optional per player mob spawns
@@ -482,7 +483,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
// this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
this.lastSpawnState = spawnercreature_d;
- gameprofilerfiller.popPush("spawnAndTick");
+ //gameprofilerfiller.popPush("spawnAndTick"); // Purpur
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.level.random); // Paper - per player mob spawns - do not need this when per-player is enabled
@@ -522,7 +523,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
//this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
- gameprofilerfiller.popPush("customSpawners");
+ //gameprofilerfiller.popPush("customSpawners"); // Purpur
if (flag) {
//try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
@@ -530,7 +531,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
}
- gameprofilerfiller.popPush("broadcast");
+ //gameprofilerfiller.popPush("broadcast"); // Purpur
// Paper start - chunk tick iteration optimisations
//this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur
{
@@ -548,8 +549,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
//this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur
// Paper end - chunk tick iteration optimisations
- gameprofilerfiller.pop();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.pop(); // Purpur
}
}
@@ -730,7 +731,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@Override
protected void doRunTask(Runnable task) {
- ServerChunkCache.this.level.getProfiler().incrementCounter("runTask");
+ //ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); // Purpur
super.doRunTask(task);
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index dc7db7a2c8b42f7ed2b7b28fe2ed6224be8da2fe..2c15fc6e4f46c5873cc5ce67edf10b730a4e922e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -645,16 +645,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
public void tick(BooleanSupplier shouldKeepTicking) {
- ProfilerFiller gameprofilerfiller = this.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur
this.handlingTick = true;
TickRateManager tickratemanager = this.tickRateManager();
boolean flag = tickratemanager.runsNormally();
if (flag) {
- gameprofilerfiller.push("world border");
+ //gameprofilerfiller.push("world border"); // Purpur
this.getWorldBorder().tick();
- gameprofilerfiller.popPush("weather");
+ //gameprofilerfiller.popPush("weather"); // Purpur
this.advanceWeatherCycle();
}
@@ -686,30 +686,30 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickTime();
}
- gameprofilerfiller.popPush("tickPending");
+ //gameprofilerfiller.popPush("tickPending"); // Purpur
//this.timings.scheduledBlocks.startTiming(); // Paper // Purpur
if (!this.isDebug() && flag) {
j = this.getGameTime();
- gameprofilerfiller.push("blockTicks");
+ //gameprofilerfiller.push("blockTicks"); // Purpur
this.blockTicks.tick(j, paperConfig().environment.maxBlockTicks, this::tickBlock); // Paper - configurable max block ticks
- gameprofilerfiller.popPush("fluidTicks");
+ //gameprofilerfiller.popPush("fluidTicks"); // Purpur
this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
//this.timings.scheduledBlocks.stopTiming(); // Paper // Purpur
- gameprofilerfiller.popPush("raid");
+ //gameprofilerfiller.popPush("raid"); // Purpur
if (flag) {
// this.timings.raids.startTiming(); // Paper - timings // Purpur
this.raids.tick();
// this.timings.raids.stopTiming(); // Paper - timings // Purpur
}
- gameprofilerfiller.popPush("chunkSource");
+ //gameprofilerfiller.popPush("chunkSource"); // Purpur
//this.timings.chunkProviderTick.startTiming(); // Paper - timings // Purpur
this.getChunkSource().tick(shouldKeepTicking, true);
//this.timings.chunkProviderTick.stopTiming(); // Paper - timings // Purpur
- gameprofilerfiller.popPush("blockEvents");
+ //gameprofilerfiller.popPush("blockEvents"); // Purpur
if (flag) {
// this.timings.doSounds.startTiming(); // Spigot // Purpur
this.runBlockEvents();
@@ -717,7 +717,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
this.handlingTick = false;
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
boolean flag1 = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this
if (flag1) {
@@ -725,12 +725,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
if (flag1 || this.emptyTime++ < 300) {
- gameprofilerfiller.push("entities");
+ //gameprofilerfiller.push("entities"); // Purpur
//this.timings.tickEntities.startTiming(); // Spigot // Purpur
if (this.dragonFight != null && flag) {
- gameprofilerfiller.push("dragonFight");
+ //gameprofilerfiller.push("dragonFight"); // Purpur
this.dragonFight.tick();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
@@ -740,9 +740,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
} else if (!tickratemanager.isEntityFrozen(entity)) {
- gameprofilerfiller.push("checkDespawn");
+ //gameprofilerfiller.push("checkDespawn"); // Purpur
entity.checkDespawn();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - rewrite chunk system
Entity entity1 = entity.getVehicle();
@@ -754,22 +754,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
entity.stopRiding();
}
- gameprofilerfiller.push("tick");
+ //gameprofilerfiller.push("tick"); // Purpur
this.guardEntityTick(this::tickNonPassenger, entity);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
}
}
});
//this.timings.entityTick.stopTiming(); // Spigot // Purpur
//this.timings.tickEntities.stopTiming(); // Spigot // Purpur
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
this.tickBlockEntities();
}
- gameprofilerfiller.push("entityManagement");
+ //gameprofilerfiller.push("entityManagement"); // Purpur
// Paper - rewrite chunk system
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
@Override
@@ -902,9 +902,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
boolean flag = this.isRaining();
int j = chunkcoordintpair.getMinBlockX();
int k = chunkcoordintpair.getMinBlockZ();
- ProfilerFiller gameprofilerfiller = this.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur
- gameprofilerfiller.push("thunder");
+ //gameprofilerfiller.push("thunder"); // Purpur
if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder
BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
@@ -941,7 +941,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
}
- gameprofilerfiller.popPush("iceandsnow");
+ //gameprofilerfiller.popPush("iceandsnow"); // Purpur
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
for (int l = 0; l < randomTickSpeed; ++l) {
@@ -951,14 +951,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
} // Paper - Option to disable ice and snow
- gameprofilerfiller.popPush("tickBlocks");
+ //gameprofilerfiller.popPush("tickBlocks"); // Purpur
//timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
if (randomTickSpeed > 0) {
this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking
}
//timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
@VisibleForTesting
@@ -1304,19 +1304,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
//try { // Purpur
// Paper end - timings
entity.setOldPosAndRot();
- ProfilerFiller gameprofilerfiller = this.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur
++entity.tickCount;
- this.getProfiler().push(() -> {
+ /*this.getProfiler().push(() -> { // Purpur
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
- });
- gameprofilerfiller.incrementCounter("tickNonPassenger");
+ });*/ // Purpur
+ //gameprofilerfiller.incrementCounter("tickNonPassenger"); // Purpur
if (isActive) { // Paper - EAR 2
TimingHistory.activatedEntityTicks++;
entity.tick();
entity.postTick(); // CraftBukkit
} else { entity.inactiveTick(); } // Paper - EAR 2
- this.getProfiler().pop();
+ //this.getProfiler().pop(); // Purpur
//} finally { timer.stopTiming(); } // Paper - timings // Purpur
Iterator iterator = entity.getPassengers().iterator();
@@ -1345,12 +1345,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
- ProfilerFiller gameprofilerfiller = this.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur
- gameprofilerfiller.push(() -> {
+ /*gameprofilerfiller.push(() -> { // Purpur
return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString();
- });
- gameprofilerfiller.incrementCounter("tickPassenger");
+ });*/ // Purpur
+ //gameprofilerfiller.incrementCounter("tickPassenger"); // Purpur
// Paper start - EAR 2
if (isActive) {
passenger.rideTick();
@@ -1362,7 +1362,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
vehicle.positionRider(passenger);
}
// Paper end - EAR 2
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
Iterator iterator = passenger.getPassengers().iterator();
while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 3814486fe7cf7fb3c743345f6800e4b463aefe04..4c51f93c3d28ede9a8b811f88159cc19aaabc8b1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1399,7 +1399,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
this.unsetRemoved();
*/
// CraftBukkit end
- worldserver1.getProfiler().push("moving");
+ //worldserver1.getProfiler().push("moving"); // Purpur
if (worldserver != null && resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit - empty to fall through to null to event
this.enteredNetherPosition = this.position();
}
@@ -1415,8 +1415,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
worldserver = ((CraftWorld) exit.getWorld()).getHandle();
// CraftBukkit end
- worldserver1.getProfiler().pop();
- worldserver1.getProfiler().push("placing");
+ //worldserver1.getProfiler().pop(); // Purpur
+ //worldserver1.getProfiler().push("placing"); // Purpur
// CraftBukkit start
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
LevelData worlddata = worldserver.getLevelData();
@@ -1434,7 +1434,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
worldserver.addDuringTeleport(this);
- worldserver1.getProfiler().pop();
+ //worldserver1.getProfiler().pop(); // Purpur
this.triggerDimensionChangeTriggers(worldserver1);
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
playerlist.sendLevelInfo(this, worldserver);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index e7075e0c59fe99229142ecb518fadc5b481886fb..fac2fb82c381d245f77b7288c34920660ac2c3af 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -266,7 +266,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
protected void keepConnectionAlive() {
- this.server.getProfiler().push("keepAlive");
+ //this.server.getProfiler().push("keepAlive"); // Purpur
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
long currentTime = Util.getMillis();
@@ -299,7 +299,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
// Paper end - give clients a longer time to respond to pings as per pre 1.12.2 timings
- this.server.getProfiler().pop();
+ //this.server.getProfiler().pop(); // Purpur
}
private boolean checkIfClosed(long time) {
diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
index f14113eef226e906c0d21641e74a27471254909d..0c25f3ed0a8a538edc7cadd3476100c9b3631f7a 100644
--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
@@ -16,11 +16,11 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener
Executor applyExecutor
) {
return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> {
- applyProfiler.startTick();
- applyProfiler.push("listener");
+ //applyProfiler.startTick(); // Purpur
+ //applyProfiler.push("listener"); // Purpur
this.onResourceManagerReload(manager);
- applyProfiler.pop();
- applyProfiler.endTick();
+ //applyProfiler.pop(); // Purpur
+ //applyProfiler.endTick(); // Purpur
}, applyExecutor);
}
diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
index bce2dac613d29083dd5fbb68739304cc5a6d4d27..600a7036b503f60cc9c95f189f73c2dbf020e2e1 100644
--- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
+++ b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
@@ -55,7 +55,7 @@ public class ActiveProfiler implements ProfileCollector {
this.started = true;
this.path = "";
this.paths.clear();
- this.push("root");
+ //this.push("root"); // Purpur
}
}
@@ -64,7 +64,7 @@ public class ActiveProfiler implements ProfileCollector {
if (!this.started) {
LOGGER.error("Profiler tick already ended - missing startTick()?");
} else {
- this.pop();
+ //this.pop(); // Purpur
this.started = false;
if (!this.path.isEmpty()) {
LOGGER.error(
@@ -93,7 +93,7 @@ public class ActiveProfiler implements ProfileCollector {
@Override
public void push(Supplier<String> locationGetter) {
- this.push(locationGetter.get());
+ //this.push(locationGetter.get()); // Purpur
}
@Override
@@ -132,14 +132,14 @@ public class ActiveProfiler implements ProfileCollector {
@Override
public void popPush(String location) {
- this.pop();
- this.push(location);
+ //this.pop(); // Purpur
+ //this.push(location); // Purpur
}
@Override
public void popPush(Supplier<String> locationGetter) {
- this.pop();
- this.push(locationGetter);
+ //this.pop(); // Purpur
+ //this.push(locationGetter); // Purpur
}
private ActiveProfiler.PathEntry getCurrentEntry() {
diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
index a715ecf4a8ac91d3e5e5c6269d89e54b2c1cd279..223c3665126c576eddb1a8f7c9f5bc60c6ff9818 100644
--- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
+++ b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
@@ -6,32 +6,44 @@ import net.minecraft.util.profiling.metrics.MetricCategory;
public interface ProfilerFiller {
String ROOT = "root";
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void startTick();
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void endTick();
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void push(String location);
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void push(Supplier<String> locationGetter);
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void pop();
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void popPush(String location);
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void popPush(Supplier<String> locationGetter);
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void markForCharting(MetricCategory type);
+ @io.papermc.paper.annotation.DoNotUse // Purpur
default void incrementCounter(String marker) {
- this.incrementCounter(marker, 1);
+ //this.incrementCounter(marker, 1); // Purpur
}
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void incrementCounter(String marker, int num);
+ @io.papermc.paper.annotation.DoNotUse // Purpur
default void incrementCounter(Supplier<String> markerGetter) {
- this.incrementCounter(markerGetter, 1);
+ //this.incrementCounter(markerGetter, 1); // Purpur
}
+ @io.papermc.paper.annotation.DoNotUse // Purpur
void incrementCounter(Supplier<String> markerGetter, int num);
static ProfilerFiller tee(ProfilerFiller a, ProfilerFiller b) {
@@ -41,62 +53,62 @@ public interface ProfilerFiller {
return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() {
@Override
public void startTick() {
- a.startTick();
- b.startTick();
+ //a.startTick(); // Purpur
+ //b.startTick(); // Purpur
}
@Override
public void endTick() {
- a.endTick();
- b.endTick();
+ //a.endTick(); // Purpur
+ //b.endTick(); // Purpur
}
@Override
public void push(String location) {
- a.push(location);
- b.push(location);
+ //a.push(location); // Purpur
+ //b.push(location); // Purpur
}
@Override
public void push(Supplier<String> locationGetter) {
- a.push(locationGetter);
- b.push(locationGetter);
+ //a.push(locationGetter); // Purpur
+ //b.push(locationGetter); // Purpur
}
@Override
public void markForCharting(MetricCategory type) {
- a.markForCharting(type);
- b.markForCharting(type);
+ //a.markForCharting(type); // Purpur
+ //b.markForCharting(type); // Purpur
}
@Override
public void pop() {
- a.pop();
- b.pop();
+ //a.pop(); // Purpur
+ //b.pop(); // Purpur
}
@Override
public void popPush(String location) {
- a.popPush(location);
- b.popPush(location);
+ //a.popPush(location); // Purpur
+ //b.popPush(location); // Purpur
}
@Override
public void popPush(Supplier<String> locationGetter) {
- a.popPush(locationGetter);
- b.popPush(locationGetter);
+ //a.popPush(locationGetter); // Purpur
+ //b.popPush(locationGetter); // Purpur
}
@Override
public void incrementCounter(String marker, int num) {
- a.incrementCounter(marker, num);
- b.incrementCounter(marker, num);
+ //a.incrementCounter(marker, num); // Purpur
+ //b.incrementCounter(marker, num); // Purpur
}
@Override
public void incrementCounter(Supplier<String> markerGetter, int num) {
- a.incrementCounter(markerGetter, num);
- b.incrementCounter(markerGetter, num);
+ //a.incrementCounter(markerGetter, num); // Purpur
+ //b.incrementCounter(markerGetter, num); // Purpur
}
};
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cf8e00378b0be5e78c6252e1850cb556424003b6..bc9a42b1dba6d089291e1b4d279933b0b47872b1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -880,7 +880,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end
public void baseTick() {
- this.level().getProfiler().push("entityBaseTick");
+ //this.level().getProfiler().push("entityBaseTick"); // Purpur
if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
this.inBlockState = null;
if (this.isPassenger() && this.getVehicle().isRemoved()) {
@@ -945,7 +945,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Leashable.tickLeash((Entity & Leashable) this); // CraftBukkit - decompile error
}
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
}
public void setSharedFlagOnFire(boolean onFire) {
@@ -1158,7 +1158,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- this.level().getProfiler().push("move");
+ //this.level().getProfiler().push("move"); // Purpur
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) {
movement = movement.multiply(this.stuckSpeedMultiplier);
this.stuckSpeedMultiplier = Vec3.ZERO;
@@ -1167,7 +1167,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper start - ignore movement changes while inactive.
if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && movementType == MoverType.SELF) {
setDeltaMovement(Vec3.ZERO);
- this.level.getProfiler().pop();
+ //this.level.getProfiler().pop(); // Purpur
return;
}
// Paper end
@@ -1188,8 +1188,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z);
}
- this.level().getProfiler().pop();
- this.level().getProfiler().push("rest");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("rest"); // Purpur
boolean flag = !Mth.equal(movement.x, vec3d1.x);
boolean flag1 = !Mth.equal(movement.z, vec3d1.z);
@@ -1208,7 +1208,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.checkFallDamage(vec3d1.y, this.onGround(), iblockdata, blockposition);
if (this.isRemoved()) {
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
} else {
if (this.horizontalCollision) {
Vec3 vec3d2 = this.getDeltaMovement();
@@ -1311,7 +1311,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setRemainingFireTicks(-this.getFireImmuneTicks());
}
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
}
}
// Paper start - detailed watchdog information
@@ -3303,7 +3303,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.processPortalCooldown();
if (this.portalProcess != null) {
if (this.portalProcess.processPortalTeleportation(worldserver, this, this.canUsePortal(false))) {
- worldserver.getProfiler().push("portal");
+ //worldserver.getProfiler().push("portal"); // Purpur
this.setPortalCooldown();
DimensionTransition dimensiontransition = this.portalProcess.getPortalDestination(worldserver, this);
@@ -3315,7 +3315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- worldserver.getProfiler().pop();
+ //worldserver.getProfiler().pop(); // Purpur
} else if (this.portalProcess.hasExpired()) {
this.portalProcess = null;
}
@@ -3816,7 +3816,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- worldserver.getProfiler().push("changeDimension");
+ //worldserver.getProfiler().push("changeDimension"); // Purpur
Entity entity2 = worldserver1.dimension() == worldserver.dimension() ? this : this.getType().create(worldserver1);
if (entity2 != null) {
@@ -3852,7 +3852,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
teleportTarget.postDimensionTransition().onTransition(entity2);
}
- worldserver.getProfiler().pop();
+ //worldserver.getProfiler().pop(); // Purpur
return entity2;
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9582498c5cbcc859b942384e8e0e492cb2cdea03..94a1874576ed07bacdd399785666f69d4b4086c8 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -445,7 +445,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
super.baseTick();
- this.level().getProfiler().push("livingEntityBaseTick");
+ //this.level().getProfiler().push("livingEntityBaseTick"); // Purpur
if (this.fireImmune() || this.level().isClientSide) {
this.clearFire();
}
@@ -551,7 +551,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.yHeadRotO = this.yHeadRot;
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
}
@Override
@@ -3272,10 +3272,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.run += (f3 - this.run) * 0.3F;
- this.level().getProfiler().push("headTurn");
+ //this.level().getProfiler().push("headTurn"); // Purpur
f2 = this.tickHeadTurn(f1, f2);
- this.level().getProfiler().pop();
- this.level().getProfiler().push("rangeChecks");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("rangeChecks"); // Purpur
// Paper start - stop large pitch and yaw changes from crashing the server
this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F;
@@ -3287,7 +3287,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F;
// Paper end
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
this.animStep += f2;
if (this.isFallFlying()) {
++this.fallFlyTicks;
@@ -3527,19 +3527,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.setDeltaMovement(d0, d1, d2);
- this.level().getProfiler().push("ai");
+ //this.level().getProfiler().push("ai"); // Purpur
if (this.isImmobile()) {
this.jumping = false;
this.xxa = 0.0F;
this.zza = 0.0F;
} else if (this.isEffectiveAi()) {
- this.level().getProfiler().push("newAi");
+ //this.level().getProfiler().push("newAi"); // Purpur
this.serverAiStep();
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
}
- this.level().getProfiler().pop();
- this.level().getProfiler().push("jump");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("jump"); // Purpur
if (this.jumping && this.isAffectedByFluids()) {
double d3;
@@ -3566,8 +3566,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.noJumpDelay = 0;
}
- this.level().getProfiler().pop();
- this.level().getProfiler().push("travel");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("travel"); // Purpur
this.xxa *= 0.98F;
this.zza *= 0.98F;
this.updateFallFlying();
@@ -3592,8 +3592,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.travel(vec3d1);
}
- this.level().getProfiler().pop();
- this.level().getProfiler().push("freezing");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("freezing"); // Purpur
if (!this.level().isClientSide && !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API
int i = this.getTicksFrozen();
@@ -3610,15 +3610,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.hurt(this.damageSources().freeze(), 1.0F);
}
- this.level().getProfiler().pop();
- this.level().getProfiler().push("push");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("push"); // Purpur
if (this.autoSpinAttackTicks > 0) {
--this.autoSpinAttackTicks;
this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox());
}
this.pushEntities();
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
// Paper start - Add EntityMoveEvent
// Purpur start
if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 2166a9db0fd6c3c3cb3293c99e81b08f733089eb..ce43fadb49122f967891f532e6bfff0be9caf0a6 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -368,13 +368,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void baseTick() {
super.baseTick();
- this.level().getProfiler().push("mobBaseTick");
+ //this.level().getProfiler().push("mobBaseTick"); // Purpur
if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) {
this.resetAmbientSoundTime();
this.playAmbientSound();
}
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
incrementTicksSinceLastInteraction(); // Purpur
}
@@ -704,7 +704,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void aiStep() {
super.aiStep();
- this.level().getProfiler().push("looting");
+ //this.level().getProfiler().push("looting"); // Purpur
if (!this.level().isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) {
Vec3i baseblockposition = this.getPickupReach();
List<ItemEntity> list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ()));
@@ -724,7 +724,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
}
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
}
protected Vec3i getPickupReach() {
@@ -944,44 +944,44 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
return;
}
// Paper end - Allow nerfed mobs to jump and float
- ProfilerFiller gameprofilerfiller = this.level().getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.level().getProfiler(); // Purpur
- gameprofilerfiller.push("sensing");
+ //gameprofilerfiller.push("sensing"); // Purpur
this.sensing.tick();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
int i = this.tickCount + this.getId();
if (i % 2 != 0 && this.tickCount > 1) {
- gameprofilerfiller.push("targetSelector");
+ //gameprofilerfiller.push("targetSelector"); // Purpur
this.targetSelector.tickRunningGoals(false);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("goalSelector");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("goalSelector"); // Purpur
this.goalSelector.tickRunningGoals(false);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
} else {
- gameprofilerfiller.push("targetSelector");
+ //gameprofilerfiller.push("targetSelector"); // Purpur
this.targetSelector.tick();
- gameprofilerfiller.pop();
- gameprofilerfiller.push("goalSelector");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("goalSelector"); // Purpur
this.goalSelector.tick();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
- gameprofilerfiller.push("navigation");
+ //gameprofilerfiller.push("navigation"); // Purpur
this.navigation.tick();
- gameprofilerfiller.pop();
- gameprofilerfiller.push("mob tick");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("mob tick"); // Purpur
this.customServerAiStep();
- gameprofilerfiller.pop();
- gameprofilerfiller.push("controls");
- gameprofilerfiller.push("move");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("controls"); // Purpur
+ //gameprofilerfiller.push("move"); // Purpur
this.moveControl.tick();
- gameprofilerfiller.popPush("look");
+ //gameprofilerfiller.popPush("look"); // Purpur
this.lookControl.tick();
- gameprofilerfiller.popPush("jump");
+ //gameprofilerfiller.popPush("jump"); // Purpur
this.jumpControl.tick();
- gameprofilerfiller.pop();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.pop(); // Purpur
this.sendDebugPackets();
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index 9bdbf3e9453bc3ce96d52d04b8cde0d05f7356d8..ff8fc5f0202b6176afef51e5b591fa6b7e4faee5 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -87,8 +87,8 @@ public class GoalSelector {
}
public void tick() {
- ProfilerFiller profilerFiller = this.profiler.get();
- profilerFiller.push("goalCleanup");
+ //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur
+ //profilerFiller.push("goalCleanup"); // Purpur
for (WrappedGoal wrappedGoal : this.availableGoals) {
if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams
@@ -97,8 +97,8 @@ public class GoalSelector {
}
this.lockedFlags.entrySet().removeIf(entry -> !entry.getValue().isRunning());
- profilerFiller.pop();
- profilerFiller.push("goalUpdate");
+ //profilerFiller.pop(); // Purpur
+ //profilerFiller.push("goalUpdate"); // Purpur
for (WrappedGoal wrappedGoal2 : this.availableGoals) {
// Paper start
@@ -118,13 +118,13 @@ public class GoalSelector {
}
}
- profilerFiller.pop();
+ //profilerFiller.pop(); // Purpur
this.tickRunningGoals(true);
}
public void tickRunningGoals(boolean tickAll) {
- ProfilerFiller profilerFiller = this.profiler.get();
- profilerFiller.push("goalTick");
+ //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur
+ //profilerFiller.push("goalTick"); // Purpur
for (WrappedGoal wrappedGoal : this.availableGoals) {
if (wrappedGoal.isRunning() && (tickAll || wrappedGoal.requiresUpdateEveryTick())) {
@@ -132,7 +132,7 @@ public class GoalSelector {
}
}
- profilerFiller.pop();
+ //profilerFiller.pop(); // Purpur
}
public Set<WrappedGoal> getAvailableGoals() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index 2e9991e6b3c05584002744a2ee2579b1dba218b2..544920a31b649985333f82beafa94a3392f5853e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -172,12 +172,12 @@ public abstract class PathNavigation {
}
}
// Paper end - EntityPathfindEvent
- this.level.getProfiler().push("pathfind");
+ //this.level.getProfiler().push("pathfind"); // Purpur
BlockPos blockPos = useHeadPos ? this.mob.blockPosition().above() : this.mob.blockPosition();
int i = (int)(followRange + (float)range);
PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i));
Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier);
- this.level.getProfiler().pop();
+ //this.level.getProfiler().pop(); // Purpur
if (path != null && path.getTarget() != null) {
this.targetPos = path.getTarget();
this.reachRange = distance;
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java
index 51772f03a3469b11e7166ec6f3a1b9c64a606221..02f2f46ccc48bb4d9bd08555818b0489f60d9f13 100644
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java
@@ -26,9 +26,9 @@ public class Sensing {
} else if (this.unseen.contains(i)) {
return false;
} else {
- this.mob.level().getProfiler().push("hasLineOfSight");
+ //this.mob.level().getProfiler().push("hasLineOfSight"); // Purpur
boolean bl = this.mob.hasLineOfSight(entity);
- this.mob.level().getProfiler().pop();
+ //this.mob.level().getProfiler().pop(); // Purpur
if (bl) {
this.seen.add(i);
} else {
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index 902882ca639eee6efe102ea70e182fb17df801c2..0f9196cc26e5c670a7f3454326b762f0303f633c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -260,13 +260,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("allayBrain");
+ //this.level().getProfiler().push("allayBrain"); // Purpur
//if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish
this.getBrain().tick((ServerLevel) this.level(), this);
- this.level().getProfiler().pop();
- this.level().getProfiler().push("allayActivityUpdate");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("allayActivityUpdate"); // Purpur
AllayAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
index 75c05990b9ee6fd429c24415be3b98e258638e89..5b024bc6166a9034eeba729bf3a53236446a03de 100644
--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
@@ -163,12 +163,12 @@ public class Armadillo extends Animal {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("armadilloBrain");
+ //this.level().getProfiler().push("armadilloBrain"); // Purpur
((Brain<Armadillo>) this.brain).tick((ServerLevel) this.level(), this); // CraftBukkit - decompile error
- this.level().getProfiler().pop();
- this.level().getProfiler().push("armadilloActivityUpdate");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("armadilloActivityUpdate"); // Purpur
ArmadilloAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) {
this.playSound(SoundEvents.ARMADILLO_SCUTE_DROP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
this.forceDrops = true; // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
index 091fbd162a63ec523197a953e65c00a54dae5ef9..e3178e2562a45f09c6567bb63112aa84fc59ea1d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -309,13 +309,13 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder<Axolo
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("axolotlBrain");
+ //this.level().getProfiler().push("axolotlBrain"); // Purpur
//if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish
this.getBrain().tick((ServerLevel) this.level(), this);
- this.level().getProfiler().pop();
- this.level().getProfiler().push("axolotlActivityUpdate");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("axolotlActivityUpdate"); // Purpur
AxolotlAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
if (!this.isNoAi()) {
Optional<Integer> optional = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS);
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index c567b946e013852acfae7f5a417a292706e218f4..e88d6d691bb176e33afeb294d735dfb2cbac12ff 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -154,14 +154,14 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("camelBrain");
+ //this.level().getProfiler().push("camelBrain"); // Purpur
Brain<Camel> behaviorcontroller = (Brain<Camel>) this.getBrain(); // CraftBukkit - decompile error
behaviorcontroller.tick((ServerLevel) this.level(), this);
- this.level().getProfiler().pop();
- this.level().getProfiler().push("camelActivityUpdate");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("camelActivityUpdate"); // Purpur
CamelAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
index b0f8115b328eda1e3571051870b5310c5a7e115a..ee8c232ddaa518377bdfa54e83ffc04f7a2f2c9a 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
@@ -237,13 +237,13 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("frogBrain");
+ //this.level().getProfiler().push("frogBrain"); // Purpur
//if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish
this.getBrain().tick((ServerLevel)this.level(), this);
- this.level().getProfiler().pop();
- this.level().getProfiler().push("frogActivityUpdate");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("frogActivityUpdate"); // Purpur
FrogAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
index 057096c5252e86d828a69080bdc70538e516ce99..0656e03bdd71f5d81853e817e136c8f11667c76e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -122,13 +122,13 @@ public class Tadpole extends AbstractFish {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("tadpoleBrain");
+ //this.level().getProfiler().push("tadpoleBrain"); // Purpur
//if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish
this.getBrain().tick((ServerLevel) this.level(), this);
- this.level().getProfiler().pop();
- this.level().getProfiler().push("tadpoleActivityUpdate");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("tadpoleActivityUpdate"); // Purpur
TadpoleAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
index fab01a3e779e39962ef04305540e2fe3043072a2..4feddea8703d25a671fe11617f99e1fa9c1deaa2 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
@@ -224,13 +224,13 @@ public class Goat extends Animal {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("goatBrain");
+ //this.level().getProfiler().push("goatBrain"); // Purpur
//if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish
this.getBrain().tick((ServerLevel) this.level(), this);
- this.level().getProfiler().pop();
- this.level().getProfiler().push("goatActivityUpdate");
+ //this.level().getProfiler().pop(); // Purpur
+ //this.level().getProfiler().push("goatActivityUpdate"); // Purpur
GoatAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index d82b036b5a759574fe83027ec1000d7eb0455a28..b6f5281705ce4c7a755e3818cf6c4a2235a024f9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -505,11 +505,11 @@ public class Sniffer extends Animal {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("snifferBrain");
+ //this.level().getProfiler().push("snifferBrain"); // Purpur
this.getBrain().tick((ServerLevel) this.level(), this);
- this.level().getProfiler().popPush("snifferActivityUpdate");
+ //this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur
SnifferAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
index 6817f88c422480f201552300ae78053321e41bb8..0cf110be4ec7823996e89c1d1e014e091c1d3d8a 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
@@ -266,10 +266,10 @@ public class Zoglin extends Monster implements Enemy, HoglinBase {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("zoglinBrain");
+ //this.level().getProfiler().push("zoglinBrain"); // Purpur
if (getRider() == null || !this.isControllable()) // Purpur - only use brain if no rider
this.getBrain().tick((ServerLevel)this.level(), this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
this.updateActivity();
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java
index ee9098f311b5db7251fcaf3ca199ae51ec1f2a2a..0d8e49e4f3c52244f8f84d6e4beeaa60aa6acdd9 100644
--- a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java
+++ b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java
@@ -228,11 +228,11 @@ public class Breeze extends Monster {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("breezeBrain");
+ //this.level().getProfiler().push("breezeBrain"); // Purpur
this.getBrain().tick((ServerLevel)this.level(), this);
- this.level().getProfiler().popPush("breezeActivityUpdate");
+ //this.level().getProfiler().popPush("breezeActivityUpdate"); // Purpur
BreezeAi.updateActivity(this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
index 705385f5136ab6e063207004a045ed6a860b9903..ef263efa3ec00c36f938158356c34fb87c52c7bc 100644
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
@@ -193,10 +193,10 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("hoglinBrain");
+ //this.level().getProfiler().push("hoglinBrain"); // Purpur
//if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish
this.getBrain().tick((ServerLevel)this.level(), this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
HoglinAi.updateActivity(this);
if (this.isConverting()) {
this.timeInOverworld++;
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
index 02294488328707a7a67442669eeb48212c1452ab..6348d7a63b6fcfecc899fd7d1e0b941214acce01 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -328,10 +328,10 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("piglinBrain");
+ //this.level().getProfiler().push("piglinBrain"); // Purpur
//if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish
this.getBrain().tick((ServerLevel) this.level(), this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
PiglinAi.updateActivity(this);
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
index 5537f4e2bdce05ef5863955b9403eda7b04ec0d5..2f43bef3acd9db78ecc869f5ff0f4d0f5e121d28 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
@@ -139,10 +139,10 @@ public class PiglinBrute extends AbstractPiglin {
@Override
protected void customServerAiStep() {
- this.level().getProfiler().push("piglinBruteBrain");
+ //this.level().getProfiler().push("piglinBruteBrain"); // Purpur
if (getRider() == null || this.isControllable()) // Purpur - only use brain if no rider
this.getBrain().tick((ServerLevel)this.level(), this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
PiglinBruteAi.updateActivity(this);
PiglinBruteAi.maybePlayActivitySound(this);
super.customServerAiStep();
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index ba560ab0340c06614547dcddbdcbd1bbda44bb79..6ee394c1616db9b0203b3e52e39234d064438654 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -300,9 +300,10 @@ public class Warden extends Monster implements VibrationSystem {
protected void customServerAiStep() {
ServerLevel worldserver = (ServerLevel) this.level();
- worldserver.getProfiler().push("wardenBrain");
+ //worldserver.getProfiler().push("wardenBrain"); // Purpur
+ //if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - TODO: Move to Ridables patch
this.getBrain().tick(worldserver, this);
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
if ((this.tickCount + this.getId()) % 120 == 0) {
Warden.applyDarknessAround(worldserver, this.position(), this, 20);
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index d4f64414a0351999a04308a3d26d15c9ddf266c7..88972d9f07eb9088c139d9dbc974b2e61943f292 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -342,7 +342,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
protected void customServerAiStep(boolean inactive) { // Purpur - not final
// Paper end
- this.level().getProfiler().push("villagerBrain");
+ //this.level().getProfiler().push("villagerBrain"); // Purpur
// Purpur start
if (this.level().purpurConfig.villagerLobotomizeEnabled) {
// treat as inactive if lobotomized
@@ -358,7 +358,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
this.getBrain().tick((ServerLevel) this.level(), this); // Paper
}
// Purpur end*/ // Purpur - TODO: Pufferfish
- this.level().getProfiler().pop();
+ //this.level().getProfiler().pop(); // Purpur
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;
}
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 6c66ee69beb55e5c5755bbf4d13c256541ce4468..28eafd9b22b745a940b4465aae01cb738a2d7002 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -646,7 +646,7 @@ public class Explosion {
}
if (flag1) {
- this.level.getProfiler().push("explosion_blocks");
+ //this.level.getProfiler().push("explosion_blocks"); // Purpur
List<Pair<ItemStack, BlockPos>> list = new ArrayList();
Util.shuffle(this.toBlow, this.level.random);
@@ -721,7 +721,7 @@ public class Explosion {
Block.popResource(this.level, (BlockPos) pair.getSecond(), (ItemStack) pair.getFirst());
}
- this.level.getProfiler().pop();
+ //this.level.getProfiler().pop(); // Purpur
}
if (this.fire) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 9dd8378099b1ece5657adf1677f988ca331899b1..ed313b0424b2e1e1335ee3e3bd4d9cfd15f24b39 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -269,7 +269,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public final <T extends Entity> List<T> getEntitiesOfClass(final Class<T> entityClass, final AABB boundingBox, final Predicate<? super T> predicate) {
- this.getProfiler().incrementCounter("getEntities");
+ //this.getProfiler().incrementCounter("getEntities"); // Purpur
final List<T> ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate);
@@ -279,7 +279,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public final List<Entity> moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate<? super Entity> predicate) {
- this.getProfiler().incrementCounter("getEntities");
+ //this.getProfiler().incrementCounter("getEntities"); // Purpur
final List<Entity> ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate);
@@ -1412,9 +1412,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
protected void tickBlockEntities() {
- ProfilerFiller gameprofilerfiller = this.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur
- gameprofilerfiller.push("blockEntities");
+ //gameprofilerfiller.push("blockEntities"); // Purpur
//this.timings.tileEntityPending.startTiming(); // Spigot // Purpur
this.tickingBlockEntities = true;
if (!this.pendingBlockEntityTickers.isEmpty()) {
@@ -1457,7 +1457,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
//this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur
this.tickingBlockEntities = false;
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
this.spigotConfig.currentPrimedTnt = 0; // Spigot
}
@@ -1669,7 +1669,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
- this.getProfiler().incrementCounter("getEntities");
+ //this.getProfiler().incrementCounter("getEntities"); // Purpur
// Paper start - rewrite chunk system
final List<Entity> ret = new java.util.ArrayList<>();
@@ -1695,7 +1695,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public <T extends Entity> void getEntities(final EntityTypeTest<Entity, T> entityTypeTest,
final AABB boundingBox, final Predicate<? super T> predicate,
final List<? super T> into, final int maxCount) {
- this.getProfiler().incrementCounter("getEntities");
+ //this.getProfiler().incrementCounter("getEntities"); // Purpur
if (entityTypeTest instanceof net.minecraft.world.entity.EntityType<T> byType) {
if (maxCount != Integer.MAX_VALUE) {
@@ -1990,6 +1990,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
public ProfilerFiller getProfiler() {
+ //if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur // Purpur - TODO: Pufferfish
return (ProfilerFiller) this.profiler.get();
}
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 735f39fed209e086a52185565f8bd6873c0b8d6e..4dc060bc677984d91a30a88155c576d5e187aa1b 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -127,7 +127,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.getProfiler().push("spawner"); // Purpur
//world.timings.mobSpawn.startTiming(); // Spigot // Purpur
MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES;
int i = aenumcreaturetype.length;
@@ -182,7 +182,7 @@ public final class NaturalSpawner {
}
//world.timings.mobSpawn.stopTiming(); // Spigot // Purpur
- world.getProfiler().pop();
+ //world.getProfiler().pop(); // Purpur
}
// Paper start - Add mobcaps commands
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 1d2986780d75272422e678cf25c9a31666ba8866..4666b51278dbe65b8e4911bcf1dbb867110c146f 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -383,11 +383,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
- gameprofilerfiller.push("updateSkyLightSources");
+ //gameprofilerfiller.push("updateSkyLightSources"); // Purpur
// Paper - rewrite chunk system
- gameprofilerfiller.popPush("queueCheckLight");
+ //gameprofilerfiller.popPush("queueCheckLight"); // Purpur
this.level.getChunkSource().getLightEngine().checkBlock(blockposition);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
boolean flag3 = iblockdata1.hasBlockEntity();
@@ -1023,9 +1023,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
if (LevelChunk.this.isTicking(blockposition)) {
try {
- ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler();
+ //ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler();
- gameprofilerfiller.push(this::getType);
+ //gameprofilerfiller.push(this::getType);
//this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
@@ -1042,7 +1042,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
// Paper end - Remove the Block Entity if it's invalid
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop();
} catch (Throwable throwable) {
if (throwable instanceof ThreadDeath) throw throwable; // Paper
// Paper start - Prevent block entity and entity crashes
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
index 18bbb3f8f99849333ff4bc020c8ce758a69312a5..404080976208c30e9e95e5bee47c2a749e709a45 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
@@ -53,8 +53,8 @@ public class PathFinder {
@Nullable
// Paper start - Perf: remove streams and optimize collection
private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
- profiler.push("find_path");
- profiler.markForCharting(MetricCategory.PATH_FINDING);
+ //profiler.push("find_path"); // Purpur
+ //profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur
// Set<Target> set = positions.keySet();
startNode.g = 0.0F;
startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection
@@ -122,7 +122,7 @@ public class PathFinder {
if (best == null || comparator.compare(path, best) < 0)
best = path;
}
- profiler.pop();
+ //profiler.pop(); // Purpur
return best;
// Paper end - Perf: remove streams and optimize collection
}
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
index 7a69564572357a7acc043e35b9c113beeb738951..a6d62abd3102770652f914b9d697c6d3c2533cfc 100644
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
@@ -81,20 +81,20 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
}
public void tick(long time, int maxTicks, BiConsumer<BlockPos, T> ticker) {
- ProfilerFiller profilerFiller = this.profiler.get();
- profilerFiller.push("collect");
- this.collectTicks(time, maxTicks, profilerFiller);
- profilerFiller.popPush("run");
- profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size());
+ //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur
+ //profilerFiller.push("collect"); // Purpur
+ this.collectTicks(time, maxTicks, null); // Purpur
+ //profilerFiller.popPush("run"); // Purpur
+ //profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur
this.runCollectedTicks(ticker);
- profilerFiller.popPush("cleanup");
+ //profilerFiller.popPush("cleanup"); // Purpur
this.cleanupAfterTick();
- profilerFiller.pop();
+ //profilerFiller.pop(); // Purpur
}
private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) {
this.sortContainersToTick(time);
- profiler.incrementCounter("containersToTick", this.containersToTick.size());
+ //profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur
this.drainContainers(time, maxTicks);
this.rescheduleLeftoverContainers();
}