mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@7f7d05a [ci skip] Remove IRC link from the README (#10194) PaperMC/Paper@ed130f1 [ci skip] clarify javadocs for Block#getDrops (#10153) PaperMC/Paper@4643b0d Shulker duplicate event (#10135) PaperMC/Paper@b333831 Make spawn egg colours visible (#10158) PaperMC/Paper@0cc3a7e Disable memory reserve allocating (#10180) PaperMC/Paper@3841722 Properly check if a loot table exists (#10190) PaperMC/Paper@b3c8108 [ci skip] Fix incorrect documentation for BlockDropItemEvent (#10175) Pufferfish Changes: pufferfish-gg/Pufferfish@3fc02bb Updated Upstream (Paper) pufferfish-gg/Pufferfish@f5fa99a Oops
1985 lines
102 KiB
Diff
1985 lines
102 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Sat, 16 Jul 2022 21:37:10 -0500
|
|
Subject: [PATCH] Remove Mojang Profiler
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
|
index 0026235782aeb5e663faa3aaf11040635cd12204..48a4f26eec06777b4ae165db6566c1f6198527fd 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);
|
|
@@ -332,9 +332,9 @@ public class Commands {
|
|
public void performCommand(ParseResults<CommandSourceStack> parseresults, String s, String label) { // CraftBukkit
|
|
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 {
|
|
@@ -363,7 +363,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 05e1c94268cf5c6897807cd7acced652856a09ea..d1c7effca3592a234925657136f750717d696873 100644
|
|
--- a/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java
|
|
+++ b/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java
|
|
@@ -43,9 +43,9 @@ public class BuildContexts<T extends ExecutionCommandSource<T>> {
|
|
ChainModifiers chainModifiers = flags;
|
|
List<T> list = sources;
|
|
if (contextChain.getStage() != Stage.EXECUTE) {
|
|
- context.profiler().push(() -> {
|
|
+ /*context.profiler().push(() -> { // Purpur
|
|
return "prepare " + this.commandInput;
|
|
- });
|
|
+ });*/ // Purpur
|
|
|
|
try {
|
|
for(int i = context.forkLimit(); contextChain.getStage() != Stage.EXECUTE; contextChain = contextChain.nextStage()) {
|
|
@@ -88,7 +88,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 821dc4aeaf48460000682604fba51b340b9738e7..3aa2ce6a2a3d3cdfc372a60419a09f49002339da 100644
|
|
--- a/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java
|
|
+++ b/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java
|
|
@@ -23,9 +23,9 @@ public class ExecuteCommand<T extends ExecutionCommandSource<T>> implements Unbo
|
|
|
|
@Override
|
|
public void execute(T executionCommandSource, ExecutionContext<T> executionContext, Frame frame) {
|
|
- executionContext.profiler().push(() -> {
|
|
+ /*executionContext.profiler().push(() -> { // Purpur
|
|
return "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 6e996eef388bb154fde7ae285375900e9e7a2f6c..1c416ff1bb7cdbf361c096987705bc55e9837dab 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -341,13 +341,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();
|
|
@@ -966,9 +966,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
|
|
@@ -1223,20 +1223,20 @@ 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);
|
|
- this.profiler.popPush("nextTickWait");
|
|
+ //this.profiler.popPush("nextTickWait"); // Purpur
|
|
this.mayHaveDelayedTasks = true;
|
|
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
|
|
// Pufferfish start - tps catchup
|
|
@@ -1257,8 +1257,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.tickRateManager.endTickWork();
|
|
}
|
|
|
|
- this.profiler.pop();
|
|
- this.endMetricsRecordingTick();
|
|
+ //this.profiler.pop(); // Purpur
|
|
+ //this.endMetricsRecordingTick(); // Purpur
|
|
this.isReady = true;
|
|
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
|
|
}
|
|
@@ -1484,7 +1484,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);
|
|
}
|
|
|
|
@@ -1557,7 +1557,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
if (playerSaveInterval < 0) {
|
|
playerSaveInterval = autosavePeriod;
|
|
}
|
|
- this.profiler.push("save");
|
|
+ //this.profiler.push("save"); // Purpur
|
|
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
|
try {
|
|
this.isSaving = true;
|
|
@@ -1572,7 +1572,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
} finally {
|
|
this.isSaving = false;
|
|
}
|
|
- this.profiler.pop();
|
|
+ //this.profiler.pop(); // Purpur
|
|
// Paper end - Incremental chunk and player saving
|
|
io.papermc.paper.util.CachedLists.reset(); // Paper
|
|
// Paper start - move executeAll() into full server tick timing
|
|
@@ -1585,7 +1585,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;
|
|
|
|
@@ -1601,7 +1601,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
tickTimes60s.add(this.tickCount, j);
|
|
// Paper end - Add tick times API and /mspt command
|
|
this.logTickTime(l - i);
|
|
- this.profiler.pop();
|
|
+ //this.profiler.pop(); // Purpur
|
|
org.spigotmc.WatchdogThread.tick(); // Spigot
|
|
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
|
|
}
|
|
@@ -1683,11 +1683,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
|
|
@@ -1730,18 +1730,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
|
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
|
|
|
- this.profiler.push(() -> {
|
|
+ /*this.profiler.push(() -> { // Purpur
|
|
return worldserver + " " + 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
|
|
@@ -1759,17 +1759,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
|
|
@@ -1777,7 +1777,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) {
|
|
@@ -1785,7 +1785,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()) {
|
|
@@ -1795,7 +1795,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
entityplayer.connection.resumeFlushing();
|
|
}
|
|
|
|
- this.profiler.pop();
|
|
+ //this.profiler.pop(); // Purpur
|
|
}
|
|
|
|
private void synchronizeTime(ServerLevel world) {
|
|
@@ -1803,7 +1803,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()) {
|
|
@@ -1812,7 +1812,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.synchronizeTime(worldserver);
|
|
}
|
|
|
|
- this.profiler.pop();
|
|
+ //this.profiler.pop(); // Purpur
|
|
}
|
|
|
|
public boolean isNetherEnabled() {
|
|
@@ -2476,7 +2476,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
|
|
public ProfilerFiller getProfiler() {
|
|
- if (gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE;
|
|
+ if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
|
|
return this.profiler;
|
|
}
|
|
|
|
@@ -2716,7 +2716,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"));
|
|
@@ -2726,40 +2726,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
|
|
}
|
|
|
|
private 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) {
|
|
@@ -2808,15 +2808,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 df0c15f6b5b2224d53e4f8fad42b9a1e5f33dc25..5dd0dcb47211cec69189115bf4eab1dffc3ca8cf 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 " + function.id();
|
|
- });
|
|
+ });*/ // Purpur
|
|
|
|
try {
|
|
InstantiatedFunction<CommandSourceStack> instantiatedfunction = function.instantiate((CompoundTag) null, this.getDispatcher(), source);
|
|
@@ -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 c6c4d6cf59742b555af5469eaf751ebef753e249..06554a000da1f6ba7360fa907deeead7341b09ea 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
@@ -538,20 +538,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
}
|
|
|
|
protected void tick(BooleanSupplier shouldKeepTicking) {
|
|
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
|
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur
|
|
|
|
//try (Timing ignored = this.level.timings.poiUnload.startTiming()) { // Paper // Purpur
|
|
- gameprofilerfiller.push("poi");
|
|
+ //gameprofilerfiller.push("poi"); // Purpur
|
|
this.poiManager.tick(shouldKeepTicking);
|
|
//} // Paper // Purpur
|
|
- gameprofilerfiller.popPush("chunk_unload");
|
|
+ //gameprofilerfiller.popPush("chunk_unload"); // Purpur
|
|
if (!this.level.noSave()) {
|
|
//try (Timing ignored = this.level.timings.chunkUnload.startTiming()) { // Paper // Purpur
|
|
this.processUnloads(shouldKeepTicking);
|
|
//} // Paper // Purpur
|
|
}
|
|
|
|
- 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 bbc3153379d7da8b4d91c49a3ba83d4415a7671a..6167ffb1263a1a65b582b7d295d1d77ef38c3ee3 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
@@ -264,16 +264,16 @@ public class ServerChunkCache extends ChunkSource {
|
|
return ifLoaded;
|
|
}
|
|
// Paper end - Perf: Optimise getChunkAt calls for loaded chunks
|
|
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
|
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur
|
|
|
|
- gameprofilerfiller.incrementCounter("getChunk");
|
|
+ //gameprofilerfiller.incrementCounter("getChunk"); // Purpur
|
|
long k = ChunkPos.asLong(x, z);
|
|
|
|
ChunkAccess ichunkaccess;
|
|
|
|
// Paper - rewrite chunk system - there are no correct callbacks to remove items from cache in the new chunk system
|
|
|
|
- gameprofilerfiller.incrementCounter("getChunkCacheMiss");
|
|
+ //gameprofilerfiller.incrementCounter("getChunkCacheMiss"); // Purpur
|
|
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create, true); // Paper
|
|
ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor;
|
|
|
|
@@ -467,24 +467,24 @@ public class ServerChunkCache extends ChunkSource {
|
|
// CraftBukkit start - modelled on below
|
|
public void purgeUnload() {
|
|
if (true) return; // Paper - tickets will be removed later, this behavior isn't really well accounted for by the chunk system
|
|
- this.level.getProfiler().push("purge");
|
|
+ //this.level.getProfiler().push("purge"); // Purpur
|
|
this.distanceManager.purgeStaleTickets();
|
|
this.runDistanceManagerUpdates();
|
|
- this.level.getProfiler().popPush("unload");
|
|
+ //this.level.getProfiler().popPush("unload"); // Purpur
|
|
this.chunkMap.tick(() -> true);
|
|
- this.level.getProfiler().pop();
|
|
+ //this.level.getProfiler().pop(); // Purpur
|
|
this.clearCache();
|
|
}
|
|
// CraftBukkit end
|
|
|
|
@Override
|
|
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
|
|
- this.level.getProfiler().push("purge");
|
|
+ //this.level.getProfiler().push("purge"); // Purpur
|
|
//this.level.timings.doChunkMap.startTiming(); // Spigot // Purpur
|
|
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
|
|
this.chunkMap.level.playerChunkLoader.tick(); // Paper - replace player chunk loader - this is mostly required to account for view distance changes
|
|
@@ -494,10 +494,10 @@ public class ServerChunkCache extends ChunkSource {
|
|
}
|
|
|
|
//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();
|
|
}
|
|
|
|
@@ -507,10 +507,10 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
this.lastInhabitedUpdate = i;
|
|
if (!this.level.isDebug()) {
|
|
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
|
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur
|
|
|
|
- gameprofilerfiller.push("pollingChunks");
|
|
- gameprofilerfiller.push("filteringLoadedChunks");
|
|
+ //gameprofilerfiller.push("pollingChunks"); // Purpur
|
|
+ //gameprofilerfiller.push("filteringLoadedChunks"); // Purpur
|
|
// Paper - optimise chunk tick iteration
|
|
//if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur
|
|
|
|
@@ -518,7 +518,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
this.level.resetIceAndSnowTick(); // Pufferfish - reset ice & snow tick random
|
|
if (this.level.getServer().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
|
|
@@ -552,7 +552,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
// this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
|
|
|
|
// this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
|
|
- gameprofilerfiller.popPush("spawnAndTick");
|
|
+ //gameprofilerfiller.popPush("spawnAndTick"); // Purpur
|
|
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
|
|
|
// Paper start - optimise chunk tick iteration
|
|
@@ -660,7 +660,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
// Paper end - optimise chunk tick iteration
|
|
// 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);
|
|
@@ -668,7 +668,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
}
|
|
}
|
|
|
|
- gameprofilerfiller.popPush("broadcast");
|
|
+ //gameprofilerfiller.popPush("broadcast"); // Purpur
|
|
// Paper - optimise chunk tick iteration
|
|
//this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur
|
|
// Paper start - optimise chunk tick iteration
|
|
@@ -686,8 +686,8 @@ public class ServerChunkCache extends ChunkSource {
|
|
// Paper end - optimise chunk tick iteration
|
|
//this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur
|
|
// Paper - optimise chunk tick iteration
|
|
- gameprofilerfiller.pop();
|
|
- gameprofilerfiller.pop();
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
}
|
|
|
|
// Pufferfish start - optimize mob spawning
|
|
@@ -893,7 +893,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
@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 b4b256721b7a5d25deec717123501a163fcfd8fe..75b3de5c1e26815aa04dba3f09f2ef7807767154 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -824,16 +824,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
@@ -865,30 +865,30 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
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, 65536, this::tickBlock);
|
|
- gameprofilerfiller.popPush("fluidTicks");
|
|
+ //gameprofilerfiller.popPush("fluidTicks"); // Purpur
|
|
this.fluidTicks.tick(j, 65536, this::tickFluid);
|
|
- 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();
|
|
@@ -896,7 +896,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
}
|
|
|
|
this.handlingTick = false;
|
|
- gameprofilerfiller.pop();
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
boolean flag1 = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
|
|
|
|
if (flag1) {
|
|
@@ -904,12 +904,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
}
|
|
|
|
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
|
|
@@ -920,9 +920,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
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 - now always true if in the ticking list
|
|
Entity entity1 = entity.getVehicle();
|
|
|
|
@@ -934,7 +934,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
entity.stopRiding();
|
|
}
|
|
|
|
- gameprofilerfiller.push("tick");
|
|
+ //gameprofilerfiller.push("tick"); // Purpur
|
|
// Pufferfish start - copied from this.guardEntityTick
|
|
try {
|
|
this.tickNonPassenger(entity); // Pufferfish - changed
|
|
@@ -949,20 +949,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
// Paper end
|
|
}
|
|
// Pufferfish end
|
|
- 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
|
|
//this.entityManager.tick(); // Paper - rewrite chunk system
|
|
- gameprofilerfiller.pop();
|
|
}
|
|
|
|
@Override
|
|
@@ -1044,9 +1043,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
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
|
|
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
|
|
|
|
if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && /*this.random.nextInt(this.spigotConfig.thunderChance) == 0 &&*/ chunk.shouldDoLightning(this.random)) { // Spigot // Paper - Option to disable thunder // Pufferfish - replace random with shouldDoLightning
|
|
@@ -1085,7 +1084,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
}
|
|
}
|
|
|
|
- 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) {
|
|
@@ -1098,7 +1097,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
}
|
|
} // Paper - Option to disable ice and snow
|
|
|
|
- gameprofilerfiller.popPush("tickBlocks");
|
|
+ //gameprofilerfiller.popPush("tickBlocks"); // Purpur
|
|
//timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
|
|
if (randomTickSpeed > 0) {
|
|
// Paper start - optimize random block ticking
|
|
@@ -1134,7 +1133,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
// Paper end - optimise random block ticking
|
|
|
|
//timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
|
|
- gameprofilerfiller.pop();
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
}
|
|
|
|
@VisibleForTesting
|
|
@@ -1481,19 +1480,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
//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();
|
|
|
|
@@ -1522,12 +1521,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
// 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();
|
|
@@ -1539,7 +1538,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
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 620b7937b03ba178b3fc70b542962b12ce0d3bac..a3b3d85ff56a050219d2997955d088724132e988 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -1240,7 +1240,7 @@ public class ServerPlayer extends Player {
|
|
PortalInfo shapedetectorshape = this.findDimensionEntryPoint(worldserver);
|
|
|
|
if (shapedetectorshape != null) {
|
|
- worldserver1.getProfiler().push("moving");
|
|
+ //worldserver1.getProfiler().push("moving"); // Purpur
|
|
worldserver = shapedetectorshape.world; // CraftBukkit
|
|
if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event
|
|
if (resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit
|
|
@@ -1263,8 +1263,8 @@ public class ServerPlayer extends Player {
|
|
worldserver = ((CraftWorld) exit.getWorld()).getHandle();
|
|
// CraftBukkit end
|
|
|
|
- worldserver1.getProfiler().pop();
|
|
- worldserver1.getProfiler().push("placing");
|
|
+ //worldserver1.getProfiler().pop(); // Purpur
|
|
+ //worldserver1.getProfiler().push("placing"); // Purpur
|
|
if (true) { // CraftBukkit
|
|
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
|
|
|
|
@@ -1282,7 +1282,7 @@ public class ServerPlayer extends Player {
|
|
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
|
|
this.connection.resetPosition();
|
|
worldserver.addDuringPortalTeleport(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 6d9dea1dbd47df98ea44881deb6b7493edbdbd5d..02e65b0bd212d46855baee48fab35dc95a88b43f 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
@@ -222,7 +222,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();
|
|
@@ -258,7 +258,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
|
|
}
|
|
|
|
public void suspendFlushing() {
|
|
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 9ddbfcf80d9a381dace78a62880f85a4d767e0eb..7383c7d3820dce06108eaafd236a7c6c06a10a42 100644
|
|
--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
@@ -9,11 +9,11 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener
|
|
@Override
|
|
default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, 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 196c7331138fee2822c76aacd136f9da040e0049..c6c30d99399c5cde2b0ec2f320d81d952b422d78 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("Profiler tick ended before path was fully popped (remainder: '{}'). Mismatched push/pop?", LogUtils.defer(() -> {
|
|
@@ -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 2e6e8eac987c4ef6b2dcd3de592d8a51d2b29792..863343a87fe34d72f04af89d75268b477b2adc7a 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(final ProfilerFiller a, final 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 6a3fa8bec23e2405091eae560c1edef02023a8a9..eb36f7a9e0f0def9a42947e3b056e6986a57efd9 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -848,7 +848,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
// 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.feetBlockState = null;
|
|
if (this.isPassenger() && this.getVehicle().isRemoved()) {
|
|
@@ -909,7 +909,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
}
|
|
|
|
this.firstTick = false;
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
}
|
|
|
|
public void setSharedFlagOnFire(boolean onFire) {
|
|
@@ -1129,7 +1129,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
}
|
|
}
|
|
|
|
- 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;
|
|
@@ -1138,7 +1138,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
// Paper start - ignore movement changes while inactive.
|
|
if (isTemporarilyActive && !(this instanceof ItemEntity || this instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) && movement == getDeltaMovement() && movementType == MoverType.SELF) {
|
|
setDeltaMovement(Vec3.ZERO);
|
|
- this.level.getProfiler().pop();
|
|
+ //this.level.getProfiler().pop(); // Purpur
|
|
return;
|
|
}
|
|
// Paper end
|
|
@@ -1159,8 +1159,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
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);
|
|
|
|
@@ -1179,7 +1179,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
|
|
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();
|
|
@@ -1317,7 +1317,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
this.setRemainingFireTicks(-this.getFireImmuneTicks());
|
|
}
|
|
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
}
|
|
}
|
|
// Paper start - detailed watchdog information
|
|
@@ -3185,7 +3185,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
ServerLevel worldserver1 = minecraftserver.getLevel(resourcekey);
|
|
|
|
if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit
|
|
- this.level().getProfiler().push("portal");
|
|
+ //this.level().getProfiler().push("portal"); // Purpur
|
|
this.portalTime = i;
|
|
// Paper start - Add EntityPortalReadyEvent
|
|
io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER);
|
|
@@ -3203,7 +3203,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
}
|
|
} // Paper - Add EntityPortalReadyEvent
|
|
// CraftBukkit end
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
}
|
|
|
|
this.isInsidePortal = false;
|
|
@@ -3678,14 +3678,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
}
|
|
// Paper end - Fix item duplication and teleport issues
|
|
if (this.level() instanceof ServerLevel && !this.isRemoved()) {
|
|
- this.level().getProfiler().push("changeDimension");
|
|
+ //this.level().getProfiler().push("changeDimension"); // Purpur
|
|
// CraftBukkit start
|
|
// this.unRide();
|
|
if (worldserver == null) {
|
|
return null;
|
|
}
|
|
// CraftBukkit end
|
|
- this.level().getProfiler().push("reposition");
|
|
+ //this.level().getProfiler().push("reposition"); // Purpur
|
|
PortalInfo shapedetectorshape = (location == null) ? this.findDimensionEntryPoint(worldserver) : new PortalInfo(new Vec3(location.x(), location.y(), location.z()), Vec3.ZERO, this.yRot, this.xRot, worldserver, null); // CraftBukkit
|
|
|
|
if (shapedetectorshape == null) {
|
|
@@ -3724,7 +3724,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
this.unRide();
|
|
// CraftBukkit end
|
|
|
|
- this.level().getProfiler().popPush("reloading");
|
|
+ //this.level().getProfiler().popPush("reloading"); // Purpur
|
|
// Paper start - Fix item duplication and teleport issues
|
|
if (this instanceof Mob) {
|
|
((Mob) this).dropLeash(true, true); // Paper drop lead
|
|
@@ -3751,10 +3751,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
}
|
|
|
|
this.removeAfterChangingDimensions();
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
((ServerLevel) this.level()).resetEmptyTime();
|
|
worldserver.resetEmptyTime();
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
return entity;
|
|
}
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index 87c4e2ef041238f84a00f2b032ed10c3f250eb0d..66abff00db43413b07d51d48654eab7be821bc93 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -409,7 +409,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();
|
|
}
|
|
@@ -512,7 +512,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
|
|
}
|
|
|
|
public boolean canSpawnSoulSpeedParticle() {
|
|
@@ -3165,10 +3165,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;
|
|
@@ -3180,7 +3180,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;
|
|
@@ -3475,19 +3475,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;
|
|
|
|
@@ -3514,8 +3514,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();
|
|
@@ -3542,8 +3542,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();
|
|
|
|
@@ -3560,15 +3560,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 2cf0d698b341d418d0ac4760f95e3ea52c193098..11062e250657cb839ca046d6c224647915d3ee7b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -367,13 +367,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
@Override
|
|
public void baseTick() {
|
|
super.baseTick();
|
|
- this.level().getProfiler().push("mobBaseTick");
|
|
+ //this.level().getProfiler().push("mobBaseTick"); // Purpur
|
|
if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) {
|
|
this.resetAmbientSoundTime();
|
|
this.playAmbientSound();
|
|
}
|
|
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
incrementTicksSinceLastInteraction(); // Purpur
|
|
}
|
|
|
|
@@ -704,7 +704,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- this.level().getProfiler().push("looting");
|
|
+ //this.level().getProfiler().push("looting"); // Purpur
|
|
if (!this.level().isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) {
|
|
Vec3i baseblockposition = this.getPickupReach();
|
|
List<ItemEntity> list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ()));
|
|
@@ -724,7 +724,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
}
|
|
}
|
|
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
}
|
|
|
|
protected Vec3i getPickupReach() {
|
|
@@ -936,46 +936,46 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
return;
|
|
}
|
|
// Paper end - Allow nerfed mobs to jump and float
|
|
- this.level().getProfiler().push("sensing");
|
|
+ //this.level().getProfiler().push("sensing"); // Purpur
|
|
this.sensing.tick();
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
int i = this.level().getServer().getTickCount() + this.getId();
|
|
|
|
if (i % 2 != 0 && this.tickCount > 1) {
|
|
- this.level().getProfiler().push("targetSelector");
|
|
+ //this.level().getProfiler().push("targetSelector"); // Purpur
|
|
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
|
this.targetSelector.tickRunningGoals(false);
|
|
- this.level().getProfiler().pop();
|
|
- this.level().getProfiler().push("goalSelector");
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
+ //this.level().getProfiler().push("goalSelector"); // Purpur
|
|
if (this.goalSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
|
this.goalSelector.tickRunningGoals(false);
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
} else {
|
|
- this.level().getProfiler().push("targetSelector");
|
|
+ //this.level().getProfiler().push("targetSelector"); // Purpur
|
|
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
|
this.targetSelector.tick();
|
|
- this.level().getProfiler().pop();
|
|
- this.level().getProfiler().push("goalSelector");
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
+ //this.level().getProfiler().push("goalSelector"); // Purpur
|
|
if (this.goalSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
|
this.goalSelector.tick();
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
}
|
|
|
|
- this.level().getProfiler().push("navigation");
|
|
+ //this.level().getProfiler().push("navigation"); // Purpur
|
|
this.navigation.tick();
|
|
- this.level().getProfiler().pop();
|
|
- this.level().getProfiler().push("mob tick");
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
+ //this.level().getProfiler().push("mob tick"); // Purpur
|
|
this.customServerAiStep();
|
|
- this.level().getProfiler().pop();
|
|
- this.level().getProfiler().push("controls");
|
|
- this.level().getProfiler().push("move");
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
+ //this.level().getProfiler().push("controls"); // Purpur
|
|
+ //this.level().getProfiler().push("move"); // Purpur
|
|
this.moveControl.tick();
|
|
- this.level().getProfiler().popPush("look");
|
|
+ //this.level().getProfiler().popPush("look"); // Purpur
|
|
this.lookControl.tick();
|
|
- this.level().getProfiler().popPush("jump");
|
|
+ //this.level().getProfiler().popPush("jump"); // Purpur
|
|
this.jumpControl.tick();
|
|
- this.level().getProfiler().pop();
|
|
- this.level().getProfiler().pop();
|
|
+ //this.level().getProfiler().pop(); // Purpur
|
|
+ //this.level().getProfiler().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 2d63ee8fef87264d4b61290effa6ba86a787aa61..bb068bffc9e2f035dee90276156129ce750a7cd7 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
|
|
@@ -105,8 +105,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())) {
|
|
@@ -123,8 +123,8 @@ public class GoalSelector {
|
|
}
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("goalUpdate");
|
|
+ //profilerFiller.pop(); // Purpur
|
|
+ //profilerFiller.push("goalUpdate"); // Purpur
|
|
|
|
for(WrappedGoal wrappedGoal2 : this.availableGoals) {
|
|
// Paper start
|
|
@@ -144,13 +144,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())) {
|
|
@@ -158,7 +158,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 a04fb58c29b462e20ed0b702cef478e3985b7cd2..43699f94dd0fd97513242fcdbc4ec4d0dc260f8e 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
|
|
@@ -173,12 +173,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 09f796ec491f21520e1fcc454249e4696dad3b1b..9bf06cf7b3706f8883e1a0ceac8b1aebb52ba475 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
|
|
@@ -259,13 +259,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
private int behaviorTick = 0; // Pufferfish
|
|
@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
|
|
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/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
index e73d7b47327da59dbf49c2160acd0b3ebb2a4232..472b76d6ec721fa46857097589aa879f237e3e0d 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
|
|
@@ -315,13 +315,13 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder<Axolo
|
|
private int behaviorTick = 0; // Pufferfish
|
|
@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
|
|
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 d1ada87d222e5b35c2df5a0e7b0075ec3413fa66..fb50a3f3665cca4bb2e586fbd73c580a5d691f69 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
|
|
@@ -158,13 +158,13 @@ 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> brain = (Brain<Camel>) this.getBrain(); // Paper - decompile fix
|
|
brain.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 3be70e054c658d34c4aa598ff70c63fa2cff7982..d6340d0a1308bafd3ba176562bf08dcadec02b34 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
|
|
@@ -215,13 +215,13 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
|
private int behaviorTick = 0; // Pufferfish
|
|
@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
|
|
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 3103df74b7ae5a5ed841bf97794284cd43ad59de..14135dac80dec4224715e21cef6556d22e569026 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
|
|
@@ -117,12 +117,12 @@ public class Tadpole extends AbstractFish {
|
|
private int behaviorTick = 0; // Pufferfish
|
|
@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
|
|
- 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 f7730ec3a6c8818baf2a7a738e5a49a56d17c0e8..566f117ba6742ba17ffb8a2673a8c320c39549f7 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
|
@@ -226,13 +226,13 @@ public class Goat extends Animal {
|
|
private int behaviorTick = 0; // Pufferfish
|
|
@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
|
|
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 4d1071546f523c63b9c981e90a09393e9e4400fa..5e7d76dcdc170b809ab82f6e2259c9b4d3d741be 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
|
|
@@ -517,11 +517,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 15fd1af0773ba1254a429240444f48e68e29ee74..1d36459ee10da702d65b4a6d139a05fdd487556f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
|
@@ -232,10 +232,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 ab183a7d94a27d5235ff33ce7784c92d66d40b89..94431d5c789a9f558c16c0d1fc8f1f7463421ec6 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
|
|
@@ -200,10 +200,10 @@ 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().pop();
|
|
+ // this.level().getProfiler().popPush("breezeActivityUpdate"); // Purpur
|
|
+ // 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 510ee1aee1dd106b5129c375ebb59c7950b8b989..5c160d6aa4e3d51c1161f82e92e5e8c1e809a574 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
|
|
@@ -168,10 +168,10 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
|
private int behaviorTick; // Pufferfish
|
|
@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
|
|
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 141fa7d4e1b81e90f4d63a3459c9a72bc595d30b..1422c0f4ff6a3e61f229574cd7b50971bdbd8451 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
|
|
@@ -335,10 +335,10 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
|
private int behaviorTick; // Pufferfish
|
|
@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
|
|
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 61e8f2d030fc50840c3f80dfb6fc810797ec440f..856e6e02c9424a6c06e310262cb4f5bdd34da516 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
|
|
@@ -117,10 +117,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 384e7b29215cadfa40af07a183a9c9c6a5b4a80a..bf7ef72a7d92db8f11789a69583270644de0dac7 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
|
|
@@ -302,10 +302,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
|
|
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 857d1d80afd35d30a2947b0a6f953e5af1516048..18f92478f07de7c941ff8bbe0ec2ef2fe3617fd7 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
|
@@ -343,7 +343,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
|
|
@@ -355,7 +355,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
|
this.getBrain().tick((ServerLevel) this.level(), this); // Paper
|
|
} else if (this.isLobotomized && shouldRestock()) restock();
|
|
// Purpur end
|
|
- 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 28ef910885dbd48965fba6f08cec412697b1b7f0..02dae407069a0200e271cc9c6f3ec6ff80f79025 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -659,7 +659,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);
|
|
@@ -735,7 +735,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 81a38b3384f6c0111d3e10397d21aba3f2d57325..c37b1fb81e6e8a8af5d17420892ee930b31ca019 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -1310,9 +1310,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
}
|
|
|
|
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()) {
|
|
@@ -1353,7 +1353,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
//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
|
|
}
|
|
|
|
@@ -1563,7 +1563,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
@Override
|
|
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
|
- this.getProfiler().incrementCounter("getEntities");
|
|
+ //this.getProfiler().incrementCounter("getEntities"); // Purpur
|
|
List<Entity> list = Lists.newArrayList();
|
|
((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call
|
|
return list;
|
|
@@ -1582,7 +1582,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
}
|
|
|
|
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
|
|
- this.getProfiler().incrementCounter("getEntities");
|
|
+ //this.getProfiler().incrementCounter("getEntities"); // Purpur
|
|
// Paper start - optimise this call
|
|
//TODO use limit
|
|
if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) {
|
|
@@ -1841,7 +1841,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
}
|
|
|
|
public ProfilerFiller getProfiler() {
|
|
- if (gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish
|
|
+ if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
|
|
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 3d99667fa297ea15c5d3a0526a846ce177a5037a..a0ab8be389a175b5e6c42798650a06882a7b3886 100644
|
|
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
@@ -132,7 +132,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;
|
|
@@ -187,7 +187,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 8c0df10efd59594c63cca2a1c22386acf17e5299..1b49ecbf8fdbe8b734f8ca5191dc9ed70aa66af7 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -457,11 +457,11 @@ public class LevelChunk extends ChunkAccess {
|
|
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
|
|
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
|
|
|
- gameprofilerfiller.push("updateSkyLightSources");
|
|
+ //gameprofilerfiller.push("updateSkyLightSources"); // Purpur
|
|
// Paper - starlight - remove skyLightSources
|
|
- gameprofilerfiller.popPush("queueCheckLight");
|
|
+ //gameprofilerfiller.popPush("queueCheckLight"); // Purpur
|
|
this.level.getChunkSource().getLightEngine().checkBlock(blockposition);
|
|
- gameprofilerfiller.pop();
|
|
+ //gameprofilerfiller.pop(); // Purpur
|
|
}
|
|
|
|
boolean flag3 = iblockdata1.hasBlockEntity();
|
|
@@ -1174,9 +1174,9 @@ public class LevelChunk extends ChunkAccess {
|
|
|
|
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);
|
|
|
|
@@ -1188,7 +1188,7 @@ public class LevelChunk extends ChunkAccess {
|
|
LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata});
|
|
}
|
|
|
|
- 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 eb18494bd7257fa5eb00dea16cf4d5667b796f2b..f039d6109ee6f55542adc8f30476ba9a9e4974bf 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
|
|
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
|
index 1d7c663fa0e550bd0cfb9a4b83ccd7e2968666f0..0043c0087896a6df6910b0500da37d84b287c901 100644
|
|
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
|
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
|
@@ -86,20 +86,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();
|
|
}
|