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

Paper Changes:
PaperMC/Paper@2946dbb Update WorldServer#serverlevelData mapping
PaperMC/Paper@98af0e0 update generator
PaperMC/Paper@20507b4 Apply more patches
PaperMC/Paper@7162ff0 fix item meta
PaperMC/Paper@7d67d3f fix DamageTypeTags init
PaperMC/Paper@0971875 re-add improve perf of mass crafts
2024-10-27 00:12:43 -07:00

2135 lines
105 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 d8ee4422a13c7f09b84e9bbe8b57f0c139caac32..0ba926b6ff0bd54159765cc7f37d1753ded89dee 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -169,7 +169,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);
@@ -351,9 +351,9 @@ public class Commands {
// Paper end
CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource();
- Profiler.get().push(() -> {
+ /*Profiler.get().push(() -> { // Purpur
return "/" + s;
- });
+ });*/ // Purpur
ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - Add UnknownCommandEvent
try {
@@ -383,7 +383,7 @@ public class Commands {
Commands.LOGGER.error("'/{}' threw an exception", s, exception);
}
} finally {
- Profiler.get().pop();
+ //Profiler.get().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 af8c8d3d2c92bede02fca6bebd05c4f5c1a98583..733020a0339129cf4bbe64e0c57181957dd0746c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -431,12 +431,12 @@ 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.onMetricsRecordingStopped = (methodprofilerresults) -> {
+ //this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; // 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();
@@ -1050,9 +1050,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
@@ -1338,22 +1338,22 @@ 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;
try {
- Profiler.Scope profiler_a = Profiler.use(this.createProfiler());
+ //Profiler.Scope profiler_a = Profiler.use(this.createProfiler()); // Purpur
try {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("tick");
+ //gameprofilerfiller.push("tick"); // Purpur
this.tickFrame.start();
this.tickServer(flag ? () -> {
return false;
@@ -1366,7 +1366,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end - rewrite chunk system
this.tickFrame.end();
- gameprofilerfiller.popPush("nextTickWait");
+ //gameprofilerfiller.popPush("nextTickWait"); // Purpur
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup /*|| !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup*/) { // Purpur // Purpur - TODO: Pufferfish
@@ -1380,23 +1380,23 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickRateManager.endTickWork();
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
this.logFullTickTime();
} catch (Throwable throwable) {
- if (profiler_a != null) {
+ /*if (profiler_a != null) { // Purpur
try {
profiler_a.close();
} catch (Throwable throwable1) {
throwable.addSuppressed(throwable1);
}
- }
+ }*/ // Purpur
throw throwable;
}
- if (profiler_a != null) {
+ /*if (profiler_a != null) { // Purpur
profiler_a.close();
- }
+ }*/ // Purpur
} finally {
this.endMetricsRecordingTick();
}
@@ -1618,7 +1618,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
- Profiler.get().incrementCounter("runTask");
+ //Profiler.get().incrementCounter("runTask"); // Purpur
super.doRunTask(ticktask);
}
@@ -1712,7 +1712,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.autoSave();
}
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
// Paper start - move executeAll() into full server tick timing
//try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { // Purpur
@@ -1725,7 +1725,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
// Paper end - Server Tick Events
this.server.spark.tickEnd(((double)(endTime - lastTick) / 1000000D)); // Paper - spark
- gameprofilerfiller.push("tallying");
+ //gameprofilerfiller.push("tallying"); // Purpur
long k = Util.getNanos() - i;
int l = this.tickCount % 100;
@@ -1739,7 +1739,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickTimes60s.add(this.tickCount, k);
// Paper end - Add tick times API and /mspt command
this.logTickMethodTime(i);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
}
@@ -1842,11 +1842,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
- gameprofilerfiller.push("commandFunctions");
+ //gameprofilerfiller.push("commandFunctions"); // Purpur
//MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper // Purpur
this.getFunctions().tick();
//MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper // Purpur
- gameprofilerfiller.popPush("levels");
+ //gameprofilerfiller.popPush("levels"); // Purpur
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
// CraftBukkit start
@@ -1888,20 +1888,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
- gameprofilerfiller.push(() -> {
+ /*gameprofilerfiller.push(() -> { // Purpur
String s = String.valueOf(worldserver);
return s + " " + String.valueOf(worldserver.dimension().location());
- });
+ });*/ // Purpur
/* Drop global time updates
if (this.tickCount % 20 == 0) {
- gameprofilerfiller.push("timeSync");
+ //gameprofilerfiller.push("timeSync"); // Purpur
this.synchronizeTime(worldserver);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
// CraftBukkit end */
- gameprofilerfiller.push("tick");
+ //gameprofilerfiller.push("tick"); // Purpur
try {
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
@@ -1914,16 +1914,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new ReportedException(crashreport);
}
- gameprofilerfiller.pop();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.pop(); // Purpur
}
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
- gameprofilerfiller.popPush("connection");
+ //gameprofilerfiller.popPush("connection"); // Purpur
// MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper // Purpur
this.tickConnection();
// MinecraftTimings.connectionTimer.stopTiming(); // Spigot // Paper // Purpur
- gameprofilerfiller.popPush("players");
+ //gameprofilerfiller.popPush("players"); // Purpur
//MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
this.playerList.tick();
//MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -1931,7 +1931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
- gameprofilerfiller.popPush("server gui refresh");
+ //gameprofilerfiller.popPush("server gui refresh"); // Purpur
//MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
for (int i = 0; i < this.tickables.size(); ++i) {
@@ -1939,7 +1939,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
//MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
- gameprofilerfiller.popPush("send chunks");
+ //gameprofilerfiller.popPush("send chunks"); // Purpur
iterator = this.playerList.getPlayers().iterator();
while (iterator.hasNext()) {
@@ -1949,7 +1949,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.resumeFlushing();
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
public void tickConnection() {
@@ -1961,9 +1961,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void forceTimeSynchronization() {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get();
- gameprofilerfiller.push("timeSync");
+ //gameprofilerfiller.push("timeSync"); // Purpur
Iterator iterator = this.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1972,7 +1972,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.synchronizeTime(worldserver);
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
public boolean isLevelEnabled(Level world) {
@@ -2925,7 +2925,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end
private ProfilerFiller createProfiler() {
- 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"));
@@ -2935,37 +2935,38 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.willStartRecordingMetrics = false;
}
- this.metricsRecorder.startTick();
- return SingleTickProfiler.decorateFiller(this.metricsRecorder.getProfiler(), SingleTickProfiler.createTickProfiler("Server"));
+ //this.metricsRecorder.startTick(); // Purpur
+ return null; // Purpur
+ //return SingleTickProfiler.decorateFiller(this.metricsRecorder.getProfiler(), SingleTickProfiler.createTickProfiler("Server")); // Purpur
}
public void endMetricsRecordingTick() {
- this.metricsRecorder.endTick();
+ //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.metricsRecorder.cancel(); // Purpur
}
public Path getWorldPath(LevelResource worldSavePath) {
@@ -3018,15 +3019,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 0b348f701b61c7b7ed0190eff8b2d73f3a3d5c74..ebd4d2463f88535edd69a1b63a65a635a5592ca2 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
@@ -54,10 +54,10 @@ public class ServerFunctionManager {
}
private void executeTagFunctions(Collection<CommandFunction<CommandSourceStack>> functions, ResourceLocation label) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
Objects.requireNonNull(label);
- gameprofilerfiller.push(label::toString);
+ //gameprofilerfiller.push(label::toString); // Purpur
Iterator iterator = functions.iterator();
while (iterator.hasNext()) {
@@ -66,15 +66,15 @@ public class ServerFunctionManager {
this.execute(commandfunction, this.getGameLoopSender());
}
- Profiler.get().pop();
+ //Profiler.get().pop(); // Purpur
}
public void execute(CommandFunction<CommandSourceStack> function, CommandSourceStack source) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push(() -> {
+ /*gameprofilerfiller.push(() -> { // Purpur
return "function " + String.valueOf(function.id());
- });
+ });*/ // Purpur
try {
InstantiatedFunction<CommandSourceStack> instantiatedfunction = function.instantiate((CompoundTag) null, this.getDispatcher());
@@ -87,7 +87,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/commands/PerfCommand.java b/src/main/java/net/minecraft/server/commands/PerfCommand.java
index 8c587f829c5e8c6b6df3150024c4ae704988c47b..8ac4d5dbe7f8febf4226f26a6b035282dcdf1b0f 100644
--- a/src/main/java/net/minecraft/server/commands/PerfCommand.java
+++ b/src/main/java/net/minecraft/server/commands/PerfCommand.java
@@ -42,6 +42,7 @@ public class PerfCommand {
}
private static int startProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException {
+ if (true) return removedMessage(source); // Purpur
MinecraftServer minecraftServer = source.getServer();
if (minecraftServer.isRecordingMetrics()) {
throw ERROR_ALREADY_RUNNING.create();
@@ -55,6 +56,7 @@ public class PerfCommand {
}
private static int stopProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException {
+ if (true) return removedMessage(source); // Purpur
MinecraftServer minecraftServer = source.getServer();
if (!minecraftServer.isRecordingMetrics()) {
throw ERROR_NOT_RUNNING.create();
@@ -64,6 +66,18 @@ public class PerfCommand {
}
}
+ // Purpur start
+ private static int removedMessage(CommandSourceStack source) {
+ if (true) {
+ net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage();
+ source.getSender().sendMessage(mm.deserialize("<gold>Purpur has removed Mojang's Profiler to save your performance. Please use <click:suggest_command:'/spark'><grey>/spark</grey></click> instead"));
+ source.getSender().sendMessage(mm.deserialize("<gold>For more information, view its documentation at"));
+ source.getSender().sendMessage(mm.deserialize("<gold><click:open_url:'https://spark.lucko.me/docs/Command-Usage'>https://spark.lucko.me/docs/Command-Usage</click>"));
+ }
+ return 0;
+ }
+ // Purpur end
+
private static void saveResults(CommandSourceStack source, Path tempProfilingDirectory, MinecraftServer server) {
String string = String.format(
Locale.ROOT, "%s-%s-%s", Util.getFilenameFormattedDateTime(), server.getWorldData().getLevelName(), SharedConstants.getCurrentVersion().getId()
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 987d8567034e06bfb916d3e0a4a87f6c9169bccf..fdc7cb58a5f106646448e4898dc03d473be8042d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -373,16 +373,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected void tick(BooleanSupplier shouldKeepTicking) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // 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 96f9d18eb22380cccd35b486713583d6dfa46646..1961b18a2b5e5985181f0ca930ab14ba1d168c44 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -444,30 +444,30 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
// CraftBukkit start - modelled on below
public void purgeUnload() {
if (true) return; // Paper - rewrite chunk system
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("purge");
+ //gameprofilerfiller.push("purge"); // Purpur
this.distanceManager.purgeStaleTickets();
this.runDistanceManagerUpdates();
- gameprofilerfiller.popPush("unload");
+ //gameprofilerfiller.popPush("unload"); // Purpur
this.chunkMap.tick(() -> true);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
this.clearCache();
}
// CraftBukkit end
@Override
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("purge");
+ //gameprofilerfiller.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
- gameprofilerfiller.popPush("chunks");
+ //gameprofilerfiller.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
@@ -477,10 +477,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
//this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur
- gameprofilerfiller.popPush("unload");
+ //gameprofilerfiller.popPush("unload"); // Purpur
this.chunkMap.tick(shouldKeepTicking);
//this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
this.clearCache();
}
@@ -490,34 +490,34 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
this.lastInhabitedUpdate = i;
if (!this.level.isDebug()) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("pollingChunks");
+ //gameprofilerfiller.push("pollingChunks"); // Purpur
if (this.level.tickRateManager().runsNormally()) {
List<LevelChunk> list = this.tickingChunks;
try {
- gameprofilerfiller.push("filteringTickingChunks");
+ //gameprofilerfiller.push("filteringTickingChunks"); // Purpur
this.collectTickingChunks(list);
- gameprofilerfiller.popPush("shuffleChunks");
+ //gameprofilerfiller.popPush("shuffleChunks"); // Purpur
// Paper start - chunk tick iteration optimisation
this.shuffleRandom.setSeed(this.level.random.nextLong());
Util.shuffle(list, this.shuffleRandom);
// Paper end - chunk tick iteration optimisation
- this.tickChunks(gameprofilerfiller, j, list);
- gameprofilerfiller.pop();
+ this.tickChunks(null, j, list); // Purpur
+ //gameprofilerfiller.pop(); // Purpur
} finally {
list.clear();
}
}
- this.broadcastChangedChunks(gameprofilerfiller);
- gameprofilerfiller.pop();
+ this.broadcastChangedChunks(null); // Purpur
+ //gameprofilerfiller.pop(); // Purpur
}
}
- private void broadcastChangedChunks(ProfilerFiller profiler) {
- profiler.push("broadcast");
+ private void broadcastChangedChunks(ProfilerFiller profiler) { // Purpur
+ //profiler.push("broadcast"); // Purpur
Iterator iterator = this.chunkHoldersToBroadcast.iterator();
while (iterator.hasNext()) {
@@ -532,7 +532,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
this.chunkHoldersToBroadcast.clear();
- profiler.pop();
+ //profiler.pop(); // Purpur
}
private void collectTickingChunks(List<LevelChunk> chunks) {
@@ -558,15 +558,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
// Paper end - chunk tick iteration optimisation
}
- private void tickChunks(ProfilerFiller profiler, long timeDelta, List<LevelChunk> chunks) {
- profiler.popPush("naturalSpawnCount");
+ private void tickChunks(ProfilerFiller profiler, long timeDelta, List<LevelChunk> chunks) { // Purpur
+ //profiler.popPush("naturalSpawnCount"); // Purpur
//this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
int j = this.distanceManager.getNaturalSpawnChunkCount();
NaturalSpawner.SpawnState spawnercreature_d = NaturalSpawner.createState(j, this.level.getAllEntities(), this::getFullChunk, new LocalMobCapCalculator(this.chunkMap));
// this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
this.lastSpawnState = spawnercreature_d;
- profiler.popPush("spawnAndTick");
+ //profiler.popPush("spawnAndTick"); // Purpur
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
List list1;
@@ -606,7 +606,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
//this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
- profiler.popPush("customSpawners");
+ //profiler.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);
@@ -806,7 +806,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@Override
protected void doRunTask(Runnable task) {
- Profiler.get().incrementCounter("runTask");
+ //Profiler.get().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 47ae7af2a0ff8ab4181cf447c58410ccb0f37371..3083f3e0a17efc3a1dc7f50493ec646d9884cbd8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -714,18 +714,18 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
public void tick(BooleanSupplier shouldKeepTicking) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // 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();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
@@ -756,30 +756,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.tickTime();
}
- gameprofilerfiller.push("tickPending");
+ //gameprofilerfiller.push("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();
@@ -787,7 +787,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
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) {
@@ -795,12 +795,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
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
@@ -808,9 +808,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.entityTickList.forEach((entity) -> {
if (!entity.isRemoved()) {
if (!tickratemanager.isEntityFrozen(entity)) {
- gameprofilerfiller.push("checkDespawn");
+ //gameprofilerfiller.push("checkDespawn"); // Purpur
entity.checkDespawn();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
if (true) { // Paper - rewrite chunk system
Entity entity1 = entity.getVehicle();
@@ -822,22 +822,22 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
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
@@ -964,9 +964,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
boolean flag = this.isRaining();
int j = chunkcoordintpair.getMinBlockX();
int k = chunkcoordintpair.getMinBlockZ();
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("thunder");
+ //gameprofilerfiller.push("thunder"); // Purpur
if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking
BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
@@ -1003,7 +1003,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
}
- 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) {
@@ -1013,14 +1013,14 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
} // 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
@@ -1367,18 +1367,18 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
//try { // Purpur
// Paper end - timings
entity.setOldPosAndRot();
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
++entity.tickCount;
- gameprofilerfiller.push(() -> {
+ /*gameprofilerfiller.push(() -> { // Purpur
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
- });
- gameprofilerfiller.incrementCounter("tickNonPassenger");
+ });*/ // Purpur
+ //gameprofilerfiller.incrementCounter("tickNonPassenger"); // Purpur
if (isActive) { // Paper - EAR 2
entity.tick();
entity.postTick(); // CraftBukkit
} else { entity.inactiveTick(); } // Paper - EAR 2
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
//} finally { timer.stopTiming(); } // Paper - timings // EAR 2 // Purpur
Iterator iterator = entity.getPassengers().iterator();
@@ -1402,12 +1402,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
passenger.setOldPosAndRot();
++passenger.tickCount;
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // 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();
@@ -1419,7 +1419,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
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 ce8b5dd01359344300d1a1a06e8207a768a846ce..2518ad5af51b944393e53508010a18df111c5c83 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1663,15 +1663,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
this.unsetRemoved();
*/
// CraftBukkit end
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("moving");
+ //gameprofilerfiller.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();
}
- gameprofilerfiller.pop();
- gameprofilerfiller.push("placing");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("placing"); // Purpur
// CraftBukkit start
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
LevelData worlddata = worldserver.getLevelData();
@@ -1689,7 +1689,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
this.connection.internalTeleport(PositionMoveRotation.of(teleportTarget), teleportTarget.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
worldserver.addDuringTeleport(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
this.triggerDimensionChangeTriggers(worldserver1);
this.stopUsingItem();
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 7d276c191b391bca24948ddb36b8b7d0f1f03b03..49cb116fd55e6d5cd36b9773b39191e4ab06b7e0 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -274,7 +274,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
protected void keepConnectionAlive() {
- Profiler.get().push("keepAlive");
+ //Profiler.get().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();
@@ -307,7 +307,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
- Profiler.get().pop();
+ //Profiler.get().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 d2d82e4f22bfeac8881b6815e4bef56c254fded9..abc92e09b7bb636612f04ace8232947c8d454e68 100644
--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
@@ -12,10 +12,10 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener
PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor
) {
return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("listener");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.push("listener"); // Purpur
this.onResourceManagerReload(manager);
- profilerFiller.pop();
+ //profilerFiller.pop(); // 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 bc5c8879befe849ce81becf5e3fba6757b01cb70..ce81d6bd87f688a24003f2fbf6d5010ad6273917 100644
--- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
+++ b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
@@ -6,51 +6,68 @@ 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
default void addZoneText(String label) {
}
+ @io.papermc.paper.annotation.DoNotUse // Purpur
default void addZoneValue(long value) {
}
+ @io.papermc.paper.annotation.DoNotUse // Purpur
default void setZoneColor(int color) {
}
+ @io.papermc.paper.annotation.DoNotUse // Purpur
default Zone zone(String name) {
this.push(name);
return new Zone(this);
}
+ @io.papermc.paper.annotation.DoNotUse // Purpur
default Zone zone(Supplier<String> nameSupplier) {
this.push(nameSupplier);
return new Zone(this);
}
+ @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 combine(ProfilerFiller first, ProfilerFiller second) {
@@ -72,80 +89,80 @@ public interface ProfilerFiller {
@Override
public void startTick() {
- this.first.startTick();
- this.second.startTick();
+ //this.first.startTick(); // Purpur
+ //this.second.startTick(); // Purpur
}
@Override
public void endTick() {
- this.first.endTick();
- this.second.endTick();
+ //this.first.endTick(); // Purpur
+ //this.second.endTick(); // Purpur
}
@Override
public void push(String location) {
- this.first.push(location);
- this.second.push(location);
+ //this.first.push(location); // Purpur
+ //this.second.push(location); // Purpur
}
@Override
public void push(Supplier<String> locationGetter) {
- this.first.push(locationGetter);
- this.second.push(locationGetter);
+ //this.first.push(locationGetter); // Purpur
+ //this.second.push(locationGetter); // Purpur
}
@Override
public void markForCharting(MetricCategory type) {
- this.first.markForCharting(type);
- this.second.markForCharting(type);
+ //this.first.markForCharting(type); // Purpur
+ //this.second.markForCharting(type); // Purpur
}
@Override
public void pop() {
- this.first.pop();
- this.second.pop();
+ //this.first.pop(); // Purpur
+ //this.second.pop(); // Purpur
}
@Override
public void popPush(String location) {
- this.first.popPush(location);
- this.second.popPush(location);
+ //this.first.popPush(location); // Purpur
+ //this.second.popPush(location); // Purpur
}
@Override
public void popPush(Supplier<String> locationGetter) {
- this.first.popPush(locationGetter);
- this.second.popPush(locationGetter);
+ //this.first.popPush(locationGetter); // Purpur
+ //this.second.popPush(locationGetter); // Purpur
}
@Override
public void incrementCounter(String marker, int num) {
- this.first.incrementCounter(marker, num);
- this.second.incrementCounter(marker, num);
+ //this.first.incrementCounter(marker, num); // Purpur
+ //this.second.incrementCounter(marker, num); // Purpur
}
@Override
public void incrementCounter(Supplier<String> markerGetter, int num) {
- this.first.incrementCounter(markerGetter, num);
- this.second.incrementCounter(markerGetter, num);
+ //this.first.incrementCounter(markerGetter, num); // Purpur
+ //this.second.incrementCounter(markerGetter, num); // Purpur
}
@Override
public void addZoneText(String label) {
- this.first.addZoneText(label);
- this.second.addZoneText(label);
+ //this.first.addZoneText(label); // Purpur
+ //this.second.addZoneText(label); // Purpur
}
@Override
public void addZoneValue(long value) {
- this.first.addZoneValue(value);
- this.second.addZoneValue(value);
+ //this.first.addZoneValue(value); // Purpur
+ //this.second.addZoneValue(value); // Purpur
}
@Override
public void setZoneColor(int color) {
- this.first.setZoneColor(color);
- this.second.setZoneColor(color);
+ //this.first.setZoneColor(color); // Purpur
+ //this.second.setZoneColor(color); // Purpur
}
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cb123001b08c0772bacce87d022d236bc7eaa1d1..6474b375c05eebc1fa3468f2963770dfff8dec5c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -946,9 +946,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end
public void baseTick() {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("entityBaseTick");
+ //gameprofilerfiller.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()) {
@@ -1017,7 +1017,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
public void setSharedFlagOnFire(boolean onFire) {
@@ -1243,9 +1243,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("move");
+ //gameprofilerfiller.push("move"); // Purpur
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) {
movement = movement.multiply(this.stuckSpeedMultiplier);
this.stuckSpeedMultiplier = Vec3.ZERO;
@@ -1254,7 +1254,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper start - ignore movement changes while inactive.
if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) {
setDeltaMovement(Vec3.ZERO);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
return;
}
// Paper end
@@ -1275,8 +1275,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z);
}
- gameprofilerfiller.pop();
- gameprofilerfiller.push("rest");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("rest"); // Purpur
boolean flag = !Mth.equal(movement.x, vec3d1.x);
boolean flag1 = !Mth.equal(movement.z, vec3d1.z);
@@ -1298,7 +1298,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
if (this.isRemoved()) {
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
} else {
if (this.horizontalCollision) {
Vec3 vec3d2 = this.getDeltaMovement();
@@ -1347,7 +1347,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
float f = this.getBlockSpeedFactor();
this.setDeltaMovement(this.getDeltaMovement().multiply((double) f, 1.0D, (double) f));
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
}
// Paper start - detailed watchdog information
@@ -3512,9 +3512,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.processPortalCooldown();
if (this.portalProcess != null) {
if (this.portalProcess.processPortalTeleportation(worldserver, this, this.canUsePortal(false))) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("portal");
+ //gameprofilerfiller.push("portal"); // Purpur
this.setPortalCooldown();
TeleportTransition teleporttransition = this.portalProcess.getPortalDestination(worldserver, this);
@@ -3526,7 +3526,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
} else if (this.portalProcess.hasExpired()) {
this.portalProcess = null;
}
@@ -4077,12 +4077,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("teleportCrossDimension");
+ //gameprofilerfiller.push("teleportCrossDimension"); // Purpur
entity = this.getType().create(world, EntitySpawnReason.DIMENSION_TRAVEL);
if (entity == null) {
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
return null;
} else {
// Paper start - Fix item duplication and teleport issues
@@ -4108,7 +4108,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
world.resetEmptyTime();
teleportTarget.postTeleportTransition().onTransition(entity);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
return entity;
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 60b0cf7cd5e4bcbe882590b79a70dafb23e6772f..38a7bde1bc2836352a62dfe1dd3b9a60877c20e2 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -459,9 +459,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
super.baseTick();
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("livingEntityBaseTick");
+ //gameprofilerfiller.push("livingEntityBaseTick"); // Purpur
if (this.fireImmune() || this.level().isClientSide) {
this.clearFire();
}
@@ -569,7 +569,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.yHeadRotO = this.yHeadRot;
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
@Override
@@ -3384,12 +3384,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.run += (f3 - this.run) * 0.3F;
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("headTurn");
+ //gameprofilerfiller.push("headTurn"); // Purpur
f2 = this.tickHeadTurn(f1, f2);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("rangeChecks");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.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;
@@ -3401,7 +3401,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F;
// Paper end
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
this.animStep += f2;
if (this.isFallFlying()) {
++this.fallFlyTicks;
@@ -3631,21 +3631,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.setDeltaMovement(d0, d1, d2);
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("ai");
+ //gameprofilerfiller.push("ai"); // Purpur
if (this.isImmobile()) {
this.jumping = false;
this.xxa = 0.0F;
this.zza = 0.0F;
} else if (this.isEffectiveAi()) {
- gameprofilerfiller.push("newAi");
+ //gameprofilerfiller.push("newAi"); // Purpur
this.serverAiStep();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
- gameprofilerfiller.pop();
- gameprofilerfiller.push("jump");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("jump"); // Purpur
if (this.jumping && this.isAffectedByFluids()) {
double d3;
@@ -3672,8 +3672,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.noJumpDelay = 0;
}
- gameprofilerfiller.pop();
- gameprofilerfiller.push("travel");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("travel"); // Purpur
this.xxa *= 0.98F;
this.zza *= 0.98F;
if (this.isFallFlying()) {
@@ -3706,8 +3706,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.calculateEntityAnimation(this instanceof FlyingAnimal);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("freezing");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("freezing"); // Purpur
if (!this.level().isClientSide && !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API
int i = this.getTicksFrozen();
@@ -3728,15 +3728,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
}
- gameprofilerfiller.pop();
- gameprofilerfiller.push("push");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("push"); // Purpur
if (this.autoSpinAttackTicks > 0) {
--this.autoSpinAttackTicks;
this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox());
}
this.pushEntities();
- gameprofilerfiller.pop();
+ //gameprofilerfiller.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 7978e307e7bb7f80993c49dcc5ada319a907c648..ff9d23aef4658922692b43a859bd83632fe23612 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -371,15 +371,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void baseTick() {
super.baseTick();
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("mobBaseTick");
+ //gameprofilerfiller.push("mobBaseTick"); // Purpur
if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) {
this.resetAmbientSoundTime();
this.playAmbientSound();
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
incrementTicksSinceLastInteraction(); // Purpur
}
@@ -698,9 +698,9 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void aiStep() {
super.aiStep();
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("looting");
+ //gameprofilerfiller.push("looting"); // Purpur
Level world = this.level();
if (world instanceof ServerLevel worldserver) {
@@ -724,7 +724,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
protected Vec3i getPickupReach() {
@@ -946,44 +946,44 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
return;
}
// Paper end - Allow nerfed mobs to jump and float
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // 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((ServerLevel) this.level());
- 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 29ae74339a4831ccef3d01e8054931715ba192ad..74c5914bc51cff128d4b86853316e5e51e02b416 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
@@ -82,8 +82,8 @@ public class GoalSelector {
}
public void tick() {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("goalCleanup");
+ //ProfilerFiller profilerFiller = 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
@@ -92,8 +92,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
@@ -113,13 +113,13 @@ public class GoalSelector {
}
}
- profilerFiller.pop();
+ //profilerFiller.pop(); // Purpur
this.tickRunningGoals(true);
}
public void tickRunningGoals(boolean tickAll) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("goalTick");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.push("goalTick"); // Purpur
for (WrappedGoal wrappedGoal : this.availableGoals) {
if (wrappedGoal.isRunning() && (tickAll || wrappedGoal.requiresUpdateEveryTick())) {
@@ -127,7 +127,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 48c0de870a5bbf647309e69361dfb10ab56c65ab..a5289b6c453c24cb7b8b3a301b72c3adf92c1d13 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
@@ -188,13 +188,13 @@ public abstract class PathNavigation {
}
}
// Paper end - EntityPathfindEvent
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("pathfind");
+ //ProfilerFiller profilerFiller = Profiler.get();
+ //profilerFiller.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);
- profilerFiller.pop();
+ //profilerFiller.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 116b1e251ffe68bae5c404d0823c2bc7c1afddf6..8f5a5db1a07fa6a95ecfacaab2f9de609202faf4 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
@@ -28,10 +28,10 @@ public class Sensing {
} else if (this.unseen.contains(i)) {
return false;
} else {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("hasLineOfSight");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.push("hasLineOfSight"); // Purpur
boolean bl = this.mob.hasLineOfSight(entity);
- profilerFiller.pop();
+ //profilerFiller.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 5904b82b87bcdbe41367843885f7c1bd1272d1f1..f60961bd5fdf6d1417e458b92e311c1a0a62463d 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
@@ -262,15 +262,15 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("allayBrain");
+ //gameprofilerfiller.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(world, this);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("allayActivityUpdate");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("allayActivityUpdate"); // Purpur
AllayAi.updateActivity(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
super.customServerAiStep(world);
}
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 9ef53608f1608e88de7a7b3e96b43d8d2b4230ae..84516dcfc6cd0fe16c26538ccb86fb5c85b44ffa 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,14 +163,14 @@ public class Armadillo extends Animal {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("armadilloBrain");
+ //gameprofilerfiller.push("armadilloBrain"); // Purpur
((Brain<Armadillo>) this.brain).tick(world, this); // CraftBukkit - decompile error
- gameprofilerfiller.pop();
- gameprofilerfiller.push("armadilloActivityUpdate");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("armadilloActivityUpdate"); // Purpur
ArmadilloAi.updateActivity(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) {
this.forceDrops = true; // CraftBukkit
if (this.dropFromGiftLootTable(world, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) {
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 91768d49c3cbef0a135cfd0e60bdb4e84bf109b3..c80d74caa393a31e09f2776cdb3cb950ef99e2ef 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
@@ -332,15 +332,15 @@ public class Axolotl extends Animal implements VariantHolder<Axolotl.Variant>, B
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("axolotlBrain");
+ //gameprofilerfiller.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(world, this);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("axolotlActivityUpdate");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("axolotlActivityUpdate"); // Purpur
AxolotlAi.updateActivity(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.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 dbce71f45c008da883b6d244a06343d83ae25e7e..56d97225a909fd55f0d8aec992d5b6d42687c948 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,16 +154,16 @@ public class Camel extends AbstractHorse {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("camelBrain");
+ //gameprofilerfiller.push("camelBrain"); // Purpur
Brain<Camel> behaviorcontroller = (Brain<Camel>) this.getBrain(); // CraftBukkit - decompile error
behaviorcontroller.tick(world, this);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("camelActivityUpdate");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("camelActivityUpdate"); // Purpur
CamelAi.updateActivity(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
super.customServerAiStep(world);
}
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 49915ec0ee5fb6e7d25b079e0410942d44aa1e33..501a12398c56fe0df4e76a3bbce0f98c6c5aa6cb 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
@@ -240,14 +240,14 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("frogBrain");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.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(world, this);
- profilerFiller.pop();
- profilerFiller.push("frogActivityUpdate");
+ //profilerFiller.pop(); // Purpur
+ //profilerFiller.push("frogActivityUpdate"); // Purpur
FrogAi.updateActivity(this);
- profilerFiller.pop();
+ //profilerFiller.pop(); // Purpur
super.customServerAiStep(world);
}
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 fb91677fb03b7bc1decdf181b7b15d971ffacdc2..071d14cc6697587ec14f02c69c78df364e7d8a8f 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,15 +122,15 @@ public class Tadpole extends AbstractFish {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get();
- gameprofilerfiller.push("tadpoleBrain");
+ //gameprofilerfiller.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(world, this);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("tadpoleActivityUpdate");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("tadpoleActivityUpdate"); // Purpur
TadpoleAi.updateActivity(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
super.customServerAiStep(world);
}
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 7f196e8a8b5094375c9b13fe6e7311a3450dbb5f..51dcc3893b964e6d20a2b963d3105a2687b3c426 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
@@ -226,15 +226,15 @@ public class Goat extends Animal {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("goatBrain");
+ //gameprofilerfiller.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(world, this);
- gameprofilerfiller.pop();
- gameprofilerfiller.push("goatActivityUpdate");
+ //gameprofilerfiller.pop(); // Purpur
+ //gameprofilerfiller.push("goatActivityUpdate"); // Purpur
GoatAi.updateActivity(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
super.customServerAiStep(world);
}
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 464a16df15d8759d66f94ad080d1ea28b3f6474c..3fb4f12095883ea4ec6e0d60e0600b9de6ed7be2 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
@@ -495,13 +495,13 @@ public class Sniffer extends Animal {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("snifferBrain");
+ //gameprofilerfiller.push("snifferBrain"); // Purpur
this.getBrain().tick(world, this);
- gameprofilerfiller.popPush("snifferActivityUpdate");
+ //gameprofilerfiller.popPush("snifferActivityUpdate"); // Purpur
SnifferAi.updateActivity(this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
super.customServerAiStep(world);
}
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 cb20c018c11a0e707c2083cf964bd5303d216edd..f30ad422f19757664228f2064465fbcb22bb54f6 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
@@ -281,11 +281,11 @@ public class Zoglin extends Monster implements HoglinBase {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("zoglinBrain");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.push("zoglinBrain"); // Purpur
if (getRider() == null || !this.isControllable()) // Purpur - only use brain if no rider
this.getBrain().tick(world, this);
- profilerFiller.pop();
+ //profilerFiller.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 a16fd9c4679e874ad2d499f3c00c2ddfd780a7a5..0bc771e20a9bab139cd3fc03ff40baabf787b2f7 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
@@ -235,12 +235,12 @@ public class Breeze extends Monster {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("breezeBrain");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.push("breezeBrain"); // Purpur
this.getBrain().tick(world, this);
- profilerFiller.popPush("breezeActivityUpdate");
+ //profilerFiller.popPush("breezeActivityUpdate"); // Purpur
BreezeAi.updateActivity(this);
- profilerFiller.pop();
+ //profilerFiller.pop(); // Purpur
super.customServerAiStep(world);
}
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 7520ab7ec5902f083aefd68895a7d9c47bf4e418..7afde99f81ec222ecbffbdcdad3aa6404e8221e0 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
@@ -196,11 +196,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("hoglinBrain");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.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(world, this);
- profilerFiller.pop();
+ //profilerFiller.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 7d5ce66c6691b0911ed5afcb1d4186525f09a15e..b53e4a312ea0dbbd16e948e61c3f6b836d46f3b8 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
@@ -339,12 +339,12 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("piglinBrain");
+ //gameprofilerfiller.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(world, this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
PiglinAi.updateActivity(this);
super.customServerAiStep(world);
}
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 bc3b0eb21200eae7e419b2571871b36fc1e07c0f..719179fb232a4f39a2c1642cc0e9593f4dea4bb8 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
@@ -148,11 +148,11 @@ public class PiglinBrute extends AbstractPiglin {
@Override
protected void customServerAiStep(ServerLevel world) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("piglinBruteBrain");
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.push("piglinBruteBrain"); // Purpur
if (getRider() == null || this.isControllable()) // Purpur - only use brain if no rider
this.getBrain().tick(world, this);
- profilerFiller.pop();
+ //profilerFiller.pop(); // Purpur
PiglinBruteAi.updateActivity(this);
PiglinBruteAi.maybePlayActivitySound(this);
super.customServerAiStep(world);
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 fcfea2cdd5df9fe505df3f7c866cd8d27ad9b249..692261880d05daa75fc53dde31d0f2b95dc52746 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
@@ -303,9 +303,9 @@ public class Warden extends Monster implements VibrationSystem {
protected void customServerAiStep(ServerLevel world) {
ProfilerFiller gameprofilerfiller = Profiler.get();
- gameprofilerfiller.push("wardenBrain");
+ //gameprofilerfiller.push("wardenBrain"); // Purpur
this.getBrain().tick(world, this);
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
super.customServerAiStep(world);
if ((this.tickCount + this.getId()) % 120 == 0) {
Warden.applyDarknessAround(world, 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 c885b214f4d7d91627e98d8779aab8515f205636..b4ffad429ace965f16ebf47119c880b709b27f2e 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -340,9 +340,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
protected void customServerAiStep(ServerLevel world, boolean inactive) { // Purpur - not final
// Paper end - EAR 2
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("villagerBrain");
+ //gameprofilerfiller.push("villagerBrain"); // Purpur
// Purpur start
if (this.level().purpurConfig.villagerLobotomizeEnabled) {
// treat as inactive if lobotomized
@@ -352,7 +352,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
// Purpur end
if (!inactive && (getRider() == null || !this.isControllable())) this.getBrain().tick(world, this); // Purpur
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e14e9ae4f16dff8486c98f391c27ead816c2a080..224ad8e6553f019d5717d3bf70d11b034147fbdc 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -271,7 +271,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) {
- Profiler.get().incrementCounter("getEntities");
+ //Profiler.get().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);
@@ -281,7 +281,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) {
- Profiler.get().incrementCounter("getEntities");
+ //Profiler.get().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);
@@ -1488,9 +1488,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
protected void tickBlockEntities() {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Purpur
- gameprofilerfiller.push("blockEntities");
+ //gameprofilerfiller.push("blockEntities"); // Purpur
//this.timings.tileEntityPending.startTiming(); // Spigot // Purpur
this.tickingBlockEntities = true;
if (!this.pendingBlockEntityTickers.isEmpty()) {
@@ -1533,7 +1533,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
}
@@ -1703,7 +1703,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
- Profiler.get().incrementCounter("getEntities");
+ //Profiler.get().incrementCounter("getEntities"); // Purpur
List<Entity> list = Lists.newArrayList();
// Paper start - rewrite chunk system
@@ -1733,7 +1733,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) {
- Profiler.get().incrementCounter("getEntities");
+ //Profiler.get().incrementCounter("getEntities"); // Purpur
if (entityTypeTest instanceof net.minecraft.world.entity.EntityType<T> byType) {
if (maxCount != Integer.MAX_VALUE) {
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index f6fb4892c95f9716628ed8a90d1560b7c0a2e032..4bdfba6dbe88dbc7ce901b235a524ba28027f203 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -171,7 +171,7 @@ public final class NaturalSpawner {
}
//world.timings.mobSpawn.stopTiming(); // Spigot // Purpur
- gameprofilerfiller.pop();
+ //gameprofilerfiller.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 c1ce5a43b5759f204c432cbfbcdcb14b5ef43dc0..b525ab58998f4ead44f8a2b37ac2391c7de81df4 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -407,11 +407,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
if (LightEngine.hasDifferentLightProperties(iblockdata1, iblockdata)) {
ProfilerFiller gameprofilerfiller = Profiler.get();
- 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();
@@ -1060,9 +1060,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
if (LevelChunk.this.isTicking(blockposition)) {
try {
- ProfilerFiller gameprofilerfiller = Profiler.get();
+ //ProfilerFiller gameprofilerfiller = Profiler.get();
- gameprofilerfiller.push(this::getType);
+ //gameprofilerfiller.push(this::getType);
//this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
@@ -1079,7 +1079,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 cc7d94144e39f7dace7b569b4567def98396e8f9..91abbda59446d462979dddc4b380c6f24d0b4c92 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
@@ -58,9 +58,9 @@ public class PathFinder {
@Nullable
// Paper start - Perf: remove streams and optimize collection
private Path findPath(Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("find_path");
- profilerFiller.markForCharting(MetricCategory.PATH_FINDING);
+ //ProfilerFiller profilerFiller = Profiler.get(); // Purpur
+ //profilerFiller.push("find_path"); // Purpur
+ //profilerFiller.markForCharting(MetricCategory.PATH_FINDING); // Purpur
// Set<Target> set = positions.keySet();
startNode.g = 0.0F;
startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection
@@ -128,7 +128,7 @@ public class PathFinder {
if (best == null || comparator.compare(path, best) < 0)
best = path;
}
- profilerFiller.pop();
+ //profilerFiller.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 778e6476c86d823dc8efe603a95e589e8b2ea9d9..452fb3442221fd66debfe1e1d6e85ee17951e556 100644
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
@@ -79,20 +79,20 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
}
public void tick(long time, int maxTicks, BiConsumer<BlockPos, T> ticker) {
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("collect");
- this.collectTicks(time, maxTicks, profilerFiller);
- profilerFiller.popPush("run");
- profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size());
+ //ProfilerFiller profilerFiller = 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();
}