mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@4eda045b Backport fix for MC-296337 (Fixes #12617) (#12619) PaperMC/Paper@7ebc94c2 Add Registry#getTagValues (#12603) PaperMC/Paper@e87320d5 Fix UOE when using generateTree with pale oak (#12616) PaperMC/Paper@94f29035 Do not blow up accessing unregistered memories from API (Fixes #12618) (#12639) Purpur Changes: PurpurMC/Purpur@916df1a8 use the correct item reference for retrieving components, closes #1668
2307 lines
110 KiB
Diff
2307 lines
110 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Thu, 22 Dec 2022 22:32:18 +0100
|
|
Subject: [PATCH] Remove vanilla profiler
|
|
|
|
License: MIT (https://opensource.org/licenses/MIT)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Remove Mojang Profiler"
|
|
By: BillyGalbreath <blake.galbreath@gmail.com>
|
|
As part of: Purpur (https://github.com/PurpurMC/Purpur)
|
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
|
|
|
* Purpur copyright *
|
|
|
|
MIT License
|
|
|
|
Copyright (c) 2019-2022 PurpurMC
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|
|
|
|
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
|
index 1927163db5d44383b69f41e4b9855535e853d127..f1a637272a8e4ec9c46209ca6b58a4905c925a86 100644
|
|
--- a/net/minecraft/commands/Commands.java
|
|
+++ b/net/minecraft/commands/Commands.java
|
|
@@ -55,7 +55,6 @@ import net.minecraft.server.commands.CloneCommands;
|
|
import net.minecraft.server.commands.DamageCommand;
|
|
import net.minecraft.server.commands.DataPackCommand;
|
|
import net.minecraft.server.commands.DeOpCommands;
|
|
-import net.minecraft.server.commands.DebugCommand;
|
|
import net.minecraft.server.commands.DebugConfigCommand;
|
|
import net.minecraft.server.commands.DebugMobSpawningCommand;
|
|
import net.minecraft.server.commands.DebugPathCommand;
|
|
@@ -132,7 +131,6 @@ import net.minecraft.server.commands.WorldBorderCommand;
|
|
import net.minecraft.server.commands.data.DataCommands;
|
|
import net.minecraft.server.level.ServerPlayer;
|
|
import net.minecraft.tags.TagKey;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
|
import net.minecraft.world.flag.FeatureFlagSet;
|
|
import net.minecraft.world.flag.FeatureFlags;
|
|
@@ -164,7 +162,6 @@ public class Commands {
|
|
DamageCommand.register(this.dispatcher, context);
|
|
DataCommands.register(this.dispatcher);
|
|
DataPackCommand.register(this.dispatcher);
|
|
- DebugCommand.register(this.dispatcher);
|
|
DefaultGameModeCommands.register(this.dispatcher);
|
|
DifficultyCommand.register(this.dispatcher);
|
|
EffectCommands.register(this.dispatcher, context);
|
|
@@ -349,7 +346,6 @@ public class Commands {
|
|
public void performCommand(ParseResults<CommandSourceStack> parseResults, String command, String label, boolean throwCommandError) {
|
|
// Paper end
|
|
CommandSourceStack commandSourceStack = parseResults.getContext().getSource();
|
|
- Profiler.get().push(() -> "/" + command);
|
|
ContextChain contextChain = this.finishParsing(parseResults, command, commandSourceStack, label); // CraftBukkit // Paper - Add UnknownCommandEvent
|
|
|
|
try {
|
|
@@ -385,8 +381,6 @@ public class Commands {
|
|
commandSourceStack.sendFailure(Component.literal(Util.describeError(var12)));
|
|
LOGGER.error("'/{}' threw an exception", command, var12);
|
|
}
|
|
- } finally {
|
|
- Profiler.get().pop();
|
|
}
|
|
}
|
|
|
|
@@ -443,7 +437,7 @@ public class Commands {
|
|
int max = Math.max(1, server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_CHAIN_LENGTH));
|
|
int _int = server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT);
|
|
|
|
- try (ExecutionContext<CommandSourceStack> executionContext1 = new ExecutionContext<>(max, _int, Profiler.get())) {
|
|
+ try (ExecutionContext<CommandSourceStack> executionContext1 = new ExecutionContext<>(max, _int)) { // Gale - Purpur - remove vanilla profiler
|
|
CURRENT_EXECUTION_CONTEXT.set(executionContext1);
|
|
contextConsumer.accept(executionContext1);
|
|
executionContext1.runCommandQueue();
|
|
diff --git a/net/minecraft/commands/execution/ExecutionContext.java b/net/minecraft/commands/execution/ExecutionContext.java
|
|
index 18c7fff36ca26a659fa8ea022c93ea65f3199181..5844db9e913ccb6a351907875aea2f37c3b4ceea 100644
|
|
--- a/net/minecraft/commands/execution/ExecutionContext.java
|
|
+++ b/net/minecraft/commands/execution/ExecutionContext.java
|
|
@@ -20,7 +20,6 @@ public class ExecutionContext<T> implements AutoCloseable {
|
|
private static final Logger LOGGER = LogUtils.getLogger();
|
|
private final int commandLimit;
|
|
private final int forkLimit;
|
|
- private final ProfilerFiller profiler;
|
|
@Nullable
|
|
private TraceCallbacks tracer;
|
|
private int commandQuota;
|
|
@@ -29,10 +28,9 @@ public class ExecutionContext<T> implements AutoCloseable {
|
|
private final List<CommandQueueEntry<T>> newTopCommands = new ObjectArrayList<>();
|
|
private int currentFrameDepth;
|
|
|
|
- public ExecutionContext(int commandLimit, int forkLimit, ProfilerFiller profiler) {
|
|
+ public ExecutionContext(int commandLimit, int forkLimit) { // Gale - Purpur - remove vanilla profiler
|
|
this.commandLimit = commandLimit;
|
|
this.forkLimit = forkLimit;
|
|
- this.profiler = profiler;
|
|
this.commandQuota = commandLimit;
|
|
}
|
|
|
|
@@ -132,7 +130,7 @@ public class ExecutionContext<T> implements AutoCloseable {
|
|
}
|
|
|
|
public ProfilerFiller profiler() {
|
|
- return this.profiler;
|
|
+ return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Gale - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
public int forkLimit() {
|
|
diff --git a/net/minecraft/commands/execution/tasks/BuildContexts.java b/net/minecraft/commands/execution/tasks/BuildContexts.java
|
|
index 569abbea01f585990d2017c68580257275bbb06d..46cf0f3ab7146ba2f37eb1a3ef97eca864219eae 100644
|
|
--- a/net/minecraft/commands/execution/tasks/BuildContexts.java
|
|
+++ b/net/minecraft/commands/execution/tasks/BuildContexts.java
|
|
@@ -42,9 +42,6 @@ public class BuildContexts<T extends ExecutionCommandSource<T>> {
|
|
ChainModifiers chainModifiers1 = chainModifiers;
|
|
List<T> list = sources;
|
|
if (contextChain.getStage() != Stage.EXECUTE) {
|
|
- context.profiler().push(() -> "prepare " + this.commandInput);
|
|
-
|
|
- try {
|
|
for (int forkLimit = context.forkLimit(); contextChain.getStage() != Stage.EXECUTE; contextChain = contextChain.nextStage()) {
|
|
CommandContext<T> topContext = contextChain.getTopContext();
|
|
if (topContext.isForked()) {
|
|
@@ -84,9 +81,6 @@ public class BuildContexts<T extends ExecutionCommandSource<T>> {
|
|
list = list1;
|
|
}
|
|
}
|
|
- } finally {
|
|
- context.profiler().pop();
|
|
- }
|
|
}
|
|
|
|
if (list.isEmpty()) {
|
|
diff --git a/net/minecraft/commands/execution/tasks/ExecuteCommand.java b/net/minecraft/commands/execution/tasks/ExecuteCommand.java
|
|
index 18071dcc69cc28471dddb7de94e803ec1e5fc2e4..e30bb9c4046200c1a6e4e917d15b205f5e0f21c3 100644
|
|
--- a/net/minecraft/commands/execution/tasks/ExecuteCommand.java
|
|
+++ b/net/minecraft/commands/execution/tasks/ExecuteCommand.java
|
|
@@ -23,7 +23,6 @@ public class ExecuteCommand<T extends ExecutionCommandSource<T>> implements Unbo
|
|
|
|
@Override
|
|
public void execute(T source, ExecutionContext<T> executionContext, Frame frame) {
|
|
- executionContext.profiler().push(() -> "execute " + this.commandInput);
|
|
|
|
try {
|
|
executionContext.incrementCost();
|
|
@@ -34,8 +33,6 @@ public class ExecuteCommand<T extends ExecutionCommandSource<T>> implements Unbo
|
|
}
|
|
} catch (CommandSyntaxException var9) {
|
|
source.handleError(var9, this.modifiers.isForked(), executionContext.tracer());
|
|
- } finally {
|
|
- executionContext.profiler().pop();
|
|
}
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
|
index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..923fc9d611d46017cf7ac8e6de6cf0966e0ce9f9 100644
|
|
--- a/net/minecraft/server/MinecraftServer.java
|
|
+++ b/net/minecraft/server/MinecraftServer.java
|
|
@@ -113,19 +113,8 @@ import net.minecraft.util.TimeUtil;
|
|
import net.minecraft.util.debugchart.RemoteDebugSampleType;
|
|
import net.minecraft.util.debugchart.SampleLogger;
|
|
import net.minecraft.util.debugchart.TpsDebugDimensions;
|
|
-import net.minecraft.util.profiling.EmptyProfileResults;
|
|
-import net.minecraft.util.profiling.ProfileResults;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
-import net.minecraft.util.profiling.ResultField;
|
|
-import net.minecraft.util.profiling.SingleTickProfiler;
|
|
import net.minecraft.util.profiling.jfr.JvmProfiler;
|
|
import net.minecraft.util.profiling.jfr.callback.ProfiledDuration;
|
|
-import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder;
|
|
-import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder;
|
|
-import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder;
|
|
-import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider;
|
|
-import net.minecraft.util.profiling.metrics.storage.MetricsPersister;
|
|
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
|
|
import net.minecraft.world.Difficulty;
|
|
import net.minecraft.world.RandomSequences;
|
|
@@ -198,13 +187,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
public LevelStorageSource.LevelStorageAccess storageSource;
|
|
public final PlayerDataStorage playerDataStorage;
|
|
private final List<Runnable> tickables = Lists.newArrayList();
|
|
- private MetricsRecorder metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
|
- private Consumer<ProfileResults> onMetricsRecordingStopped = results -> this.stopRecordingMetrics();
|
|
- private Consumer<Path> onMetricsRecordingFinished = path -> {};
|
|
- private boolean willStartRecordingMetrics;
|
|
- @Nullable
|
|
- private MinecraftServer.TimeProfiler debugCommandProfiler;
|
|
- private boolean debugCommandProfilerDelayStart;
|
|
private ServerConnectionListener connection;
|
|
public final ChunkProgressListenerFactory progressListenerFactory;
|
|
@Nullable
|
|
@@ -989,9 +971,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
shutdownThread = Thread.currentThread(); // Paper - Improved watchdog support
|
|
org.spigotmc.WatchdogThread.doStop(); // Paper - Improved watchdog support
|
|
// CraftBukkit end
|
|
- if (this.metricsRecorder.isRecording()) {
|
|
- this.cancelRecordingMetrics();
|
|
- }
|
|
|
|
LOGGER.info("Stopping server");
|
|
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
|
@@ -1236,18 +1215,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
// Spigot end
|
|
|
|
boolean flag = l == 0L;
|
|
- if (this.debugCommandProfilerDelayStart) {
|
|
- this.debugCommandProfilerDelayStart = false;
|
|
- this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
|
|
- }
|
|
|
|
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
|
|
lastTick = currentTime;
|
|
this.nextTickTimeNanos += l;
|
|
|
|
- try (Profiler.Scope scope = Profiler.use(this.createProfiler())) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("tick");
|
|
this.tickFrame.start();
|
|
this.tickServer(flag ? () -> false : this::haveTime);
|
|
// Paper start - rewrite chunk system
|
|
@@ -1258,7 +1230,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
// Paper end - rewrite chunk system
|
|
this.tickFrame.end();
|
|
- profilerFiller.popPush("nextTickWait");
|
|
this.mayHaveDelayedTasks = true;
|
|
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
|
|
this.startMeasuringTaskExecutionTime();
|
|
@@ -1268,11 +1239,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.tickRateManager.endTickWork();
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
this.logFullTickTime();
|
|
- } finally {
|
|
- this.endMetricsRecordingTick();
|
|
- }
|
|
|
|
this.isReady = true;
|
|
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
|
|
@@ -1445,7 +1412,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
@Override
|
|
public void doRunTask(TickTask task) {
|
|
- Profiler.get().incrementCounter("runTask");
|
|
super.doRunTask(task);
|
|
}
|
|
|
|
@@ -1535,12 +1501,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
this.ticksUntilAutosave--;
|
|
// Paper start - Incremental chunk and player saving
|
|
- final ProfilerFiller profiler = Profiler.get();
|
|
int playerSaveInterval = io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.rate;
|
|
if (playerSaveInterval < 0) {
|
|
playerSaveInterval = autosavePeriod;
|
|
}
|
|
- profiler.push("save");
|
|
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
|
try {
|
|
this.isSaving = true;
|
|
@@ -1555,10 +1519,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
} finally {
|
|
this.isSaving = false;
|
|
}
|
|
- profiler.pop();
|
|
// Paper end - Incremental chunk and player saving
|
|
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
this.runAllTasks(); // Paper - move runAllTasks() into full server tick (previously for timings)
|
|
this.server.spark.executeMainThreadTasks(); // Paper - spark
|
|
// Paper start - Server Tick Events
|
|
@@ -1567,7 +1529,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
|
|
// Paper end - Server Tick Events
|
|
this.server.spark.tickEnd(((double)(endTime - lastTick) / 1000000D)); // Paper - spark
|
|
- profilerFiller.push("tallying");
|
|
long l = Util.getNanos() - nanos;
|
|
int i1 = this.tickCount % 100;
|
|
this.aggregatedTickTimesNanos = this.aggregatedTickTimesNanos - this.tickTimesNanos[i1];
|
|
@@ -1580,16 +1541,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.tickTimes60s.add(this.tickCount, l);
|
|
// Paper end - Add tick times API and /mspt command
|
|
this.logTickMethodTime(nanos);
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
private void autoSave() {
|
|
this.ticksUntilAutosave = this.autosavePeriod; // CraftBukkit
|
|
LOGGER.debug("Autosave started");
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("save");
|
|
this.saveEverything(true, false, false);
|
|
- profilerFiller.pop();
|
|
LOGGER.debug("Autosave finished");
|
|
}
|
|
|
|
@@ -1655,7 +1612,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
|
|
protected void tickChildren(BooleanSupplier hasTimeLeft) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
this.getPlayerList().getPlayers().forEach(serverPlayer1 -> serverPlayer1.connection.suspendFlushing());
|
|
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
|
// Paper start - Folia scheduler API
|
|
@@ -1673,9 +1629,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
});
|
|
// Paper end - Folia scheduler API
|
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
|
- profilerFiller.push("commandFunctions");
|
|
this.getFunctions().tick();
|
|
- profilerFiller.popPush("levels");
|
|
|
|
// CraftBukkit start
|
|
// Run tasks that are waiting on processing
|
|
@@ -1710,17 +1664,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
serverLevel.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
|
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
|
|
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = serverLevel.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
|
|
- profilerFiller.push(() -> serverLevel + " " + serverLevel.dimension().location());
|
|
/* Drop global time updates
|
|
if (this.tickCount % 20 == 0) {
|
|
- profilerFiller.push("timeSync");
|
|
this.synchronizeTime(serverLevel);
|
|
- profilerFiller.pop();
|
|
}
|
|
// CraftBukkit end */
|
|
|
|
- profilerFiller.push("tick");
|
|
-
|
|
try {
|
|
serverLevel.tick(hasTimeLeft);
|
|
} catch (Throwable var7) {
|
|
@@ -1729,34 +1678,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
throw new ReportedException(crashReport);
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
- profilerFiller.pop();
|
|
serverLevel.explosionDensityCache.clear(); // Paper - Optimize explosions
|
|
}
|
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
|
|
|
- profilerFiller.popPush("connection");
|
|
this.tickConnection();
|
|
- profilerFiller.popPush("players");
|
|
this.playerList.tick();
|
|
if (this.tickRateManager.runsNormally()) {
|
|
GameTestTicker.SINGLETON.tick();
|
|
}
|
|
|
|
- profilerFiller.popPush("server gui refresh");
|
|
-
|
|
for (int i = 0; i < this.tickables.size(); i++) {
|
|
this.tickables.get(i).run();
|
|
}
|
|
|
|
- profilerFiller.popPush("send chunks");
|
|
-
|
|
for (ServerPlayer serverPlayer : this.playerList.getPlayers()) {
|
|
serverPlayer.connection.chunkSender.sendNextChunks(serverPlayer);
|
|
serverPlayer.connection.resumeFlushing();
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
public void tickConnection() {
|
|
@@ -1772,14 +1711,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
|
|
public void forceTimeSynchronization() {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("timeSync");
|
|
-
|
|
for (ServerLevel serverLevel : this.getAllLevels()) {
|
|
this.synchronizeTime(serverLevel);
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
public boolean isLevelEnabled(Level level) {
|
|
@@ -2595,55 +2529,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
// CraftBukkit end
|
|
|
|
- private ProfilerFiller createProfiler() {
|
|
- if (this.willStartRecordingMetrics) {
|
|
- 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")));
|
|
- this.onMetricsRecordingFinished.accept(path);
|
|
- }
|
|
- );
|
|
- this.willStartRecordingMetrics = false;
|
|
- }
|
|
-
|
|
- this.metricsRecorder.startTick();
|
|
- return SingleTickProfiler.decorateFiller(this.metricsRecorder.getProfiler(), SingleTickProfiler.createTickProfiler("Server"));
|
|
- }
|
|
-
|
|
- public void endMetricsRecordingTick() {
|
|
- this.metricsRecorder.endTick();
|
|
- }
|
|
-
|
|
- public boolean isRecordingMetrics() {
|
|
- return this.metricsRecorder.isRecording();
|
|
- }
|
|
-
|
|
- public void startRecordingMetrics(Consumer<ProfileResults> output, Consumer<Path> onMetricsRecordingFinished) {
|
|
- this.onMetricsRecordingStopped = profileResults -> {
|
|
- this.stopRecordingMetrics();
|
|
- output.accept(profileResults);
|
|
- };
|
|
- this.onMetricsRecordingFinished = onMetricsRecordingFinished;
|
|
- this.willStartRecordingMetrics = true;
|
|
- }
|
|
-
|
|
- public void stopRecordingMetrics() {
|
|
- this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
|
- }
|
|
-
|
|
- public void finishRecordingMetrics() {
|
|
- this.metricsRecorder.end();
|
|
- }
|
|
-
|
|
- public void cancelRecordingMetrics() {
|
|
- this.metricsRecorder.cancel();
|
|
- }
|
|
-
|
|
public Path getWorldPath(LevelResource levelResource) {
|
|
return this.storageSource.getLevelPath(levelResource);
|
|
}
|
|
@@ -2693,24 +2578,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
return this.isSaving;
|
|
}
|
|
|
|
- public boolean isTimeProfilerRunning() {
|
|
- return this.debugCommandProfilerDelayStart || this.debugCommandProfiler != null;
|
|
- }
|
|
-
|
|
- public void startTimeProfiler() {
|
|
- this.debugCommandProfilerDelayStart = true;
|
|
- }
|
|
-
|
|
- public ProfileResults stopTimeProfiler() {
|
|
- if (this.debugCommandProfiler == null) {
|
|
- return EmptyProfileResults.EMPTY;
|
|
- } else {
|
|
- ProfileResults profileResults = this.debugCommandProfiler.stop(Util.getNanos(), this.tickCount);
|
|
- this.debugCommandProfiler = null;
|
|
- return profileResults;
|
|
- }
|
|
- }
|
|
-
|
|
public int getMaxChainedNeighborUpdates() {
|
|
return 1000000;
|
|
}
|
|
@@ -2816,55 +2683,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
public record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
|
}
|
|
|
|
- static class TimeProfiler {
|
|
- final long startNanos;
|
|
- final int startTick;
|
|
-
|
|
- TimeProfiler(long startNanos, int startTick) {
|
|
- this.startNanos = startNanos;
|
|
- this.startTick = startTick;
|
|
- }
|
|
-
|
|
- ProfileResults stop(final long endTimeNano, final int endTimeTicks) {
|
|
- return new ProfileResults() {
|
|
- @Override
|
|
- public List<ResultField> getTimes(String sectionPath) {
|
|
- return Collections.emptyList();
|
|
- }
|
|
-
|
|
- @Override
|
|
- public boolean saveResults(Path path) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- @Override
|
|
- public long getStartTimeNano() {
|
|
- return TimeProfiler.this.startNanos;
|
|
- }
|
|
-
|
|
- @Override
|
|
- public int getStartTimeTicks() {
|
|
- return TimeProfiler.this.startTick;
|
|
- }
|
|
-
|
|
- @Override
|
|
- public long getEndTimeNano() {
|
|
- return endTimeNano;
|
|
- }
|
|
-
|
|
- @Override
|
|
- public int getEndTimeTicks() {
|
|
- return endTimeTicks;
|
|
- }
|
|
-
|
|
- @Override
|
|
- public String getProfilerResults() {
|
|
- return "";
|
|
- }
|
|
- };
|
|
- }
|
|
- }
|
|
-
|
|
// Paper start - Add tick times API and /mspt command
|
|
public static class TickTimes {
|
|
private final long[] times;
|
|
diff --git a/net/minecraft/server/ReloadableServerResources.java b/net/minecraft/server/ReloadableServerResources.java
|
|
index c891715968193f2ab4579b4a2b4aeeae6a210070..42326fc40b834c944e714fec91811d5c39dbe40c 100644
|
|
--- a/net/minecraft/server/ReloadableServerResources.java
|
|
+++ b/net/minecraft/server/ReloadableServerResources.java
|
|
@@ -99,7 +99,7 @@ public class ReloadableServerResources {
|
|
backgroundExecutor,
|
|
gameExecutor,
|
|
DATA_RELOAD_INITIAL_TASK,
|
|
- LOGGER.isDebugEnabled()
|
|
+ false // Gale - Purpur - remove vanilla profiler
|
|
)
|
|
.done()
|
|
.thenApply(object -> reloadableServerResources);
|
|
diff --git a/net/minecraft/server/ServerFunctionManager.java b/net/minecraft/server/ServerFunctionManager.java
|
|
index e3cb5d9cd0332c32df82fa6aef37401c523e8af0..10c79570432491bfb2bbfedf0491ab2b803d0c71 100644
|
|
--- a/net/minecraft/server/ServerFunctionManager.java
|
|
+++ b/net/minecraft/server/ServerFunctionManager.java
|
|
@@ -14,8 +14,6 @@ import net.minecraft.commands.execution.ExecutionContext;
|
|
import net.minecraft.commands.functions.CommandFunction;
|
|
import net.minecraft.commands.functions.InstantiatedFunction;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import org.slf4j.Logger;
|
|
|
|
public class ServerFunctionManager {
|
|
@@ -50,19 +48,12 @@ public class ServerFunctionManager {
|
|
}
|
|
|
|
private void executeTagFunctions(Collection<CommandFunction<CommandSourceStack>> functionObjects, ResourceLocation identifier) {
|
|
- Profiler.get().push(identifier::toString);
|
|
-
|
|
for (CommandFunction<CommandSourceStack> commandFunction : functionObjects) {
|
|
this.execute(commandFunction, this.getGameLoopSender());
|
|
}
|
|
-
|
|
- Profiler.get().pop();
|
|
}
|
|
|
|
public void execute(CommandFunction<CommandSourceStack> function, CommandSourceStack source) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push(() -> "function " + function.id());
|
|
-
|
|
try {
|
|
InstantiatedFunction<CommandSourceStack> instantiatedFunction = function.instantiate(null, this.getDispatcher());
|
|
Commands.executeCommandInContext(
|
|
@@ -72,8 +63,6 @@ public class ServerFunctionManager {
|
|
} catch (FunctionInstantiationException var9) {
|
|
} catch (Exception var10) {
|
|
LOGGER.warn("Failed to execute function {}", function.id(), var10);
|
|
- } finally {
|
|
- profilerFiller.pop();
|
|
}
|
|
}
|
|
|
|
diff --git a/net/minecraft/server/commands/DebugCommand.java b/net/minecraft/server/commands/DebugCommand.java
|
|
index b246c9885fd8c9cc0de2fd4faa53e0619dd3865c..b83d07a620d49b2c3741b73f3e41212a9f36fc6e 100644
|
|
--- a/net/minecraft/server/commands/DebugCommand.java
|
|
+++ b/net/minecraft/server/commands/DebugCommand.java
|
|
@@ -67,6 +67,8 @@ public class DebugCommand {
|
|
}
|
|
|
|
private static int start(CommandSourceStack source) throws CommandSyntaxException {
|
|
+ // Gale start - Purpur - remove vanilla profiler
|
|
+ /*
|
|
MinecraftServer server = source.getServer();
|
|
if (server.isTimeProfilerRunning()) {
|
|
throw ERROR_ALREADY_RUNNING.create();
|
|
@@ -75,9 +77,14 @@ public class DebugCommand {
|
|
source.sendSuccess(() -> Component.translatable("commands.debug.started"), true);
|
|
return 0;
|
|
}
|
|
+ */
|
|
+ return 0;
|
|
+ // Gale end - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
private static int stop(CommandSourceStack source) throws CommandSyntaxException {
|
|
+ // Gale start - Purpur - remove vanilla profiler
|
|
+ /*
|
|
MinecraftServer server = source.getServer();
|
|
if (!server.isTimeProfilerRunning()) {
|
|
throw ERROR_NOT_RUNNING.create();
|
|
@@ -93,6 +100,9 @@ public class DebugCommand {
|
|
);
|
|
return (int)d1;
|
|
}
|
|
+ */
|
|
+ return 0;
|
|
+ // Gale end - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
static class TraceCustomExecutor
|
|
diff --git a/net/minecraft/server/commands/PerfCommand.java b/net/minecraft/server/commands/PerfCommand.java
|
|
index a3192400b37274620977e5a40d4283bfec3ab9b3..f23b17416eadc0e800ca34918ac78c031630edb4 100644
|
|
--- a/net/minecraft/server/commands/PerfCommand.java
|
|
+++ b/net/minecraft/server/commands/PerfCommand.java
|
|
@@ -42,6 +42,9 @@ public class PerfCommand {
|
|
}
|
|
|
|
private static int startProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException {
|
|
+ // Gale start - Purpur - remove vanilla profiler
|
|
+ return removedMessage(source);
|
|
+ /*
|
|
MinecraftServer server = source.getServer();
|
|
if (server.isRecordingMetrics()) {
|
|
throw ERROR_ALREADY_RUNNING.create();
|
|
@@ -52,9 +55,14 @@ public class PerfCommand {
|
|
source.sendSuccess(() -> Component.translatable("commands.perf.started"), false);
|
|
return 0;
|
|
}
|
|
+ */
|
|
+ // Gale end - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
private static int stopProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException {
|
|
+ // Gale start - Purpur - remove vanilla profiler
|
|
+ return removedMessage(source);
|
|
+ /*
|
|
MinecraftServer server = source.getServer();
|
|
if (!server.isRecordingMetrics()) {
|
|
throw ERROR_NOT_RUNNING.create();
|
|
@@ -62,8 +70,22 @@ public class PerfCommand {
|
|
server.finishRecordingMetrics();
|
|
return 0;
|
|
}
|
|
+ */
|
|
+ // Gale end - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
+ // Gale start - Purpur - remove vanilla profiler
|
|
+ private static int removedMessage(CommandSourceStack source) {
|
|
+ net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage();
|
|
+
|
|
+ source.getSender().sendMessage(mm.deserialize("<gold>Gale has removed Mojang's Profiler to save your performance. Please use <click:suggest_command:'/spark'><grey>/spark</grey></click> instead"));
|
|
+ source.getSender().sendMessage(mm.deserialize("<gold>For more information, view its documentation at"));
|
|
+ source.getSender().sendMessage(mm.deserialize("<gold><click:open_url:'https://spark.lucko.me/docs/Command-Usage'>https://spark.lucko.me/docs/Command-Usage</click>"));
|
|
+
|
|
+ return 0;
|
|
+ }
|
|
+ // Gale end - Purpur - remove vanilla profiler
|
|
+
|
|
private static void saveResults(CommandSourceStack source, Path path, MinecraftServer server) {
|
|
String string = String.format(
|
|
Locale.ROOT, "%s-%s-%s", Util.getFilenameFormattedDateTime(), server.getWorldData().getLevelName(), SharedConstants.getCurrentVersion().getId()
|
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
|
index 79144689a3eb8ddfe09d5130a1940ff2ef88ccb0..35f55d1830d7929d476a5377f0abc46fac5bfed1 100644
|
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
|
@@ -758,12 +758,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
return this.settings.getProperties().serverResourcePackInfo;
|
|
}
|
|
|
|
- @Override
|
|
- public void endMetricsRecordingTick() {
|
|
- super.endMetricsRecordingTick();
|
|
- this.debugSampleSubscriptionTracker.tick(this.getTickCount());
|
|
- }
|
|
-
|
|
@Override
|
|
public SampleLogger getTickTimeLogger() {
|
|
return this.tickTimeLogger;
|
|
diff --git a/net/minecraft/server/level/ChunkGenerationTask.java b/net/minecraft/server/level/ChunkGenerationTask.java
|
|
index 4221af18f5087badb5cd8c7cf66ab3312edf0394..f102afff61d5577a0f5002f2a52335bd4810f150 100644
|
|
--- a/net/minecraft/server/level/ChunkGenerationTask.java
|
|
+++ b/net/minecraft/server/level/ChunkGenerationTask.java
|
|
@@ -5,8 +5,6 @@ import java.util.List;
|
|
import java.util.concurrent.CompletableFuture;
|
|
import javax.annotation.Nullable;
|
|
import net.minecraft.util.StaticCache2D;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.Zone;
|
|
import net.minecraft.world.level.ChunkPos;
|
|
import net.minecraft.world.level.chunk.ChunkAccess;
|
|
import net.minecraft.world.level.chunk.status.ChunkDependencies;
|
|
@@ -113,8 +111,6 @@ public class ChunkGenerationTask {
|
|
}
|
|
|
|
private void scheduleLayer(ChunkStatus status, boolean needsGeneration) {
|
|
- try (Zone zone = Profiler.get().zone("scheduleLayer")) {
|
|
- zone.addText(status::getName);
|
|
int radiusForLayer = this.getRadiusForLayer(status, needsGeneration);
|
|
|
|
for (int i = this.pos.x - radiusForLayer; i <= this.pos.x + radiusForLayer; i++) {
|
|
@@ -125,7 +121,6 @@ public class ChunkGenerationTask {
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
}
|
|
|
|
private int getRadiusForLayer(ChunkStatus status, boolean needsGeneration) {
|
|
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
|
index 0d8aefe8c886eaa4c33cbab53b0ad1c016f0531f..b28d19b2fcdff9250e95db05f6e428db54a771e6 100644
|
|
--- a/net/minecraft/server/level/ChunkMap.java
|
|
+++ b/net/minecraft/server/level/ChunkMap.java
|
|
@@ -62,8 +62,6 @@ import net.minecraft.util.CsvOutput;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.StaticCache2D;
|
|
import net.minecraft.util.TriState;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.util.thread.BlockableEventLoop;
|
|
import net.minecraft.util.thread.ConsecutiveExecutor;
|
|
import net.minecraft.world.entity.Entity;
|
|
@@ -409,15 +407,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
}
|
|
|
|
protected void tick(BooleanSupplier hasMoreTime) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("poi");
|
|
this.poiManager.tick(hasMoreTime);
|
|
- profilerFiller.popPush("chunk_unload");
|
|
if (!this.level.noSave()) {
|
|
this.processUnloads(hasMoreTime);
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
public boolean hasWork() {
|
|
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
|
index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0698855d4 100644
|
|
--- a/net/minecraft/server/level/ServerChunkCache.java
|
|
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
|
@@ -26,8 +26,6 @@ import net.minecraft.network.protocol.Packet;
|
|
import net.minecraft.server.MinecraftServer;
|
|
import net.minecraft.server.level.progress.ChunkProgressListener;
|
|
import net.minecraft.util.VisibleForDebug;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.util.thread.BlockableEventLoop;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.MobCategory;
|
|
@@ -472,37 +470,27 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
// CraftBukkit start - modelled on below
|
|
public void purgeUnload() {
|
|
if (true) return; // Paper - rewrite chunk system
|
|
- ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
-
|
|
- gameprofilerfiller.push("purge");
|
|
this.ticketStorage.purgeStaleTickets();
|
|
this.runDistanceManagerUpdates();
|
|
- gameprofilerfiller.popPush("unload");
|
|
this.chunkMap.tick(() -> true);
|
|
- gameprofilerfiller.pop();
|
|
this.clearCache();
|
|
}
|
|
// CraftBukkit end
|
|
|
|
@Override
|
|
public void tick(BooleanSupplier hasTimeLeft, boolean tickChunks) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("purge");
|
|
if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot
|
|
this.ticketStorage.purgeStaleTickets();
|
|
}
|
|
|
|
this.runDistanceManagerUpdates();
|
|
- profilerFiller.popPush("chunks");
|
|
if (tickChunks) {
|
|
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system
|
|
this.tickChunks();
|
|
this.chunkMap.tick();
|
|
}
|
|
|
|
- profilerFiller.popPush("unload");
|
|
this.chunkMap.tick(hasTimeLeft);
|
|
- profilerFiller.pop();
|
|
this.clearCache();
|
|
}
|
|
|
|
@@ -511,22 +499,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
long l = gameTime - this.lastInhabitedUpdate;
|
|
this.lastInhabitedUpdate = gameTime;
|
|
if (!this.level.isDebug()) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("pollingChunks");
|
|
if (this.level.tickRateManager().runsNormally()) {
|
|
- profilerFiller.push("tickingChunks");
|
|
- this.tickChunks(profilerFiller, l);
|
|
- profilerFiller.pop();
|
|
+ this.tickChunks(l); // Gale - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
- this.broadcastChangedChunks(profilerFiller);
|
|
- profilerFiller.pop();
|
|
+ this.broadcastChangedChunks(); // Gale - Purpur - remove vanilla profiler
|
|
}
|
|
}
|
|
|
|
- private void broadcastChangedChunks(ProfilerFiller profiler) {
|
|
- profiler.push("broadcast");
|
|
-
|
|
+ private void broadcastChangedChunks() { // Gale - Purpur - remove vanilla profiler
|
|
for (ChunkHolder chunkHolder : this.chunkHoldersToBroadcast) {
|
|
LevelChunk tickingChunk = chunkHolder.getChunkToSend(); // Paper - rewrite chunk system
|
|
if (tickingChunk != null) {
|
|
@@ -535,11 +516,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
}
|
|
|
|
this.chunkHoldersToBroadcast.clear();
|
|
- profiler.pop();
|
|
}
|
|
|
|
- private void tickChunks(ProfilerFiller profiler, long timeInhabited) {
|
|
- profiler.popPush("naturalSpawnCount");
|
|
+ private void tickChunks(long timeInhabited) { // Gale - Purpur - remove vanilla profiler
|
|
int naturalSpawnChunkCount = this.distanceManager.getNaturalSpawnChunkCount();
|
|
// Paper start - Optional per player mob spawns
|
|
NaturalSpawner.SpawnState spawnState;
|
|
@@ -564,7 +543,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
}
|
|
// Paper end - Optional per player mob spawns
|
|
this.lastSpawnState = spawnState;
|
|
- profiler.popPush("spawnAndTick");
|
|
boolean _boolean = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
|
int _int = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
|
|
List<MobCategory> filteredSpawningCategories;
|
|
@@ -586,14 +564,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
List<LevelChunk> list = this.spawningChunks;
|
|
|
|
try {
|
|
- profiler.push("filteringSpawningChunks");
|
|
this.chunkMap.collectSpawningChunks(list);
|
|
- profiler.popPush("shuffleSpawningChunks");
|
|
// Paper start - chunk tick iteration optimisation
|
|
this.shuffleRandom.setSeed(this.level.random.nextLong());
|
|
if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled
|
|
// Paper end - chunk tick iteration optimisation
|
|
- profiler.popPush("tickSpawningChunks");
|
|
|
|
for (LevelChunk levelChunk : list) {
|
|
this.tickSpawningChunk(levelChunk, timeInhabited, filteredSpawningCategories, spawnState);
|
|
@@ -602,10 +577,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
list.clear();
|
|
}
|
|
|
|
- profiler.popPush("tickTickingChunks");
|
|
this.iterateTickingChunksFaster(); // Paper - chunk tick iteration optimisations
|
|
- profiler.pop();
|
|
- profiler.popPush("customSpawners");
|
|
if (_boolean) {
|
|
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
|
|
}
|
|
@@ -814,7 +786,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
|
|
@Override
|
|
protected void doRunTask(Runnable task) {
|
|
- Profiler.get().incrementCounter("runTask");
|
|
super.doRunTask(task);
|
|
}
|
|
|
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
|
index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec1293a2ec70b 100644
|
|
--- a/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
|
@@ -74,8 +74,6 @@ import net.minecraft.util.Mth;
|
|
import net.minecraft.util.ProgressListener;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.datafix.DataFixTypes;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.util.valueproviders.IntProvider;
|
|
import net.minecraft.util.valueproviders.UniformInt;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
@@ -704,16 +702,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
|
|
public void tick(BooleanSupplier hasTimeLeft) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
this.handlingTick = true;
|
|
TickRateManager tickRateManager = this.tickRateManager();
|
|
boolean runsNormally = tickRateManager.runsNormally();
|
|
if (runsNormally) {
|
|
- profilerFiller.push("world border");
|
|
this.getWorldBorder().tick();
|
|
- profilerFiller.popPush("weather");
|
|
this.advanceWeatherCycle();
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
|
@@ -747,41 +741,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
this.tickTime();
|
|
}
|
|
|
|
- profilerFiller.push("tickPending");
|
|
if (!this.isDebug() && runsNormally) {
|
|
long l = this.getGameTime();
|
|
- profilerFiller.push("blockTicks");
|
|
this.blockTicks.tick(l, paperConfig().environment.maxBlockTicks, this::tickBlock); // Paper - configurable max block ticks
|
|
- profilerFiller.popPush("fluidTicks");
|
|
this.fluidTicks.tick(l, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
- profilerFiller.popPush("raid");
|
|
if (runsNormally) {
|
|
this.raids.tick(this);
|
|
}
|
|
|
|
- profilerFiller.popPush("chunkSource");
|
|
this.getChunkSource().tick(hasTimeLeft, true);
|
|
- profilerFiller.popPush("blockEvents");
|
|
if (runsNormally) {
|
|
this.runBlockEvents();
|
|
}
|
|
|
|
this.handlingTick = false;
|
|
- profilerFiller.pop();
|
|
boolean flag = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this
|
|
if (flag) {
|
|
this.resetEmptyTime();
|
|
}
|
|
|
|
if (flag || this.emptyTime++ < 300) {
|
|
- profilerFiller.push("entities");
|
|
if (this.dragonFight != null && runsNormally) {
|
|
- profilerFiller.push("dragonFight");
|
|
this.dragonFight.tick();
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR
|
|
@@ -790,9 +773,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
entity -> {
|
|
if (!entity.isRemoved()) {
|
|
if (!tickRateManager.isEntityFrozen(entity)) {
|
|
- profilerFiller.push("checkDespawn");
|
|
entity.checkDespawn();
|
|
- profilerFiller.pop();
|
|
if (true) { // Paper - rewrite chunk system
|
|
Entity vehicle = entity.getVehicle();
|
|
if (vehicle != null) {
|
|
@@ -803,21 +784,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
entity.stopRiding();
|
|
}
|
|
|
|
- profilerFiller.push("tick");
|
|
this.guardEntityTick(this::tickNonPassenger, entity);
|
|
- profilerFiller.pop();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
);
|
|
- profilerFiller.pop();
|
|
this.tickBlockEntities();
|
|
}
|
|
-
|
|
- profilerFiller.push("entityManagement");
|
|
// Paper - rewrite chunk system
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
@Override
|
|
@@ -832,9 +807,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
if (this.tickTime) {
|
|
long l = this.levelData.getGameTime() + 1L;
|
|
this.serverLevelData.setGameTime(l);
|
|
- Profiler.get().push("scheduledFunctions");
|
|
this.serverLevelData.getScheduledEvents().tick(this.server, l);
|
|
- Profiler.get().pop();
|
|
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
|
this.setDayTime(this.levelData.getDayTime() + 1L);
|
|
}
|
|
@@ -913,8 +886,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
ChunkPos pos = chunk.getPos();
|
|
int minBlockX = pos.getMinBlockX();
|
|
int minBlockZ = pos.getMinBlockZ();
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("iceandsnow");
|
|
|
|
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
|
|
for (int i = 0; i < randomTickSpeed; i++) {
|
|
@@ -924,12 +895,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
} // Paper - Option to disable ice and snow
|
|
|
|
- profilerFiller.popPush("tickBlocks");
|
|
if (randomTickSpeed > 0) {
|
|
this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
public void tickThunder(LevelChunk chunk) {
|
|
@@ -937,8 +905,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
boolean isRaining = this.isRaining();
|
|
int minBlockX = pos.getMinBlockX();
|
|
int minBlockZ = pos.getMinBlockZ();
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("thunder");
|
|
if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder
|
|
BlockPos blockPos = this.findLightningTargetAround(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15));
|
|
if (this.isRainingAt(blockPos)) {
|
|
@@ -964,8 +930,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
}
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
@VisibleForTesting
|
|
@@ -1259,17 +1223,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
// Paper end - log detailed entity tick information
|
|
entity.setOldPosAndRot();
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
entity.tickCount++;
|
|
entity.totalEntityAge++; // Paper - age-like counter for all entities
|
|
- profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString());
|
|
- profilerFiller.incrementCounter("tickNonPassenger");
|
|
final boolean isActive = io.papermc.paper.entity.activation.ActivationRange.checkIfActive(entity); // Paper - EAR 2
|
|
if (isActive) { // Paper - EAR 2
|
|
entity.tick();
|
|
entity.postTick(); // CraftBukkit
|
|
} else {entity.inactiveTick();} // Paper - EAR 2
|
|
- profilerFiller.pop();
|
|
|
|
for (Entity entity1 : entity.getPassengers()) {
|
|
this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2
|
|
@@ -1290,9 +1250,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
passengerEntity.setOldPosAndRot();
|
|
passengerEntity.tickCount++;
|
|
passengerEntity.totalEntityAge++; // Paper - age-like counter for all entities
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(passengerEntity.getType()).toString());
|
|
- profilerFiller.incrementCounter("tickPassenger");
|
|
// Paper start - EAR 2
|
|
if (isActive) {
|
|
passengerEntity.rideTick();
|
|
@@ -1304,7 +1261,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
ridingEntity.positionRider(passengerEntity);
|
|
}
|
|
// Paper end - EAR 2
|
|
- profilerFiller.pop();
|
|
|
|
for (Entity entity : passengerEntity.getPassengers()) {
|
|
this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2
|
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
|
index 580e1ce2eaab3a8f1c4ac59be73be2703f769741..6f60f5e92628e744a22b3d3f83c2010d8a4661be 100644
|
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -103,8 +103,6 @@ import net.minecraft.util.HashOps;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.Unit;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.Container;
|
|
import net.minecraft.world.Difficulty;
|
|
import net.minecraft.world.InteractionHand;
|
|
@@ -1375,14 +1373,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
|
this.unsetRemoved();
|
|
*/
|
|
// CraftBukkit end
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("moving");
|
|
if (level != null && resourceKey == net.minecraft.world.level.dimension.LevelStem.OVERWORLD && level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER) { // CraftBukkit - empty to fall through to null to event
|
|
this.enteredNetherPosition = this.position();
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("placing");
|
|
// CraftBukkit start
|
|
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
|
|
LevelData worlddata = level.getLevelData();
|
|
@@ -1399,7 +1393,6 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
|
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
|
|
this.connection.resetPosition();
|
|
level.addDuringTeleport(this);
|
|
- profilerFiller.pop();
|
|
this.triggerDimensionChangeTriggers(serverLevel);
|
|
this.stopUsingItem();
|
|
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
|
|
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
index 186393485396cfe9b1baef29586198356e2d2600..776ff13b399fa01bf3900280cf1b5782370732a0 100644
|
|
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
@@ -24,7 +24,6 @@ import net.minecraft.network.protocol.cookie.ServerboundCookieResponsePacket;
|
|
import net.minecraft.server.MinecraftServer;
|
|
import net.minecraft.server.level.ClientInformation;
|
|
import net.minecraft.util.VisibleForDebug;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
import org.slf4j.Logger;
|
|
|
|
public abstract class ServerCommonPacketListenerImpl implements ServerCommonPacketListener, org.bukkit.craftbukkit.entity.CraftPlayer.TransferCookieConnection { // CraftBukkit
|
|
@@ -237,7 +236,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
|
}
|
|
|
|
protected void keepConnectionAlive() {
|
|
- Profiler.get().push("keepAlive");
|
|
long millis = Util.getMillis();
|
|
// 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
|
|
@@ -255,8 +253,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
|
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
|
|
}
|
|
}
|
|
-
|
|
- Profiler.get().pop();
|
|
}
|
|
|
|
private boolean checkIfClosed(long time) {
|
|
diff --git a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java
|
|
index f0e2bca572c6f1790772980cd3ec651e9077382d..954e4103c9c359bc13c9a07bec885af90df14cb5 100644
|
|
--- a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java
|
|
+++ b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java
|
|
@@ -9,8 +9,6 @@ import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import net.minecraft.Util;
|
|
import net.minecraft.util.Unit;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import org.slf4j.Logger;
|
|
|
|
public class ProfiledReloadInstance extends SimpleReloadInstance<ProfiledReloadInstance.State> {
|
|
@@ -71,13 +69,10 @@ public class ProfiledReloadInstance extends SimpleReloadInstance<ProfiledReloadI
|
|
|
|
private static Executor profiledExecutor(Executor executor, AtomicLong timeTaken, AtomicLong timesRun, String name) {
|
|
return runnable -> executor.execute(() -> {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push(name);
|
|
long nanos = Util.getNanos();
|
|
runnable.run();
|
|
timeTaken.addAndGet(Util.getNanos() - nanos);
|
|
timesRun.incrementAndGet();
|
|
- profilerFiller.pop();
|
|
});
|
|
}
|
|
|
|
diff --git a/net/minecraft/server/packs/resources/ReloadableResourceManager.java b/net/minecraft/server/packs/resources/ReloadableResourceManager.java
|
|
index 51cec338f5948b69ad1cff896ce19dc3adb74380..be7fd9e55957ba6fa70c711d1ea4d42e3bbfd752 100644
|
|
--- a/net/minecraft/server/packs/resources/ReloadableResourceManager.java
|
|
+++ b/net/minecraft/server/packs/resources/ReloadableResourceManager.java
|
|
@@ -43,7 +43,7 @@ public class ReloadableResourceManager implements ResourceManager, AutoCloseable
|
|
LOGGER.info("Reloading ResourceManager: {}", LogUtils.defer(() -> resourcePacks.stream().map(PackResources::packId).collect(Collectors.joining(", "))));
|
|
this.resources.close();
|
|
this.resources = new MultiPackResourceManager(this.type, resourcePacks);
|
|
- return SimpleReloadInstance.create(this.resources, this.listeners, backgroundExecutor, gameExecutor, waitingFor, LOGGER.isDebugEnabled());
|
|
+ return SimpleReloadInstance.create(this.resources, this.listeners, backgroundExecutor, gameExecutor, waitingFor, false); // Gale - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
@Override
|
|
diff --git a/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
index 407bd4b8026869bc14ee5e79ff80e7bdd1a07bcb..6e2a3d4171dbb2a30ba18f165723691713fac0f6 100644
|
|
--- a/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
+++ b/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
@@ -3,20 +3,13 @@ package net.minecraft.server.packs.resources;
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.Executor;
|
|
import net.minecraft.util.Unit;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
|
|
public interface ResourceManagerReloadListener extends PreparableReloadListener {
|
|
@Override
|
|
default CompletableFuture<Void> reload(
|
|
PreparableReloadListener.PreparationBarrier barrier, ResourceManager manager, Executor backgroundExecutor, Executor gameExecutor
|
|
) {
|
|
- return barrier.wait(Unit.INSTANCE).thenRunAsync(() -> {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("listener");
|
|
- this.onResourceManagerReload(manager);
|
|
- profilerFiller.pop();
|
|
- }, gameExecutor);
|
|
+ return barrier.wait(Unit.INSTANCE).thenRunAsync(() -> this.onResourceManagerReload(manager), gameExecutor); // Gale - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
void onResourceManagerReload(ResourceManager resourceManager);
|
|
diff --git a/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
|
index 64b0508ef21952c65b0b967b756b2a4c64d96899..b6b03fbbd669e6331b30255df5419611c38e0495 100644
|
|
--- a/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
|
+++ b/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
|
@@ -2,7 +2,6 @@ package net.minecraft.server.packs.resources;
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.Executor;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
import net.minecraft.util.profiling.ProfilerFiller;
|
|
|
|
public abstract class SimplePreparableReloadListener<T> implements PreparableReloadListener {
|
|
@@ -10,9 +9,9 @@ public abstract class SimplePreparableReloadListener<T> implements PreparableRel
|
|
public final CompletableFuture<Void> reload(
|
|
PreparableReloadListener.PreparationBarrier barrier, ResourceManager manager, Executor backgroundExecutor, Executor gameExecutor
|
|
) {
|
|
- return CompletableFuture.<T>supplyAsync(() -> this.prepare(manager, Profiler.get()), backgroundExecutor)
|
|
+ return CompletableFuture.<T>supplyAsync(() -> this.prepare(manager, net.minecraft.util.profiling.InactiveProfiler.INSTANCE), backgroundExecutor) // Gale - Purpur - remove vanilla profiler
|
|
.thenCompose(barrier::wait)
|
|
- .thenAcceptAsync(object -> this.apply((T)object, manager, Profiler.get()), gameExecutor);
|
|
+ .thenAcceptAsync(object -> this.apply((T)object, manager, net.minecraft.util.profiling.InactiveProfiler.INSTANCE), gameExecutor); // Gale - Purpur - remove vanilla profiler
|
|
}
|
|
|
|
protected abstract T prepare(ResourceManager resourceManager, ProfilerFiller profiler);
|
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
|
index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9cfae142a 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -82,8 +82,6 @@ import net.minecraft.tags.FluidTags;
|
|
import net.minecraft.tags.TagKey;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.Nameable;
|
|
@@ -816,8 +814,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
// CraftBukkit end
|
|
|
|
public void baseTick() {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("entityBaseTick");
|
|
if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
|
|
this.inBlockState = null;
|
|
if (this.isPassenger() && this.getVehicle().isRemoved()) {
|
|
@@ -874,8 +870,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
if (this.level() instanceof ServerLevel serverLevelx && this instanceof Leashable) {
|
|
Leashable.tickLeash(serverLevelx, (Entity & Leashable)this);
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
public void setSharedFlagOnFire(boolean isOnFire) {
|
|
@@ -1095,8 +1089,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
}
|
|
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("move");
|
|
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7) {
|
|
movement = movement.multiply(this.stuckSpeedMultiplier);
|
|
this.stuckSpeedMultiplier = Vec3.ZERO;
|
|
@@ -1105,7 +1097,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
// Paper start - ignore movement changes while inactive.
|
|
if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) {
|
|
setDeltaMovement(Vec3.ZERO);
|
|
- profilerFiller.pop();
|
|
return;
|
|
}
|
|
// Paper end
|
|
@@ -1140,8 +1131,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
this.setPos(vec31);
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("rest");
|
|
boolean flag = !Mth.equal(movement.x, vec3.x);
|
|
boolean flag1 = !Mth.equal(movement.z, vec3.z);
|
|
this.horizontalCollision = flag || flag1;
|
|
@@ -1164,7 +1153,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
if (this.isRemoved()) {
|
|
- profilerFiller.pop();
|
|
} else {
|
|
if (this.horizontalCollision) {
|
|
Vec3 deltaMovement = this.getDeltaMovement();
|
|
@@ -1208,7 +1196,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
|
|
float blockSpeedFactor = this.getBlockSpeedFactor();
|
|
this.setDeltaMovement(this.getDeltaMovement().multiply(blockSpeedFactor, 1.0, blockSpeedFactor));
|
|
- profilerFiller.pop();
|
|
}
|
|
}
|
|
// Paper start - detailed watchdog information
|
|
@@ -3212,8 +3199,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
this.processPortalCooldown();
|
|
if (this.portalProcess != null) {
|
|
if (this.portalProcess.processPortalTeleportation(serverLevel, this, this.canUsePortal(false))) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("portal");
|
|
this.setPortalCooldown();
|
|
TeleportTransition portalDestination = this.portalProcess.getPortalDestination(serverLevel, this);
|
|
if (portalDestination != null) {
|
|
@@ -3224,7 +3209,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
} else if (this.portalProcess.hasExpired()) {
|
|
this.portalProcess = null;
|
|
}
|
|
@@ -3779,15 +3763,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
entity.teleport(this.calculatePassengerTransition(teleportTransition, entity));
|
|
}
|
|
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("teleportSameDimension");
|
|
this.teleportSetPosition(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives());
|
|
if (!teleportTransition.asPassenger()) {
|
|
this.sendTeleportTransitionToRidingPlayers(teleportTransition);
|
|
}
|
|
|
|
teleportTransition.postTeleportTransition().onTransition(this);
|
|
- profilerFiller.pop();
|
|
return this;
|
|
}
|
|
|
|
@@ -3803,11 +3784,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
}
|
|
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("teleportCrossDimension");
|
|
Entity entityx = this.getType().create(level, EntitySpawnReason.DIMENSION_TRAVEL);
|
|
if (entityx == null) {
|
|
- profilerFiller.pop();
|
|
return null;
|
|
} else {
|
|
// Paper start - Fix item duplication and teleport issues
|
|
@@ -3826,7 +3804,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
|
|
level.resetEmptyTime();
|
|
teleportTransition.postTeleportTransition().onTransition(entityx);
|
|
- profilerFiller.pop();
|
|
return entityx;
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
|
index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c713290bc008d0 100644
|
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -70,8 +70,6 @@ import net.minecraft.tags.FluidTags;
|
|
import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.tags.TagKey;
|
|
import net.minecraft.util.Mth;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.Difficulty;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.damagesource.CombatRules;
|
|
@@ -415,8 +413,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
|
|
super.baseTick();
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("livingEntityBaseTick");
|
|
if (this.fireImmune() || this.level().isClientSide) {
|
|
this.clearFire();
|
|
}
|
|
@@ -501,7 +497,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.yBodyRotO = this.yBodyRot;
|
|
this.yRotO = this.getYRot();
|
|
this.xRotO = this.getXRot();
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
@Override
|
|
@@ -3233,11 +3228,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
f1 = this.getYRot();
|
|
}
|
|
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("headTurn");
|
|
this.tickHeadTurn(f1);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("rangeChecks");
|
|
|
|
// Paper start - stop large pitch and yaw changes from crashing the server
|
|
this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F;
|
|
@@ -3249,7 +3240,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F;
|
|
// Paper end - stop large pitch and yaw changes from crashing the server
|
|
|
|
- profilerFiller.pop();
|
|
if (this.isFallFlying()) {
|
|
this.fallFlyTicks++;
|
|
} else {
|
|
@@ -3425,21 +3415,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
}
|
|
|
|
this.setDeltaMovement(d, d1, d2);
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("ai");
|
|
this.applyInput();
|
|
if (this.isImmobile()) {
|
|
this.jumping = false;
|
|
this.xxa = 0.0F;
|
|
this.zza = 0.0F;
|
|
} else if (this.isEffectiveAi() && !this.level().isClientSide) {
|
|
- profilerFiller.push("newAi");
|
|
this.serverAiStep();
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("jump");
|
|
if (this.jumping && this.isAffectedByFluids()) {
|
|
double fluidHeight;
|
|
if (this.isInLava()) {
|
|
@@ -3468,8 +3452,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.noJumpDelay = 0;
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("travel");
|
|
if (this.isFallFlying()) {
|
|
this.updateFallFlying();
|
|
}
|
|
@@ -3494,9 +3476,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
this.calculateEntityAnimation(this instanceof FlyingAnimal);
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
if (this.level() instanceof ServerLevel serverLevel) {
|
|
- profilerFiller.push("freezing");
|
|
if ((!this.isInPowderSnow || !this.canFreeze()) && !this.freezeLocked) { // Paper - Freeze Tick Lock API
|
|
this.setTicksFrozen(Math.max(0, this.getTicksFrozen() - 2));
|
|
}
|
|
@@ -3506,18 +3486,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
if (this.tickCount % 40 == 0 && this.isFullyFrozen() && this.canFreeze()) {
|
|
this.hurtServer(serverLevel, this.damageSources().freeze(), 1.0F);
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
- profilerFiller.push("push");
|
|
if (this.autoSpinAttackTicks > 0) {
|
|
this.autoSpinAttackTicks--;
|
|
this.checkAutoSpinAttack(boundingBox, this.getBoundingBox());
|
|
}
|
|
|
|
this.pushEntities();
|
|
- profilerFiller.pop();
|
|
// Paper start - Add EntityMoveEvent
|
|
if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof Player)) {
|
|
if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) {
|
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
|
index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..7f5981f71e6380c09e40a0c80db6a77e74d5113d 100644
|
|
--- a/net/minecraft/world/entity/Mob.java
|
|
+++ b/net/minecraft/world/entity/Mob.java
|
|
@@ -30,8 +30,6 @@ import net.minecraft.sounds.SoundEvent;
|
|
import net.minecraft.tags.TagKey;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.Container;
|
|
import net.minecraft.world.Difficulty;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
@@ -316,14 +314,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
@Override
|
|
public void baseTick() {
|
|
super.baseTick();
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("mobBaseTick");
|
|
if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) {
|
|
this.resetAmbientSoundTime();
|
|
this.playAmbientSound();
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
@Override
|
|
@@ -489,8 +483,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
@Override
|
|
public void aiStep() {
|
|
super.aiStep();
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("looting");
|
|
if (this.level() instanceof ServerLevel serverLevel
|
|
&& this.canPickUpLoot()
|
|
&& this.isAlive()
|
|
@@ -513,8 +505,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
}
|
|
}
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
protected Vec3i getPickupReach() {
|
|
@@ -724,42 +714,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
return;
|
|
}
|
|
// Paper end - Allow nerfed mobs to jump and float
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("sensing");
|
|
this.sensing.tick();
|
|
- profilerFiller.pop();
|
|
int i = this.tickCount + this.getId();
|
|
if (i % 2 != 0 && this.tickCount > 1) {
|
|
- profilerFiller.push("targetSelector");
|
|
this.targetSelector.tickRunningGoals(false);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("goalSelector");
|
|
this.goalSelector.tickRunningGoals(false);
|
|
- profilerFiller.pop();
|
|
} else {
|
|
- profilerFiller.push("targetSelector");
|
|
this.targetSelector.tick();
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("goalSelector");
|
|
this.goalSelector.tick();
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
- profilerFiller.push("navigation");
|
|
this.navigation.tick();
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("mob tick");
|
|
this.customServerAiStep((ServerLevel)this.level());
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("controls");
|
|
- profilerFiller.push("move");
|
|
this.moveControl.tick();
|
|
- profilerFiller.popPush("look");
|
|
this.lookControl.tick();
|
|
- profilerFiller.popPush("jump");
|
|
this.jumpControl.tick();
|
|
- profilerFiller.pop();
|
|
- profilerFiller.pop();
|
|
this.sendDebugPackets();
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
|
index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..b816b2de8eb327060ca6ea7c4afc17373fa77ff6 100644
|
|
--- a/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
|
+++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
|
@@ -7,8 +7,6 @@ import java.util.EnumSet;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.function.Predicate;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
|
|
public class GoalSelector {
|
|
private static final WrappedGoal NO_GOAL = new WrappedGoal(Integer.MAX_VALUE, new Goal() {
|
|
@@ -84,9 +82,6 @@ public class GoalSelector {
|
|
}
|
|
|
|
public void tick() {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("goalCleanup");
|
|
-
|
|
for (WrappedGoal wrappedGoal : this.availableGoals) {
|
|
if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams
|
|
wrappedGoal.stop();
|
|
@@ -94,8 +89,6 @@ public class GoalSelector {
|
|
}
|
|
|
|
this.lockedFlags.entrySet().removeIf(entry -> !entry.getValue().isRunning());
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("goalUpdate");
|
|
|
|
for (WrappedGoal wrappedGoalx : this.availableGoals) {
|
|
// Paper start
|
|
@@ -115,21 +108,15 @@ public class GoalSelector {
|
|
}
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
this.tickRunningGoals(true);
|
|
}
|
|
|
|
public void tickRunningGoals(boolean tickAllRunning) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("goalTick");
|
|
-
|
|
for (WrappedGoal wrappedGoal : this.availableGoals) {
|
|
if (wrappedGoal.isRunning() && (tickAllRunning || wrappedGoal.requiresUpdateEveryTick())) {
|
|
wrappedGoal.tick();
|
|
}
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
public Set<WrappedGoal> getAvailableGoals() {
|
|
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
index 06389019deba08c7c0966affcdc90512c88db3d5..6bbdfc748f1ce66689c63424fadcf261b1e967b3 100644
|
|
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
|
@@ -10,8 +10,6 @@ import net.minecraft.core.Vec3i;
|
|
import net.minecraft.network.protocol.game.DebugPackets;
|
|
import net.minecraft.tags.BlockTags;
|
|
import net.minecraft.util.Mth;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.Mob;
|
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
|
@@ -189,13 +187,10 @@ public abstract class PathNavigation {
|
|
}
|
|
}
|
|
// Paper end - EntityPathfindEvent
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("pathfind");
|
|
BlockPos blockPos = offsetUpward ? this.mob.blockPosition().above() : this.mob.blockPosition();
|
|
int i = (int)(followRange + regionOffset);
|
|
PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i));
|
|
Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, targets, followRange, accuracy, this.maxVisitedNodesMultiplier);
|
|
- profilerFiller.pop();
|
|
if (path != null && path.getTarget() != null) {
|
|
this.targetPos = path.getTarget();
|
|
this.reachRange = accuracy;
|
|
diff --git a/net/minecraft/world/entity/ai/sensing/Sensing.java b/net/minecraft/world/entity/ai/sensing/Sensing.java
|
|
index c569074403b1d8b443aaa98ba9cf9bbd0e98bd2d..b1aa7294f9479f45fcde77c5ea46db9f62370abf 100644
|
|
--- a/net/minecraft/world/entity/ai/sensing/Sensing.java
|
|
+++ b/net/minecraft/world/entity/ai/sensing/Sensing.java
|
|
@@ -2,8 +2,6 @@ package net.minecraft.world.entity.ai.sensing;
|
|
|
|
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
|
import it.unimi.dsi.fastutil.ints.IntSet;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.Mob;
|
|
|
|
@@ -28,10 +26,7 @@ public class Sensing {
|
|
} else if (this.unseen.contains(id)) {
|
|
return false;
|
|
} else {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("hasLineOfSight");
|
|
boolean hasLineOfSight = this.mob.hasLineOfSight(entity);
|
|
- profilerFiller.pop();
|
|
if (hasLineOfSight) {
|
|
this.seen.add(id);
|
|
} else {
|
|
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
|
|
index eaa1745d34323cd684782a7fb2e153851a736471..fc2290a62c0a01cfa3143e77384f30e17d94f039 100644
|
|
--- a/net/minecraft/world/entity/animal/allay/Allay.java
|
|
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
|
|
@@ -29,8 +29,6 @@ import net.minecraft.tags.GameEventTags;
|
|
import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.tags.TagKey;
|
|
import net.minecraft.util.Mth;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.SimpleContainer;
|
|
@@ -241,13 +239,8 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("allayBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("allayActivityUpdate");
|
|
AllayAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
index b72e07ad954efa7f26f876a59f428086b40d9bb2..657f4b56699c33590a0494ef860275e952794c2a 100644
|
|
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
@@ -24,8 +24,6 @@ import net.minecraft.util.ByIdMap;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.StringRepresentable;
|
|
import net.minecraft.util.TimeUtil;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
@@ -134,13 +132,8 @@ public class Armadillo extends Animal {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("armadilloBrain");
|
|
((Brain<Armadillo>)this.brain).tick(level, this);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("armadilloActivityUpdate");
|
|
ArmadilloAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) {
|
|
this.forceDrops = true; // CraftBukkit
|
|
if (this.dropFromGiftLootTable(level, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) {
|
|
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
index 233025bc1d4ba2590223def9b206140c68ea5f26..d3d4d8b025480f9e2202157591319df3af43f9de 100644
|
|
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
@@ -31,8 +31,6 @@ import net.minecraft.util.ByIdMap;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.StringRepresentable;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
@@ -327,13 +325,8 @@ public class Axolotl extends Animal implements Bucketable {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("axolotlBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("axolotlActivityUpdate");
|
|
AxolotlAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
if (!this.isNoAi()) {
|
|
Optional<Integer> memory = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS);
|
|
this.setPlayingDead(memory.isPresent() && memory.get() > 0);
|
|
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index 6336fb58f4314be2fe987d7e3de258d977369417..b63b32bac1872db7be64fcb645acd0a0a4290cee 100644
|
|
--- a/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -19,8 +19,6 @@ import net.minecraft.tags.BlockTags;
|
|
import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
@@ -157,14 +155,9 @@ public class Camel extends AbstractHorse {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("camelBrain");
|
|
Brain<?> brain = this.getBrain();
|
|
((Brain<Camel>)brain).tick(level, this);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("camelActivityUpdate");
|
|
CamelAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
index 8ffbe420528cd63f30f9b41d4fb0a6519042eadc..fdf40dc10aad108db6ca68fcfec9ecf48f76a9c1 100644
|
|
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
|
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
@@ -29,8 +29,6 @@ import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.Unit;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
import net.minecraft.world.entity.AgeableMob;
|
|
@@ -203,13 +201,8 @@ public class Frog extends Animal {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("frogBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("frogActivityUpdate");
|
|
FrogAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
index ebdfd3fb6c0de48982d392bb2aa415f3676c6056..faaa8197e8421c2bbdc2a8bbaae4f4d0820dbbe7 100644
|
|
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
|
@@ -12,8 +12,6 @@ import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.sounds.SoundEvent;
|
|
import net.minecraft.sounds.SoundEvents;
|
|
import net.minecraft.tags.ItemTags;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
@@ -98,13 +96,8 @@ public class Tadpole extends AbstractFish {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("tadpoleBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("tadpoleActivityUpdate");
|
|
TadpoleAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
|
|
index b22321ead9d66cb089b67276743624b3cca52fc1..9047e75a5edf9fec2b73aec272284d8003793eaa 100644
|
|
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
|
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
|
@@ -21,8 +21,6 @@ import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.tags.TagKey;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
@@ -189,13 +187,8 @@ public class Goat extends Animal {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("goatBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
- profilerFiller.push("goatActivityUpdate");
|
|
GoatAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
index d34dcbbdeae41d23d6fb497e0e8da038580b6d01..622c2eac70c81ed7ccf605069b8dd68508bebf76 100644
|
|
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
@@ -29,8 +29,6 @@ import net.minecraft.tags.BlockTags;
|
|
import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.util.ByIdMap;
|
|
import net.minecraft.util.Mth;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
@@ -454,12 +452,8 @@ public class Sniffer extends Animal {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("snifferBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.popPush("snifferActivityUpdate");
|
|
SnifferAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java
|
|
index 4405f465ad5b136390c4204b177967c6e47738dd..33c7081c2aee7a31c4dd143f9d1a36cadcfcb29f 100644
|
|
--- a/net/minecraft/world/entity/monster/Zoglin.java
|
|
+++ b/net/minecraft/world/entity/monster/Zoglin.java
|
|
@@ -15,8 +15,6 @@ import net.minecraft.network.syncher.SynchedEntityData;
|
|
import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.sounds.SoundEvent;
|
|
import net.minecraft.sounds.SoundEvents;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.util.valueproviders.UniformInt;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
@@ -249,10 +247,7 @@ public class Zoglin extends Monster implements HoglinBase {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("zoglinBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
this.updateActivity();
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
index c12653070d62c44b97a07676f24caf7ab570cd2a..d91ce14cc39b1b6ccd558f53ed605d4c6a5acae5 100644
|
|
--- a/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
+++ b/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
@@ -12,8 +12,6 @@ import net.minecraft.sounds.SoundEvent;
|
|
import net.minecraft.sounds.SoundEvents;
|
|
import net.minecraft.sounds.SoundSource;
|
|
import net.minecraft.tags.EntityTypeTags;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
import net.minecraft.world.entity.AnimationState;
|
|
import net.minecraft.world.entity.Entity;
|
|
@@ -232,12 +230,8 @@ public class Breeze extends Monster {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("breezeBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.popPush("breezeActivityUpdate");
|
|
BreezeAi.updateActivity(this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
index bdefd070cfebe7f3f792c998f2f53be720cbfbcd..2183f5aaf6cf7a4df8c659f0766af40289761987 100644
|
|
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
@@ -17,8 +17,6 @@ import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.sounds.SoundEvent;
|
|
import net.minecraft.sounds.SoundEvents;
|
|
import net.minecraft.tags.DamageTypeTags;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
import net.minecraft.world.entity.AnimationState;
|
|
import net.minecraft.world.entity.Entity;
|
|
@@ -204,10 +202,7 @@ public class Creaking extends Monster {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("creakingBrain");
|
|
this.getBrain().tick((ServerLevel)this.level(), this);
|
|
- profilerFiller.pop();
|
|
CreakingAi.updateActivity(this);
|
|
}
|
|
|
|
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
index 0d05d21158a59dc3aa648c1d6541121c5bb547e6..2989add9a4746646f06ec3f6c386ac5df4a64726 100644
|
|
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
@@ -16,8 +16,6 @@ import net.minecraft.sounds.SoundEvents;
|
|
import net.minecraft.sounds.SoundSource;
|
|
import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.util.RandomSource;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
@@ -161,10 +159,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("hoglinBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
HoglinAi.updateActivity(this);
|
|
if (this.isConverting()) {
|
|
this.timeInOverworld++;
|
|
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
|
index e200e974e46de6166d56e051806c00a69aefc9bb..27052ded60db7c3916de3f4c8b48227f53fd7249 100644
|
|
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
|
|
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
|
@@ -17,8 +17,6 @@ import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.tags.TagKey;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.VisibleForDebug;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
@@ -319,10 +317,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("piglinBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
PiglinAi.updateActivity(this);
|
|
super.customServerAiStep(level);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
|
index 219978cb0341b2d691f44c1146707d875788881e..589a130f8855f464c1930a0aa8b54c0326a22e23 100644
|
|
--- a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
|
+++ b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
|
@@ -8,8 +8,6 @@ import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.sounds.SoundEvent;
|
|
import net.minecraft.sounds.SoundEvents;
|
|
import net.minecraft.util.RandomSource;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
import net.minecraft.world.entity.EntitySpawnReason;
|
|
@@ -115,10 +113,7 @@ public class PiglinBrute extends AbstractPiglin {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("piglinBruteBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
PiglinBruteAi.updateActivity(this);
|
|
PiglinBruteAi.maybePlayActivitySound(this);
|
|
super.customServerAiStep(level);
|
|
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
|
|
index cd28ca290c081d9f5e4498f59d7b87a566f81544..67fdcbe05e8d5f4000255f753565591825f54f67 100644
|
|
--- a/net/minecraft/world/entity/monster/warden/Warden.java
|
|
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
|
|
@@ -31,8 +31,6 @@ import net.minecraft.tags.TagKey;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.Unit;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
import net.minecraft.world.effect.MobEffectInstance;
|
|
@@ -281,10 +279,7 @@ public class Warden extends Monster implements VibrationSystem {
|
|
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("wardenBrain");
|
|
this.getBrain().tick(level, this);
|
|
- profilerFiller.pop();
|
|
super.customServerAiStep(level);
|
|
if ((this.tickCount + this.getId()) % 120 == 0) {
|
|
applyDarknessAround(level, this.position(), this, 20);
|
|
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
|
index e0e0d2ea7fc60e3142c675404d152eca60263240..09d559adb603e3d34bb82b944a2a3e8c2c37b136 100644
|
|
--- a/net/minecraft/world/entity/npc/Villager.java
|
|
+++ b/net/minecraft/world/entity/npc/Villager.java
|
|
@@ -36,8 +36,6 @@ import net.minecraft.stats.Stats;
|
|
import net.minecraft.tags.ItemTags;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.SpawnUtil;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.Difficulty;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.InteractionHand;
|
|
@@ -294,10 +292,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
|
}
|
|
protected void customServerAiStep(ServerLevel level, final boolean inactive) {
|
|
// Paper end - EAR 2
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("villagerBrain");
|
|
if (!inactive) this.getBrain().tick(level, this); // Paper - EAR 2
|
|
- profilerFiller.pop();
|
|
if (this.assignProfessionWhenSpawned) {
|
|
this.assignProfessionWhenSpawned = false;
|
|
}
|
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
|
index 4c31b039eb697ba84598dd1fdded707a2f155ce5..2ebb7f0f3686fa631de874fee9474f7ab530631f 100644
|
|
--- a/net/minecraft/world/level/Level.java
|
|
+++ b/net/minecraft/world/level/Level.java
|
|
@@ -35,8 +35,6 @@ import net.minecraft.util.AbortableIterationConsumer;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.StringRepresentable;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.TickRateManager;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
@@ -215,7 +213,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
@Override
|
|
public final <T extends Entity> List<T> getEntitiesOfClass(final Class<T> entityClass, final AABB boundingBox, final Predicate<? super T> predicate) {
|
|
- Profiler.get().incrementCounter("getEntities");
|
|
final List<T> ret = new java.util.ArrayList<>();
|
|
|
|
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate);
|
|
@@ -225,7 +222,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
@Override
|
|
public final List<Entity> moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate<? super Entity> predicate) {
|
|
- Profiler.get().incrementCounter("getEntities");
|
|
final List<Entity> ret = new java.util.ArrayList<>();
|
|
|
|
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate);
|
|
@@ -1452,8 +1448,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
}
|
|
|
|
protected void tickBlockEntities() {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("blockEntities");
|
|
this.tickingBlockEntities = true;
|
|
if (!this.pendingBlockEntityTickers.isEmpty()) {
|
|
this.blockEntityTickers.addAll(this.pendingBlockEntityTickers);
|
|
@@ -1483,7 +1477,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
|
|
|
this.tickingBlockEntities = false;
|
|
- profilerFiller.pop();
|
|
this.spigotConfig.currentPrimedTnt = 0; // Spigot
|
|
}
|
|
|
|
@@ -1742,7 +1735,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
@Override
|
|
public List<Entity> getEntities(@Nullable Entity entity, AABB boundingBox, Predicate<? super Entity> predicate) {
|
|
- Profiler.get().incrementCounter("getEntities");
|
|
List<Entity> list = Lists.newArrayList();
|
|
|
|
// Paper start - rewrite chunk system
|
|
@@ -1771,8 +1763,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
public <T extends Entity> void getEntities(final EntityTypeTest<Entity, T> entityTypeTest,
|
|
final AABB boundingBox, final Predicate<? super T> predicate,
|
|
final List<? super T> into, final int maxCount) {
|
|
- Profiler.get().incrementCounter("getEntities");
|
|
-
|
|
if (entityTypeTest instanceof net.minecraft.world.entity.EntityType<T> byType) {
|
|
if (maxCount != Integer.MAX_VALUE) {
|
|
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(byType, boundingBox, into, predicate, maxCount);
|
|
diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java
|
|
index 14a2514a408a66a83f7b5fb43b4c4dc8f23fd5f4..ec32d77447dd250857a2af1d8cc3e6e233aa3e6e 100644
|
|
--- a/net/minecraft/world/level/NaturalSpawner.java
|
|
+++ b/net/minecraft/world/level/NaturalSpawner.java
|
|
@@ -23,8 +23,6 @@ import net.minecraft.tags.BlockTags;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.VisibleForDebug;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.util.random.WeightedList;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.EntitySpawnReason;
|
|
@@ -152,9 +150,6 @@ public final class NaturalSpawner {
|
|
}
|
|
|
|
public static void spawnForChunk(ServerLevel level, LevelChunk chunk, NaturalSpawner.SpawnState spawnState, List<MobCategory> categories) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("spawner");
|
|
-
|
|
for (MobCategory mobCategory : categories) {
|
|
// Paper start - Optional per player mob spawns
|
|
final boolean canSpawn;
|
|
@@ -189,8 +184,6 @@ public final class NaturalSpawner {
|
|
// Paper end - Optional per player mob spawns
|
|
}
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
// Paper start - Add mobcaps commands
|
|
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
|
index ec4b63a574e7ff2c807c283c9f4b402229864e51..63d0b83d648ab1a6e7c84a49f7e2e825076904ad 100644
|
|
--- a/net/minecraft/world/level/ServerExplosion.java
|
|
+++ b/net/minecraft/world/level/ServerExplosion.java
|
|
@@ -13,8 +13,6 @@ import net.minecraft.Util;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.util.Mth;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.EntityType;
|
|
@@ -654,10 +652,7 @@ public class ServerExplosion implements Explosion {
|
|
List<BlockPos> list = this.calculateExplodedPositions();
|
|
this.hurtEntities();
|
|
if (this.interactsWithBlocks()) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("explosion_blocks");
|
|
this.interactWithBlocks(list);
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
if (this.fire) {
|
|
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
index 5d3fc807221392d378fec283bfdefb8747fb8376..61fa8f2bf018b8892a11acec058f36914c5a1573 100644
|
|
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -23,8 +23,6 @@ import net.minecraft.network.FriendlyByteBuf;
|
|
import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
|
|
import net.minecraft.server.level.FullChunkStatus;
|
|
import net.minecraft.server.level.ServerLevel;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.level.ChunkPos;
|
|
import net.minecraft.world.level.Level;
|
|
@@ -383,12 +381,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
}
|
|
|
|
if (LightEngine.hasDifferentLightProperties(blockState, state)) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("updateSkyLightSources");
|
|
// Paper - rewrite chunk system
|
|
- profilerFiller.popPush("queueCheckLight");
|
|
this.level.getChunkSource().getLightEngine().checkBlock(pos);
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
boolean flag = !blockState.is(block);
|
|
@@ -915,8 +909,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
BlockPos blockPos = this.blockEntity.getBlockPos();
|
|
if (LevelChunk.this.isTicking(blockPos)) {
|
|
try {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push(this::getType);
|
|
BlockState blockState = LevelChunk.this.getBlockState(blockPos);
|
|
if (this.blockEntity.getType().isValid(blockState)) {
|
|
this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), blockState, this.blockEntity);
|
|
@@ -930,8 +922,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
}
|
|
// Paper end - Remove the Block Entity if it's invalid
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
} catch (Throwable var5) {
|
|
// Paper start - Prevent block entity and entity crashes
|
|
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
|
|
diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..c2baadcdceb1df6a881d6f73aa4eb4dd264bcdfe 100644
|
|
--- a/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
+++ b/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
@@ -12,9 +12,6 @@ import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import javax.annotation.Nullable;
|
|
import net.minecraft.core.BlockPos;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
-import net.minecraft.util.profiling.metrics.MetricCategory;
|
|
import net.minecraft.world.entity.Mob;
|
|
import net.minecraft.world.level.PathNavigationRegion;
|
|
|
|
@@ -57,9 +54,6 @@ public class PathFinder {
|
|
|
|
@Nullable
|
|
private Path findPath(Node node, List<Map.Entry<Target, BlockPos>> positions, float maxRange, int accuracy, float searchDepthMultiplier) { // Paper - optimize collection
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("find_path");
|
|
- profilerFiller.markForCharting(MetricCategory.PATH_FINDING);
|
|
// Set<Target> set = targetPositions.keySet(); // Paper
|
|
node.g = 0.0F;
|
|
node.h = this.getBestH(node, positions); // Paper - optimize collection
|
|
@@ -129,7 +123,6 @@ public class PathFinder {
|
|
best = path;
|
|
}
|
|
}
|
|
- profilerFiller.pop();
|
|
return best;
|
|
// Paper end - Perf: remove streams and optimize collection
|
|
}
|
|
diff --git a/net/minecraft/world/ticks/LevelTicks.java b/net/minecraft/world/ticks/LevelTicks.java
|
|
index 66abc2e7adee60fa98eed1ba36e018814fd02cad..fbf0d3b808c66e8971c747619f6acf7417af5ef7 100644
|
|
--- a/net/minecraft/world/ticks/LevelTicks.java
|
|
+++ b/net/minecraft/world/ticks/LevelTicks.java
|
|
@@ -23,8 +23,6 @@ import net.minecraft.Util;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.core.SectionPos;
|
|
import net.minecraft.core.Vec3i;
|
|
-import net.minecraft.util.profiling.Profiler;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
import net.minecraft.world.level.ChunkPos;
|
|
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
|
|
|
@@ -80,20 +78,13 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
|
}
|
|
|
|
public void tick(long gameTime, int maxAllowedTicks, BiConsumer<BlockPos, T> ticker) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("collect");
|
|
- this.collectTicks(gameTime, maxAllowedTicks, profilerFiller);
|
|
- profilerFiller.popPush("run");
|
|
- profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size());
|
|
+ this.collectTicks(gameTime, maxAllowedTicks); // Gale - Purpur - remove vanilla profiler
|
|
this.runCollectedTicks(ticker);
|
|
- profilerFiller.popPush("cleanup");
|
|
this.cleanupAfterTick();
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
- private void collectTicks(long gameTime, int maxAllowedTicks, ProfilerFiller profiler) {
|
|
+ private void collectTicks(long gameTime, int maxAllowedTicks) { // Gale - Purpur - remove vanilla profiler
|
|
this.sortContainersToTick(gameTime);
|
|
- profiler.incrementCounter("containersToTick", this.containersToTick.size());
|
|
this.drainContainers(gameTime, maxAllowedTicks);
|
|
this.rescheduleLeftoverContainers();
|
|
}
|