mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@152f4fe Add back improved watchdog support patch PaperMC/Paper@13992b1 Make chunk system loggers calm down a bit PaperMC/Paper@bf8552f Delegate ItemStack (#10852) PaperMC/Paper@b3e072a Fix `hasFiredAsync` parameter when `AsyncPlayerSendCommandsEvent` is called (#10896) PaperMC/Paper@21c9a7c Rebuild patches PaperMC/Paper@b9f7098 [ci skip] Fix javadoc mistake in EnchantmentRegistryEntry.Builder (#10898) PaperMC/Paper@b4b8208 Fix NPE for Jukebox#setRecord
1996 lines
102 KiB
Diff
1996 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 c32d172c161e6e537ee8e60b36bcb402e1ddb876..03c6ed862cc391b104b6c0ff0b8adf62824d293d 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);
|
|
@@ -349,9 +349,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 {
|
|
@@ -381,7 +381,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 28fceecee801cd56edc3e0506641d6560756a973..f7c8ded17964394a1a10d16128d507aa5660f278 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -359,13 +359,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();
|
|
@@ -979,9 +979,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
// 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
|
|
@@ -1252,16 +1252,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);
|
|
@@ -1272,7 +1272,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
|
|
@@ -1288,9 +1288,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);
|
|
}
|
|
@@ -1499,7 +1499,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);
|
|
}
|
|
|
|
@@ -1572,9 +1572,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.ticksUntilAutosave = this.autosavePeriod;
|
|
// CraftBukkit end
|
|
MinecraftServer.LOGGER.debug("Autosave started");
|
|
- this.profiler.push("save");
|
|
+ //this.profiler.push("save"); // Purpur
|
|
this.saveEverything(true, false, false);
|
|
- this.profiler.pop();
|
|
+ //this.profiler.pop(); // Purpur
|
|
MinecraftServer.LOGGER.debug("Autosave finished");
|
|
}
|
|
io.papermc.paper.util.CachedLists.reset(); // Paper
|
|
@@ -1588,7 +1588,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
|
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
|
|
// Paper end - Server Tick Events
|
|
- this.profiler.push("tallying");
|
|
+ //this.profiler.push("tallying"); // Purpur
|
|
long j = Util.getNanos() - i;
|
|
int k = this.tickCount % 100;
|
|
|
|
@@ -1602,7 +1602,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
|
|
}
|
|
@@ -1693,11 +1693,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
|
|
@@ -1739,20 +1739,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
|
|
|
|
- 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
|
|
@@ -1770,17 +1770,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
|
|
@@ -1788,7 +1788,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) {
|
|
@@ -1796,7 +1796,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()) {
|
|
@@ -1806,7 +1806,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
entityplayer.connection.resumeFlushing();
|
|
}
|
|
|
|
- this.profiler.pop();
|
|
+ //this.profiler.pop(); // Purpur
|
|
}
|
|
|
|
private void synchronizeTime(ServerLevel world) {
|
|
@@ -1814,7 +1814,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()) {
|
|
@@ -1823,7 +1823,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.synchronizeTime(worldserver);
|
|
}
|
|
|
|
- this.profiler.pop();
|
|
+ //this.profiler.pop(); // Purpur
|
|
}
|
|
|
|
public boolean isLevelEnabled(Level world) {
|
|
@@ -2535,6 +2535,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;
|
|
}
|
|
|
|
@@ -2774,7 +2775,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"));
|
|
@@ -2784,40 +2785,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) {
|
|
@@ -2870,15 +2871,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 b27cb90a52bc7d96d4318979c678a49a884562b2..686f3d8c91e1ffc0c7ffe1cd9bcf5df5503cb938 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
@@ -452,16 +452,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 fbb1753425a1cd456e4096b9fe506264e3dac505..adf79eb40c62e56311533de6c919f77e81ab4284 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
@@ -453,26 +453,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
|
|
// CraftBukkit start - modelled on below
|
|
public void purgeUnload() {
|
|
- 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
|
|
@@ -482,10 +482,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();
|
|
}
|
|
|
|
@@ -495,10 +495,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
|
|
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
|
Iterator iterator = this.chunkMap.getChunks().iterator();
|
|
//if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur
|
|
@@ -513,7 +513,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
}
|
|
|
|
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
|
|
@@ -542,7 +542,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
|
|
|
|
Util.shuffle(list, this.level.random);
|
|
@@ -577,7 +577,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);
|
|
@@ -585,14 +585,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
}
|
|
}
|
|
|
|
- gameprofilerfiller.popPush("broadcast");
|
|
+ //gameprofilerfiller.popPush("broadcast"); // Purpur
|
|
list.forEach((chunkproviderserver_a1) -> {
|
|
//this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur
|
|
chunkproviderserver_a1.holder.broadcastChanges(chunkproviderserver_a1.chunk);
|
|
//this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur
|
|
});
|
|
- gameprofilerfiller.pop();
|
|
- gameprofilerfiller.pop();
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
}
|
|
}
|
|
|
|
@@ -773,7 +773,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 55446501a3bc42e4881eb38b13d1de5d03d22c0d..500a735113f9f16f9d336c2bb1cad1447e5d64c4 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -644,16 +644,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();
|
|
}
|
|
|
|
@@ -685,30 +685,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();
|
|
@@ -716,7 +716,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) {
|
|
@@ -724,12 +724,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
|
|
@@ -739,9 +739,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();
|
|
|
|
@@ -753,22 +753,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
|
|
@@ -844,9 +844,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));
|
|
|
|
@@ -883,7 +883,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) {
|
|
@@ -893,7 +893,7 @@ 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) {
|
|
LevelChunkSection[] achunksection = chunk.getSections();
|
|
@@ -908,7 +908,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
for (int l1 = 0; l1 < randomTickSpeed; ++l1) {
|
|
BlockPos blockposition1 = this.getBlockRandomPos(j, k1, k, 15);
|
|
|
|
- gameprofilerfiller.push("randomTick");
|
|
+ //gameprofilerfiller.push("randomTick"); // Purpur
|
|
BlockState iblockdata = chunksection.getBlockState(blockposition1.getX() - j, blockposition1.getY() - k1, blockposition1.getZ() - k);
|
|
|
|
if (iblockdata.isRandomlyTicking()) {
|
|
@@ -921,14 +921,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
fluid.randomTick(this, blockposition1, this.random);
|
|
}
|
|
|
|
- gameprofilerfiller.pop();
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
|
|
- gameprofilerfiller.pop();
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
}
|
|
|
|
@VisibleForTesting
|
|
@@ -1245,19 +1245,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();
|
|
|
|
@@ -1280,12 +1280,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();
|
|
@@ -1297,7 +1297,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 69dc4f01f7156b70c51cd5facc2dd31d10a7aea7..09982bd8a4953b35be059084f8db5a7e581fdc43 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -1398,7 +1398,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();
|
|
}
|
|
@@ -1414,8 +1414,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();
|
|
@@ -1433,7 +1433,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 496551820d0357da9c5e89dd989d31b43fbfeb18..99c01f0328fab0a71a888dd57c74e9771e9e6bb8 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -859,7 +859,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()) {
|
|
@@ -924,7 +924,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) {
|
|
@@ -1102,7 +1102,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;
|
|
@@ -1111,7 +1111,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
|
|
@@ -1132,8 +1132,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);
|
|
|
|
@@ -1152,7 +1152,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();
|
|
@@ -1255,7 +1255,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
this.setRemainingFireTicks(-this.getFireImmuneTicks());
|
|
}
|
|
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
}
|
|
}
|
|
}
|
|
@@ -3143,7 +3143,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);
|
|
|
|
@@ -3155,7 +3155,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
}
|
|
|
|
- worldserver.getProfiler().pop();
|
|
+ //worldserver.getProfiler().pop(); // Purpur
|
|
} else if (this.portalProcess.hasExpired()) {
|
|
this.portalProcess = null;
|
|
}
|
|
@@ -3656,7 +3656,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) {
|
|
@@ -3692,7 +3692,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 a9833d805aa51755a15fd98ca546c119e7e4bdf9..c8c931135133ef3d1d491034d578d9af47d9a9bd 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
|
|
@@ -3217,10 +3217,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;
|
|
@@ -3232,7 +3232,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;
|
|
@@ -3472,19 +3472,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;
|
|
|
|
@@ -3511,8 +3511,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();
|
|
@@ -3537,8 +3537,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();
|
|
|
|
@@ -3555,15 +3555,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 6dfb13eef96ff43d368cd8163ae5883571cec604..a07cadcbd73f7058a5cf8535fb317ac0e493eeeb 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -370,13 +370,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
|
|
}
|
|
|
|
@@ -706,7 +706,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()));
|
|
@@ -726,7 +726,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
}
|
|
}
|
|
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().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 = 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 74d4f653d5c7f1923c59019effd78337402f7025..b4e4670536f6dcea109c029d75d9710cb386f1d0 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 49dccfc0010b5727250f7e27591502408c903739..37bdc1bd1ce7f402418b1e8c57c6f58540571ec2 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
|
|
@@ -254,13 +254,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 6e01e5847396e14ce1d9af53f1ed29ef360d1b31..ef69b630d93b4e630083b852b126b6d939cb5f07 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
|
|
@@ -158,12 +158,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 93e5fd3509dc5fd9ff1087058d98003ab467dd04..44e0c8c25f6aadfb5f1715df4770391da0104381 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
|
|
@@ -308,13 +308,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 260138fcf0191391b68cb9d03cc55e26873bc001..2fcf8301949ff420ae0955a5194b5db52f030454 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
|
|
@@ -151,14 +151,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 14264a491061ef17c9fd3fea36c0505d06e88277..072f6ea6ed0bb543b1d71628a1e1e43f73719a09 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
|
|
@@ -504,11 +504,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 541acd5d2208b64977f33049cc0cbd9f8c136ccb..41c17c92bf5ec63ab6e0325936dbe52606524c60 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
|
@@ -265,10 +265,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 9fcdc3dc71240450b983a071e21f24d497aa06e6..ee1fcffc3f94795ea0c53d9e9a5d1d28380321ef 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
|
|
@@ -192,10 +192,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 eb0deccb2f39dbe5ad47c689b0858b69fc08782f..44b64c00d43a40f66d2711abf3839c5b195f419f 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
|
|
@@ -327,10 +327,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 71d2501e88a99819ef305fa8715418aad65ec81d..407a0f27719d3944b3a005c664d80246ea1c7cf4 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
|
|
@@ -138,10 +138,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 2b55f05b727f862ea79ab2c200a756f663b43823..ef6d82593d18533ad6b67bc0ae304d98270fbfd8 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
|
@@ -341,7 +341,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
|
|
@@ -357,7 +357,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 bff83fe413c7baef4ba56a3270ea4463a58c792f..3ee7bf7e10f8120258baaae8f77cdcbb6a781f78 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -350,7 +350,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);
|
|
@@ -428,7 +428,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 2fc472df25f61528e04f5f41e0fc179a3f4151fb..91106cab35f1b219e28e833b7a0735fb0e016bb5 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -268,7 +268,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);
|
|
@@ -278,7 +278,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);
|
|
@@ -984,9 +984,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()) {
|
|
@@ -1022,7 +1022,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
|
|
}
|
|
|
|
@@ -1226,7 +1226,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<>();
|
|
|
|
@@ -1252,7 +1252,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) {
|
|
@@ -1547,6 +1547,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 2812505185df691e8f08932aa0bba162a7d9db86..35e94c06361795d032f995e8282f8b35c075dae7 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 1a57806714e347ab4efe12f5f7782c2167a439a2..5d67b0fb6e979133d80c852d0c8d9fe02e2f97d2 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -449,11 +449,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();
|
|
@@ -1106,9 +1106,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);
|
|
|
|
@@ -1125,7 +1125,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();
|
|
}
|