mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@9b1798d6 Simplify custom payload handling (#12347) PaperMC/Paper@2552abf0 fix message mutation in PlayerSetSpawnEvent PaperMC/Paper@ae99e24f fix deprecated bungee chat api methods PaperMC/Paper@dca4aab8 add util methods to CraftChatMessage PaperMC/Paper@87c9d9b0 be more lenient on url parsing for legacy format PaperMC/Paper@4a9bd2e3 Correctly clear items in PlayerDeathEvent PaperMC/Paper@a70f7745 fix unsaveable launched trident PaperMC/Paper@41a094cf move block data/state impl PaperMC/Paper@6b26b219 remove hardcoded durability from material PaperMC/Paper@db8c646d Merge remote-tracking branch 'origin/main' into update/1.21.5
2324 lines
110 KiB
Diff
2324 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 9dd86cf63dd93620adb539a7a80a8d01c7ac08a2..2c20ffe36ebba53e9cb2ffc79bb25e8fb3bae207 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 bd31615651fb5918d278de9799529b6c28190a03..f77aa7a8a8bdd73abe60f44a41264c242d6780ca 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
|
|
@@ -913,9 +895,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
|
|
@@ -1156,22 +1135,14 @@ 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);
|
|
this.tickFrame.end();
|
|
- profilerFiller.popPush("nextTickWait");
|
|
this.mayHaveDelayedTasks = true;
|
|
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
|
|
this.startMeasuringTaskExecutionTime();
|
|
@@ -1181,11 +1152,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);
|
|
@@ -1357,7 +1324,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
@Override
|
|
public void doRunTask(TickTask task) {
|
|
- Profiler.get().incrementCounter("runTask");
|
|
super.doRunTask(task);
|
|
}
|
|
|
|
@@ -1450,7 +1416,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.autoSave();
|
|
}
|
|
|
|
- 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
|
|
@@ -1459,7 +1424,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];
|
|
@@ -1472,16 +1436,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");
|
|
}
|
|
|
|
@@ -1547,7 +1507,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
|
|
@@ -1565,9 +1524,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
|
|
@@ -1601,7 +1558,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
serverLevel.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
|
serverLevel.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
|
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
|
|
- profilerFiller.push(() -> serverLevel + " " + serverLevel.dimension().location());
|
|
/* Drop global time updates
|
|
if (this.tickCount % 20 == 0) {
|
|
profilerFiller.push("timeSync");
|
|
@@ -1610,8 +1566,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
// CraftBukkit end */
|
|
|
|
- profilerFiller.push("tick");
|
|
-
|
|
try {
|
|
serverLevel.tick(hasTimeLeft);
|
|
} catch (Throwable var7) {
|
|
@@ -1620,34 +1574,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() {
|
|
@@ -1663,14 +1607,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) {
|
|
@@ -2480,55 +2419,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);
|
|
}
|
|
@@ -2578,24 +2468,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;
|
|
}
|
|
@@ -2701,55 +2573,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 84e2b940ab8301b789a01d5b739d69cb50db5bf4..f4205dca158f90450892af1223cc7912e494c05e 100644
|
|
--- a/net/minecraft/server/ReloadableServerResources.java
|
|
+++ b/net/minecraft/server/ReloadableServerResources.java
|
|
@@ -98,7 +98,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 c2ed1b0b67e62434292ebf3edd70c74af0c0d9af..c71034e9077280ccd7b4d7a9986eb6ec1536472a 100644
|
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
|
@@ -732,12 +732,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 00a5ed09caa2689543bd47bcd93d5a6141d0af46..bbd21c296e0b9bb000a9c47be1ec27ea553d3b40 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;
|
|
@@ -490,15 +488,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() {
|
|
@@ -616,7 +609,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
(CompletionStage<? extends Object>)completableFuture1, (optional, object) -> optional
|
|
)
|
|
.thenApplyAsync(optional -> {
|
|
- Profiler.get().incrementCounter("chunkLoad");
|
|
if (optional.isPresent()) {
|
|
ChunkAccess chunkAccess = optional.get().read(this.level, this.poiManager, this.storageInfo(), chunkPos);
|
|
this.markPosition(chunkPos, chunkAccess.getPersistedStatus().getChunkType());
|
|
@@ -817,7 +809,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
}
|
|
}
|
|
|
|
- Profiler.get().incrementCounter("chunkSave");
|
|
this.activeChunkWrites.incrementAndGet();
|
|
SerializableChunkData serializableChunkData = SerializableChunkData.copyOf(this.level, chunk);
|
|
CompletableFuture<CompoundTag> completableFuture = CompletableFuture.supplyAsync(serializableChunkData::write, Util.backgroundExecutor());
|
|
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
|
index c50a1a01d167696134bd65b2d28db323d81d6ebd..51c636b3bb5088b5caf0f93ec34987efe7e55e5f 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;
|
|
@@ -230,8 +228,6 @@ public class ServerChunkCache extends ChunkSource {
|
|
return ifLoaded;
|
|
}
|
|
// Paper end - Perf: Optimise getChunkAt calls for loaded chunks
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.incrementCounter("getChunk");
|
|
long packedChunkPos = ChunkPos.asLong(x, z);
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
@@ -243,7 +239,6 @@ public class ServerChunkCache extends ChunkSource {
|
|
}
|
|
}
|
|
|
|
- profilerFiller.incrementCounter("getChunkCacheMiss");
|
|
CompletableFuture<ChunkResult<ChunkAccess>> chunkFutureMainThread = this.getChunkFutureMainThread(x, z, chunkStatus, requireChunk);
|
|
this.mainThreadProcessor.managedBlock(chunkFutureMainThread::isDone);
|
|
// com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads
|
|
@@ -306,11 +301,8 @@ public class ServerChunkCache extends ChunkSource {
|
|
// CraftBukkit end
|
|
this.addTicket(new Ticket(TicketType.UNKNOWN, i), chunkPos);
|
|
if (this.chunkAbsent(visibleChunkIfPresent, i)) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("chunkLoad");
|
|
this.runDistanceManagerUpdates();
|
|
visibleChunkIfPresent = this.getVisibleChunkIfPresent(packedChunkPos);
|
|
- profilerFiller.pop();
|
|
if (this.chunkAbsent(visibleChunkIfPresent, i)) {
|
|
throw (IllegalStateException)Util.pauseInIde(new IllegalStateException("No chunk holder after ticket has been added"));
|
|
}
|
|
@@ -394,36 +386,26 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
// CraftBukkit start - modelled on below
|
|
public void purgeUnload() {
|
|
- 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) {
|
|
this.tickChunks();
|
|
this.chunkMap.tick();
|
|
}
|
|
|
|
- profilerFiller.popPush("unload");
|
|
this.chunkMap.tick(hasTimeLeft);
|
|
- profilerFiller.pop();
|
|
this.clearCache();
|
|
}
|
|
|
|
@@ -432,22 +414,15 @@ public class ServerChunkCache extends ChunkSource {
|
|
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.getTickingChunk();
|
|
if (tickingChunk != null) {
|
|
@@ -456,17 +431,14 @@ public class ServerChunkCache extends ChunkSource {
|
|
}
|
|
|
|
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();
|
|
NaturalSpawner.SpawnState spawnState = NaturalSpawner.createState(
|
|
naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, new LocalMobCapCalculator(this.chunkMap)
|
|
);
|
|
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;
|
|
@@ -488,11 +460,8 @@ public class ServerChunkCache extends ChunkSource {
|
|
List<LevelChunk> list = this.spawningChunks;
|
|
|
|
try {
|
|
- profiler.push("filteringSpawningChunks");
|
|
this.chunkMap.collectSpawningChunks(list);
|
|
- profiler.popPush("shuffleSpawningChunks");
|
|
Util.shuffle(list, this.level.random);
|
|
- profiler.popPush("tickSpawningChunks");
|
|
|
|
for (LevelChunk levelChunk : list) {
|
|
this.tickSpawningChunk(levelChunk, timeInhabited, filteredSpawningCategories, spawnState);
|
|
@@ -501,10 +470,7 @@ public class ServerChunkCache extends ChunkSource {
|
|
list.clear();
|
|
}
|
|
|
|
- profiler.popPush("tickTickingChunks");
|
|
this.chunkMap.forEachBlockTickingChunk(levelChunk1 -> this.level.tickChunk(levelChunk1, _int));
|
|
- profiler.pop();
|
|
- profiler.popPush("customSpawners");
|
|
if (_boolean) {
|
|
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
|
|
}
|
|
@@ -704,7 +670,6 @@ public class ServerChunkCache extends ChunkSource {
|
|
|
|
@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 3d614c00886278514197374c3e24a8f871fda321..47cd1b3b5f7a74dcff147a744420c622ec750e7a 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;
|
|
@@ -464,16 +462,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);
|
|
@@ -507,41 +501,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
|
|
@@ -550,9 +533,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 (entity instanceof ServerPlayer
|
|
|| this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) {
|
|
Entity vehicle = entity.getVehicle();
|
|
@@ -564,21 +545,16 @@ 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");
|
|
this.entityManager.tick();
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
@Override
|
|
@@ -590,9 +566,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);
|
|
}
|
|
@@ -618,8 +592,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++) {
|
|
@@ -629,7 +601,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
} // Paper - Option to disable ice and snow
|
|
|
|
- profilerFiller.popPush("tickBlocks");
|
|
if (randomTickSpeed > 0) {
|
|
LevelChunkSection[] sections = chunk.getSections();
|
|
|
|
@@ -641,7 +612,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
|
|
for (int i2 = 0; i2 < randomTickSpeed; i2++) {
|
|
BlockPos blockRandomPos = this.getBlockRandomPos(minBlockX, blockPosCoord, minBlockZ, 15);
|
|
- profilerFiller.push("randomTick");
|
|
BlockState blockState = levelChunkSection.getBlockState(
|
|
blockRandomPos.getX() - minBlockX, blockRandomPos.getY() - blockPosCoord, blockRandomPos.getZ() - minBlockZ
|
|
);
|
|
@@ -653,14 +623,10 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
if (fluidState.isRandomlyTicking()) {
|
|
fluidState.randomTick(this, blockRandomPos, this.random);
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
public void tickThunder(LevelChunk chunk) {
|
|
@@ -668,8 +634,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)) {
|
|
@@ -695,8 +659,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
}
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
@VisibleForTesting
|
|
@@ -978,17 +940,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
|
|
@@ -1009,9 +967,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();
|
|
@@ -1023,7 +978,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 9b3fea1260c46496b118fcec5d3556c77a973589..aa27b21deb786c15b193654bd3889e9f0a862b0b 100644
|
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -104,8 +104,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;
|
|
@@ -1340,14 +1338,10 @@ public class ServerPlayer extends Player {
|
|
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();
|
|
@@ -1364,7 +1358,6 @@ public class ServerPlayer extends Player {
|
|
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 d385cb836b7713f2dbd0b8693777c8e5ea0a74e4..976525a885cf6422f8a40e92d594eef312c159bd 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 6e854244ccb4c84de907934c952b33fd8d2ef6ee..46c8358e61ca2e1e7e63e301dc8a9604e0ec6f97 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;
|
|
@@ -706,8 +704,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()) {
|
|
@@ -764,8 +760,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) {
|
|
@@ -985,8 +979,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;
|
|
@@ -995,7 +987,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
|
|
@@ -1030,8 +1021,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;
|
|
@@ -1054,7 +1043,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
if (this.isRemoved()) {
|
|
- profilerFiller.pop();
|
|
} else {
|
|
if (this.horizontalCollision) {
|
|
Vec3 deltaMovement = this.getDeltaMovement();
|
|
@@ -1098,7 +1086,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
|
|
@@ -2954,8 +2941,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) {
|
|
@@ -2966,7 +2951,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
}
|
|
|
|
- profilerFiller.pop();
|
|
} else if (this.portalProcess.hasExpired()) {
|
|
this.portalProcess = null;
|
|
}
|
|
@@ -3521,15 +3505,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;
|
|
}
|
|
|
|
@@ -3545,11 +3526,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
|
|
@@ -3568,7 +3546,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 9129f87af75412bfeb43f9f55aee8fe253cc6251..07df62b79a4ee9c9da77cac8615fad5463628204 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 dbbf6fc4ef52d179ac694b0cfff921323e0c758b..800e12ac2ca850fbd4e2a7df84295ceff758fdac 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;
|
|
@@ -817,8 +815,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);
|
|
@@ -842,7 +838,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
|
|
}
|
|
|
|
@@ -1093,7 +1088,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();
|
|
this.getEntities().get(boundingBox, entity1 -> {
|
|
if (entity1 != entity && predicate.test(entity1)) {
|
|
@@ -1127,7 +1121,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
public <T extends Entity> void getEntities(
|
|
EntityTypeTest<Entity, T> entityTypeTest, AABB bounds, Predicate<? super T> predicate, List<? super T> output, int maxResults
|
|
) {
|
|
- Profiler.get().incrementCounter("getEntities");
|
|
this.getEntities().get(entityTypeTest, bounds, entity -> {
|
|
if (predicate.test(entity)) {
|
|
output.add(entity);
|
|
diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java
|
|
index 3a864c568cd66a680760bb4df2cb020e323e9a9d..3888e174963c2e95f1cd2258c4c1d6ec4a85d267 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;
|
|
@@ -139,16 +137,11 @@ 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) {
|
|
if (spawnState.canSpawnForCategoryLocal(mobCategory, chunk.getPos())) {
|
|
spawnCategoryForChunk(mobCategory, level, chunk, spawnState::canSpawn, spawnState::afterSpawn);
|
|
}
|
|
}
|
|
-
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
// Paper start - Add mobcaps commands
|
|
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
|
index 01083cf32b4b0bd57d1b0ac83eb4e43d9d90fa98..5b839c2a682595ecedf15ab08fecbf8861a9caa5 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;
|
|
@@ -364,10 +362,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 08e2442f6965cc6eaab67bdf9340a5152c08db2a..626e87d9c1862fe0c896172ee240844e50d7902f 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;
|
|
@@ -336,12 +334,8 @@ public class LevelChunk extends ChunkAccess {
|
|
}
|
|
|
|
if (LightEngine.hasDifferentLightProperties(blockState, state)) {
|
|
- ProfilerFiller profilerFiller = Profiler.get();
|
|
- profilerFiller.push("updateSkyLightSources");
|
|
this.skyLightSources.update(this, i, y, i2);
|
|
- profilerFiller.popPush("queueCheckLight");
|
|
this.level.getChunkSource().getLightEngine().checkBlock(pos);
|
|
- profilerFiller.pop();
|
|
}
|
|
|
|
boolean flag = !blockState.is(block);
|
|
@@ -840,8 +834,6 @@ public class LevelChunk extends ChunkAccess {
|
|
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);
|
|
@@ -855,8 +847,6 @@ public class LevelChunk extends ChunkAccess {
|
|
}
|
|
// 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();
|
|
}
|