From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 16 Jul 2022 21:37:10 -0500 Subject: [PATCH] Remove Mojang Profiler diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java index c57d77a5412463ee842f1cd9f6fa9f66d6f601bf..a92f969e99202922ba27b28f88b738e6f96efc60 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java @@ -166,7 +166,7 @@ public class Commands { DamageCommand.register(this.dispatcher, commandRegistryAccess); DataCommands.register(this.dispatcher); DataPackCommand.register(this.dispatcher); - DebugCommand.register(this.dispatcher); + //DebugCommand.register(this.dispatcher); // Purpur DefaultGameModeCommands.register(this.dispatcher); DifficultyCommand.register(this.dispatcher); EffectCommands.register(this.dispatcher, commandRegistryAccess); @@ -344,9 +344,9 @@ public class Commands { // Paper end CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource(); - commandlistenerwrapper.getServer().getProfiler().push(() -> { + /*commandlistenerwrapper.getServer().getProfiler().push(() -> { // Purpur return "/" + s; - }); + });*/ // Purpur ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - Add UnknownCommandEvent try { @@ -376,7 +376,7 @@ public class Commands { Commands.LOGGER.error("'/{}' threw an exception", s, exception); } } finally { - commandlistenerwrapper.getServer().getProfiler().pop(); + //commandlistenerwrapper.getServer().getProfiler().pop(); // Purpur } } diff --git a/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java b/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java index 9f5c3ec2eae9b30bdb8dbcb328d7f701cb7aeb9d..e7cc8105fff9cb952eabfd006e0a4e4638091019 100644 --- a/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java +++ b/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java @@ -42,7 +42,7 @@ public class BuildContexts> { ChainModifiers chainModifiers = flags; List list = sources; if (contextChain.getStage() != Stage.EXECUTE) { - context.profiler().push(() -> "prepare " + this.commandInput); + //context.profiler().push(() -> "prepare " + this.commandInput); // Purpur try { for (int i = context.forkLimit(); contextChain.getStage() != Stage.EXECUTE; contextChain = contextChain.nextStage()) { @@ -86,7 +86,7 @@ public class BuildContexts> { } } } finally { - context.profiler().pop(); + //context.profiler().pop(); // Purpur } } diff --git a/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java b/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java index e9775b4506909bee65a74964f0d5391a0513de1d..684f7f202305c09b1037c5d38a52a5ea7f00751b 100644 --- a/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java +++ b/src/main/java/net/minecraft/commands/execution/tasks/ExecuteCommand.java @@ -23,7 +23,7 @@ public class ExecuteCommand> implements Unbo @Override public void execute(T executionCommandSource, ExecutionContext executionContext, Frame frame) { - executionContext.profiler().push(() -> "execute " + this.commandInput); + //executionContext.profiler().push(() -> "execute " + this.commandInput); // Purpur try { executionContext.incrementCost(); @@ -37,7 +37,7 @@ public class ExecuteCommand> implements Unbo } catch (CommandSyntaxException var9) { executionCommandSource.handleError(var9, this.modifiers.isForked(), executionContext.tracer()); } finally { - executionContext.profiler().pop(); + //executionContext.profiler().pop(); // Purpur } } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 1fbbf1ff63a186099f47b9c478dead3e416099ee..642627e37014d5bf634ea7a153ce1abf0be9bf06 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -347,13 +347,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { + //this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; // Purpur + //this.profiler = this.metricsRecorder.getProfiler(); // Purpur + /*this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur this.stopRecordingMetrics(); - }; - this.onMetricsRecordingFinished = (path) -> { - }; + };*/ // Purpur + //this.onMetricsRecordingFinished = (path) -> { // Purpur + //}; // Purpur this.random = RandomSource.create(); this.port = -1; this.levels = Maps.newLinkedHashMap(); @@ -975,9 +975,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return false; } : this::haveTime); - this.profiler.popPush("nextTickWait"); + //this.profiler.popPush("nextTickWait"); // Purpur this.mayHaveDelayedTasks = true; this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos); // Purpur start @@ -1272,9 +1272,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; try { this.isSaving = true; @@ -1626,7 +1626,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Purpur - this.profiler.push(() -> { + /*this.profiler.push(() -> { // Purpur String s = String.valueOf(worldserver); return s + " " + String.valueOf(worldserver.dimension().location()); - }); + });*/ // Purpur /* Drop global time updates if (this.tickCount % 20 == 0) { - this.profiler.push("timeSync"); + //this.profiler.push("timeSync"); // Purpur this.synchronizeTime(worldserver); - this.profiler.pop(); + //this.profiler.pop(); // Purpur } // CraftBukkit end */ - this.profiler.push("tick"); + //this.profiler.push("tick"); // Purpur try { //worldserver.timings.doTick.startTiming(); // Spigot // Purpur @@ -1822,17 +1822,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { this.executeBlocking(() -> { this.saveDebugReport(path.resolve("server")); @@ -2843,40 +2844,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resultConsumer, Consumer dumpConsumer) { - this.onMetricsRecordingStopped = (methodprofilerresults) -> { + /*this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur this.stopRecordingMetrics(); resultConsumer.accept(methodprofilerresults); }; this.onMetricsRecordingFinished = dumpConsumer; - this.willStartRecordingMetrics = true; + this.willStartRecordingMetrics = true;*/ // Purpur } public void stopRecordingMetrics() { - this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; + //this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; // Purpur } public void finishRecordingMetrics() { - this.metricsRecorder.end(); + //this.metricsRecorder.end(); // Purpur } public void cancelRecordingMetrics() { - this.metricsRecorder.cancel(); - this.profiler = this.metricsRecorder.getProfiler(); + //this.metricsRecorder.cancel(); // Purpur + //this.profiler = this.metricsRecorder.getProfiler(); // Purpur } public Path getWorldPath(LevelResource worldSavePath) { @@ -2929,15 +2930,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> functions, ResourceLocation label) { - ProfilerFiller gameprofilerfiller = this.server.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.server.getProfiler(); // Purpur Objects.requireNonNull(label); - gameprofilerfiller.push(label::toString); + //gameprofilerfiller.push(label::toString); // Purpur Iterator iterator = functions.iterator(); while (iterator.hasNext()) { @@ -65,15 +65,15 @@ public class ServerFunctionManager { this.execute(commandfunction, this.getGameLoopSender()); } - this.server.getProfiler().pop(); + //this.server.getProfiler().pop(); // Purpur } public void execute(CommandFunction function, CommandSourceStack source) { - ProfilerFiller gameprofilerfiller = this.server.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.server.getProfiler(); // Purpur - gameprofilerfiller.push(() -> { + /*gameprofilerfiller.push(() -> { // Purpur return "function " + String.valueOf(function.id()); - }); + });*/ // Purpur try { InstantiatedFunction instantiatedfunction = function.instantiate((CompoundTag) null, this.getDispatcher()); @@ -86,7 +86,7 @@ public class ServerFunctionManager { } catch (Exception exception) { ServerFunctionManager.LOGGER.warn("Failed to execute function {}", function.id(), exception); } finally { - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java index 2b8448ccb0e4750b722933b0b5de02d8f4f38788..345f143b0eeb77acb96e4bc716f3b23782ac782f 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -541,20 +541,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected void tick(BooleanSupplier shouldKeepTicking) { - ProfilerFiller gameprofilerfiller = this.level.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur //try (Timing ignored = this.level.timings.poiUnload.startTiming()) { // Paper // Purpur - gameprofilerfiller.push("poi"); + //gameprofilerfiller.push("poi"); // Purpur this.poiManager.tick(shouldKeepTicking); //} // Paper // Purpur - gameprofilerfiller.popPush("chunk_unload"); + //gameprofilerfiller.popPush("chunk_unload"); // Purpur if (!this.level.noSave()) { //try (Timing ignored = this.level.timings.chunkUnload.startTiming()) { // Paper // Purpur this.processUnloads(shouldKeepTicking); //} // Paper // Purpur } - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } public boolean hasWork() { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java index 07b428ed7837642254b1edd55fd08a7beac7e303..476a04d87a61b021816d2970e86042bde32d95a2 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -259,14 +259,14 @@ public class ServerChunkCache extends ChunkSource { return ifLoaded; } // Paper end - Perf: Optimise getChunkAt calls for loaded chunks - ProfilerFiller gameprofilerfiller = this.level.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur - gameprofilerfiller.incrementCounter("getChunk"); + //gameprofilerfiller.incrementCounter("getChunk"); // Purpur long k = ChunkPos.asLong(x, z); // Paper - rewrite chunk system - there are no correct callbacks to remove items from cache in the new chunk system - gameprofilerfiller.incrementCounter("getChunkCacheMiss"); + //gameprofilerfiller.incrementCounter("getChunkCacheMiss"); // Purpur CompletableFuture> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create); ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor; @@ -459,26 +459,26 @@ public class ServerChunkCache extends ChunkSource { // CraftBukkit start - modelled on below public void purgeUnload() { if (true) return; // Paper - tickets will be removed later, this behavior isn't really well accounted for by the chunk system - this.level.getProfiler().push("purge"); + //this.level.getProfiler().push("purge"); // Purpur this.distanceManager.purgeStaleTickets(); this.runDistanceManagerUpdates(); - this.level.getProfiler().popPush("unload"); + //this.level.getProfiler().popPush("unload"); // Purpur this.chunkMap.tick(() -> true); - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur this.clearCache(); } // CraftBukkit end @Override public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { - this.level.getProfiler().push("purge"); + //this.level.getProfiler().push("purge"); // Purpur //this.level.timings.doChunkMap.startTiming(); // Spigot // Purpur if (this.level.tickRateManager().runsNormally() || !tickChunks) { this.distanceManager.purgeStaleTickets(); } this.runDistanceManagerUpdates(); //this.level.timings.doChunkMap.stopTiming(); // Spigot // Purpur - this.level.getProfiler().popPush("chunks"); + //this.level.getProfiler().popPush("chunks"); // Purpur if (tickChunks) { //this.level.timings.chunks.startTiming(); // Paper - timings // Purpur this.chunkMap.level.playerChunkLoader.tick(); // Paper - replace player chunk loader - this is mostly required to account for view distance changes @@ -488,10 +488,10 @@ public class ServerChunkCache extends ChunkSource { } //this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur - this.level.getProfiler().popPush("unload"); + //this.level.getProfiler().popPush("unload"); // Purpur this.chunkMap.tick(shouldKeepTicking); //this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur this.clearCache(); } @@ -501,17 +501,17 @@ public class ServerChunkCache extends ChunkSource { this.lastInhabitedUpdate = i; if (!this.level.isDebug()) { - ProfilerFiller gameprofilerfiller = this.level.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur - gameprofilerfiller.push("pollingChunks"); - gameprofilerfiller.push("filteringLoadedChunks"); + //gameprofilerfiller.push("pollingChunks"); // Purpur + //gameprofilerfiller.push("filteringLoadedChunks"); // Purpur // Paper - optimise chunk tick iteration //if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur // Paper - optimise chunk tick iteration if (this.level.tickRateManager().runsNormally()) { - gameprofilerfiller.popPush("naturalSpawnCount"); + //gameprofilerfiller.popPush("naturalSpawnCount"); // Purpur //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur int k = this.distanceManager.getNaturalSpawnChunkCount(); // Paper start - Optional per player mob spawns @@ -540,7 +540,7 @@ public class ServerChunkCache extends ChunkSource { // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur this.lastSpawnState = spawnercreature_d; - gameprofilerfiller.popPush("spawnAndTick"); + //gameprofilerfiller.popPush("spawnAndTick"); // Purpur boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit // Paper start - optimise chunk tick iteration @@ -648,7 +648,7 @@ public class ServerChunkCache extends ChunkSource { // Paper end - optimise chunk tick iteration // this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur - gameprofilerfiller.popPush("customSpawners"); + //gameprofilerfiller.popPush("customSpawners"); // Purpur if (flag) { //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); @@ -656,7 +656,7 @@ public class ServerChunkCache extends ChunkSource { } } - gameprofilerfiller.popPush("broadcast"); + //gameprofilerfiller.popPush("broadcast"); // Purpur // Paper - optimise chunk tick iteration //this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur // Paper start - optimise chunk tick iteration @@ -674,8 +674,8 @@ public class ServerChunkCache extends ChunkSource { // Paper end - optimise chunk tick iteration //this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur // Paper - optimise chunk tick iteration - gameprofilerfiller.pop(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.pop(); // Purpur } } @@ -847,7 +847,7 @@ public class ServerChunkCache extends ChunkSource { @Override protected void doRunTask(Runnable task) { - ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); + //ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); // Purpur super.doRunTask(task); } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index b727c707ef46a9387fc225b51ef050c6baff1c74..7924e3c597164f71056cd58dd167ee8b1d41b9c3 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -830,16 +830,16 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void tick(BooleanSupplier shouldKeepTicking) { - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur this.handlingTick = true; TickRateManager tickratemanager = this.tickRateManager(); boolean flag = tickratemanager.runsNormally(); if (flag) { - gameprofilerfiller.push("world border"); + //gameprofilerfiller.push("world border"); // Purpur this.getWorldBorder().tick(); - gameprofilerfiller.popPush("weather"); + //gameprofilerfiller.popPush("weather"); // Purpur this.advanceWeatherCycle(); } @@ -871,30 +871,30 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickTime(); } - gameprofilerfiller.popPush("tickPending"); + //gameprofilerfiller.popPush("tickPending"); // Purpur //this.timings.scheduledBlocks.startTiming(); // Paper // Purpur if (!this.isDebug() && flag) { j = this.getGameTime(); - gameprofilerfiller.push("blockTicks"); + //gameprofilerfiller.push("blockTicks"); // Purpur this.blockTicks.tick(j, paperConfig().environment.maxBlockTicks, this::tickBlock); // Paper - configurable max block ticks - gameprofilerfiller.popPush("fluidTicks"); + //gameprofilerfiller.popPush("fluidTicks"); // Purpur this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } //this.timings.scheduledBlocks.stopTiming(); // Paper // Purpur - gameprofilerfiller.popPush("raid"); + //gameprofilerfiller.popPush("raid"); // Purpur if (flag) { // this.timings.raids.startTiming(); // Paper - timings // Purpur this.raids.tick(); // this.timings.raids.stopTiming(); // Paper - timings // Purpur } - gameprofilerfiller.popPush("chunkSource"); + //gameprofilerfiller.popPush("chunkSource"); // Purpur //this.timings.chunkProviderTick.startTiming(); // Paper - timings // Purpur this.getChunkSource().tick(shouldKeepTicking, true); //this.timings.chunkProviderTick.stopTiming(); // Paper - timings // Purpur - gameprofilerfiller.popPush("blockEvents"); + //gameprofilerfiller.popPush("blockEvents"); // Purpur if (flag) { // this.timings.doSounds.startTiming(); // Spigot // Purpur this.runBlockEvents(); @@ -902,7 +902,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } this.handlingTick = false; - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur boolean flag1 = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this if (flag1) { @@ -910,12 +910,12 @@ public class ServerLevel extends Level implements WorldGenLevel { } if (flag1 || this.emptyTime++ < 300) { - gameprofilerfiller.push("entities"); + //gameprofilerfiller.push("entities"); // Purpur //this.timings.tickEntities.startTiming(); // Spigot // Purpur if (this.dragonFight != null && flag) { - gameprofilerfiller.push("dragonFight"); + //gameprofilerfiller.push("dragonFight"); // Purpur this.dragonFight.tick(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } org.spigotmc.ActivationRange.activateEntities(this); // Spigot @@ -925,9 +925,9 @@ public class ServerLevel extends Level implements WorldGenLevel { if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed entity.discard(); } else if (!tickratemanager.isEntityFrozen(entity)) { - gameprofilerfiller.push("checkDespawn"); + //gameprofilerfiller.push("checkDespawn"); // Purpur entity.checkDespawn(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - now always true if in the ticking list Entity entity1 = entity.getVehicle(); @@ -939,22 +939,21 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.stopRiding(); } - gameprofilerfiller.push("tick"); + //gameprofilerfiller.push("tick"); // Purpur this.guardEntityTick(this::tickNonPassenger, entity); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } } } }); //this.timings.entityTick.stopTiming(); // Spigot // Purpur //this.timings.tickEntities.stopTiming(); // Spigot // Purpur - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur this.tickBlockEntities(); } - gameprofilerfiller.push("entityManagement"); + //gameprofilerfiller.push("entityManagement"); // Purpur //this.entityManager.tick(); // Paper - rewrite chunk system - gameprofilerfiller.pop(); } @Override @@ -1034,9 +1033,9 @@ public class ServerLevel extends Level implements WorldGenLevel { boolean flag = this.isRaining(); int j = chunkcoordintpair.getMinBlockX(); int k = chunkcoordintpair.getMinBlockZ(); - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur - gameprofilerfiller.push("thunder"); + //gameprofilerfiller.push("thunder"); // Purpur final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder @@ -1075,7 +1074,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } - gameprofilerfiller.popPush("iceandsnow"); + //gameprofilerfiller.popPush("iceandsnow"); // Purpur if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow for (int l = 0; l < randomTickSpeed; ++l) { @@ -1088,7 +1087,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } // Paper - Option to disable ice and snow - gameprofilerfiller.popPush("tickBlocks"); + //gameprofilerfiller.popPush("tickBlocks"); // Purpur //timings.chunkTicksBlocks.startTiming(); // Paper // Purpur if (randomTickSpeed > 0) { // Paper start - optimize random block ticking @@ -1124,7 +1123,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // Paper end - optimise random block ticking //timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } @VisibleForTesting @@ -1471,19 +1470,19 @@ public class ServerLevel extends Level implements WorldGenLevel { //try { // Purpur // Paper end - timings entity.setOldPosAndRot(); - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur ++entity.tickCount; - this.getProfiler().push(() -> { + /*this.getProfiler().push(() -> { // Purpur return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); - }); - gameprofilerfiller.incrementCounter("tickNonPassenger"); + });*/ // Purpur + //gameprofilerfiller.incrementCounter("tickNonPassenger"); // Purpur if (isActive) { // Paper - EAR 2 TimingHistory.activatedEntityTicks++; entity.tick(); entity.postTick(); // CraftBukkit } else { entity.inactiveTick(); } // Paper - EAR 2 - this.getProfiler().pop(); + //this.getProfiler().pop(); // Purpur //} finally { timer.stopTiming(); } // Paper - timings // Purpur Iterator iterator = entity.getPassengers().iterator(); @@ -1512,12 +1511,12 @@ public class ServerLevel extends Level implements WorldGenLevel { // Paper end passenger.setOldPosAndRot(); ++passenger.tickCount; - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur - gameprofilerfiller.push(() -> { + /*gameprofilerfiller.push(() -> { // Purpur return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString(); - }); - gameprofilerfiller.incrementCounter("tickPassenger"); + });*/ // Purpur + //gameprofilerfiller.incrementCounter("tickPassenger"); // Purpur // Paper start - EAR 2 if (isActive) { passenger.rideTick(); @@ -1529,7 +1528,7 @@ public class ServerLevel extends Level implements WorldGenLevel { vehicle.positionRider(passenger); } // Paper end - EAR 2 - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur Iterator iterator = passenger.getPassengers().iterator(); while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index b35262abbd9516b6405da3e599f2681a5a415242..365e0b0cf949d10423ef4e290888db7359491005 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1317,7 +1317,7 @@ public class ServerPlayer extends Player { PortalInfo shapedetectorshape = this.findDimensionEntryPoint(worldserver); if (shapedetectorshape != null) { - worldserver1.getProfiler().push("moving"); + //worldserver1.getProfiler().push("moving"); // Purpur worldserver = shapedetectorshape.world; // CraftBukkit if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event if (resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit @@ -1340,8 +1340,8 @@ public class ServerPlayer extends Player { worldserver = ((CraftWorld) exit.getWorld()).getHandle(); // CraftBukkit end - worldserver1.getProfiler().pop(); - worldserver1.getProfiler().push("placing"); + //worldserver1.getProfiler().pop(); // Purpur + //worldserver1.getProfiler().push("placing"); // Purpur if (true) { // CraftBukkit this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds @@ -1359,7 +1359,7 @@ public class ServerPlayer extends Player { this.connection.teleport(exit); // CraftBukkit - use internal teleport without event this.connection.resetPosition(); worldserver.addDuringPortalTeleport(this); - worldserver1.getProfiler().pop(); + //worldserver1.getProfiler().pop(); // Purpur this.triggerDimensionChangeTriggers(worldserver1); this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); playerlist.sendLevelInfo(this, worldserver); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index 26ccb217b846410c826cb1da017b45903d9c5469..b82a72775f9de5ad65ae46a8b97f93a7ef852265 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -265,7 +265,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } protected void keepConnectionAlive() { - this.server.getProfiler().push("keepAlive"); + //this.server.getProfiler().push("keepAlive"); // Purpur // Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings // This should effectively place the keepalive handling back to "as it was" before 1.12.2 long currentTime = Util.getMillis(); @@ -298,7 +298,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } // Paper end - give clients a longer time to respond to pings as per pre 1.12.2 timings - this.server.getProfiler().pop(); + //this.server.getProfiler().pop(); // Purpur } private boolean checkIfClosed(long time) { diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java index f14113eef226e906c0d21641e74a27471254909d..0c25f3ed0a8a538edc7cadd3476100c9b3631f7a 100644 --- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java @@ -16,11 +16,11 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener Executor applyExecutor ) { return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> { - applyProfiler.startTick(); - applyProfiler.push("listener"); + //applyProfiler.startTick(); // Purpur + //applyProfiler.push("listener"); // Purpur this.onResourceManagerReload(manager); - applyProfiler.pop(); - applyProfiler.endTick(); + //applyProfiler.pop(); // Purpur + //applyProfiler.endTick(); // Purpur }, applyExecutor); } diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java index bce2dac613d29083dd5fbb68739304cc5a6d4d27..600a7036b503f60cc9c95f189f73c2dbf020e2e1 100644 --- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java +++ b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java @@ -55,7 +55,7 @@ public class ActiveProfiler implements ProfileCollector { this.started = true; this.path = ""; this.paths.clear(); - this.push("root"); + //this.push("root"); // Purpur } } @@ -64,7 +64,7 @@ public class ActiveProfiler implements ProfileCollector { if (!this.started) { LOGGER.error("Profiler tick already ended - missing startTick()?"); } else { - this.pop(); + //this.pop(); // Purpur this.started = false; if (!this.path.isEmpty()) { LOGGER.error( @@ -93,7 +93,7 @@ public class ActiveProfiler implements ProfileCollector { @Override public void push(Supplier locationGetter) { - this.push(locationGetter.get()); + //this.push(locationGetter.get()); // Purpur } @Override @@ -132,14 +132,14 @@ public class ActiveProfiler implements ProfileCollector { @Override public void popPush(String location) { - this.pop(); - this.push(location); + //this.pop(); // Purpur + //this.push(location); // Purpur } @Override public void popPush(Supplier locationGetter) { - this.pop(); - this.push(locationGetter); + //this.pop(); // Purpur + //this.push(locationGetter); // Purpur } private ActiveProfiler.PathEntry getCurrentEntry() { diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java index a715ecf4a8ac91d3e5e5c6269d89e54b2c1cd279..223c3665126c576eddb1a8f7c9f5bc60c6ff9818 100644 --- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java +++ b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java @@ -6,32 +6,44 @@ import net.minecraft.util.profiling.metrics.MetricCategory; public interface ProfilerFiller { String ROOT = "root"; + @io.papermc.paper.annotation.DoNotUse // Purpur void startTick(); + @io.papermc.paper.annotation.DoNotUse // Purpur void endTick(); + @io.papermc.paper.annotation.DoNotUse // Purpur void push(String location); + @io.papermc.paper.annotation.DoNotUse // Purpur void push(Supplier locationGetter); + @io.papermc.paper.annotation.DoNotUse // Purpur void pop(); + @io.papermc.paper.annotation.DoNotUse // Purpur void popPush(String location); + @io.papermc.paper.annotation.DoNotUse // Purpur void popPush(Supplier locationGetter); + @io.papermc.paper.annotation.DoNotUse // Purpur void markForCharting(MetricCategory type); + @io.papermc.paper.annotation.DoNotUse // Purpur default void incrementCounter(String marker) { - this.incrementCounter(marker, 1); + //this.incrementCounter(marker, 1); // Purpur } + @io.papermc.paper.annotation.DoNotUse // Purpur void incrementCounter(String marker, int num); + @io.papermc.paper.annotation.DoNotUse // Purpur default void incrementCounter(Supplier markerGetter) { - this.incrementCounter(markerGetter, 1); + //this.incrementCounter(markerGetter, 1); // Purpur } + @io.papermc.paper.annotation.DoNotUse // Purpur void incrementCounter(Supplier markerGetter, int num); static ProfilerFiller tee(ProfilerFiller a, ProfilerFiller b) { @@ -41,62 +53,62 @@ public interface ProfilerFiller { return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() { @Override public void startTick() { - a.startTick(); - b.startTick(); + //a.startTick(); // Purpur + //b.startTick(); // Purpur } @Override public void endTick() { - a.endTick(); - b.endTick(); + //a.endTick(); // Purpur + //b.endTick(); // Purpur } @Override public void push(String location) { - a.push(location); - b.push(location); + //a.push(location); // Purpur + //b.push(location); // Purpur } @Override public void push(Supplier locationGetter) { - a.push(locationGetter); - b.push(locationGetter); + //a.push(locationGetter); // Purpur + //b.push(locationGetter); // Purpur } @Override public void markForCharting(MetricCategory type) { - a.markForCharting(type); - b.markForCharting(type); + //a.markForCharting(type); // Purpur + //b.markForCharting(type); // Purpur } @Override public void pop() { - a.pop(); - b.pop(); + //a.pop(); // Purpur + //b.pop(); // Purpur } @Override public void popPush(String location) { - a.popPush(location); - b.popPush(location); + //a.popPush(location); // Purpur + //b.popPush(location); // Purpur } @Override public void popPush(Supplier locationGetter) { - a.popPush(locationGetter); - b.popPush(locationGetter); + //a.popPush(locationGetter); // Purpur + //b.popPush(locationGetter); // Purpur } @Override public void incrementCounter(String marker, int num) { - a.incrementCounter(marker, num); - b.incrementCounter(marker, num); + //a.incrementCounter(marker, num); // Purpur + //b.incrementCounter(marker, num); // Purpur } @Override public void incrementCounter(Supplier markerGetter, int num) { - a.incrementCounter(markerGetter, num); - b.incrementCounter(markerGetter, num); + //a.incrementCounter(markerGetter, num); // Purpur + //b.incrementCounter(markerGetter, num); // Purpur } }; } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 68e8f9913055219486ce19d95dcf9d7c76e08082..2c3ad553272ad651e6ca26917719e6d9fffdef68 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -897,7 +897,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // CraftBukkit end public void baseTick() { - this.level().getProfiler().push("entityBaseTick"); + //this.level().getProfiler().push("entityBaseTick"); // Purpur if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups this.inBlockState = null; if (this.isPassenger() && this.getVehicle().isRemoved()) { @@ -958,7 +958,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } this.firstTick = false; - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } public void setSharedFlagOnFire(boolean onFire) { @@ -1175,7 +1175,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } - this.level().getProfiler().push("move"); + //this.level().getProfiler().push("move"); // Purpur if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) { movement = movement.multiply(this.stuckSpeedMultiplier); this.stuckSpeedMultiplier = Vec3.ZERO; @@ -1184,7 +1184,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // Paper start - ignore movement changes while inactive. if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && movementType == MoverType.SELF) { setDeltaMovement(Vec3.ZERO); - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur return; } // Paper end @@ -1205,8 +1205,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z); } - this.level().getProfiler().pop(); - this.level().getProfiler().push("rest"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("rest"); // Purpur boolean flag = !Mth.equal(movement.x, vec3d1.x); boolean flag1 = !Mth.equal(movement.z, vec3d1.z); @@ -1225,7 +1225,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.checkFallDamage(vec3d1.y, this.onGround(), iblockdata, blockposition); if (this.isRemoved()) { - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } else { if (this.horizontalCollision) { Vec3 vec3d2 = this.getDeltaMovement(); @@ -1363,7 +1363,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setRemainingFireTicks(-this.getFireImmuneTicks()); } - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } } // Paper start - detailed watchdog information @@ -3258,7 +3258,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess ServerLevel worldserver1 = minecraftserver.getLevel(resourcekey); if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit - this.level().getProfiler().push("portal"); + //this.level().getProfiler().push("portal"); // Purpur this.portalTime = i; // Paper start - Add EntityPortalReadyEvent io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER); @@ -3276,7 +3276,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } // Paper - Add EntityPortalReadyEvent // CraftBukkit end - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } this.isInsidePortal = false; @@ -3736,14 +3736,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } // Paper end - Fix item duplication and teleport issues if (this.level() instanceof ServerLevel && !this.isRemoved()) { - this.level().getProfiler().push("changeDimension"); + //this.level().getProfiler().push("changeDimension"); // Purpur // CraftBukkit start // this.unRide(); if (worldserver == null) { return null; } // CraftBukkit end - this.level().getProfiler().push("reposition"); + //this.level().getProfiler().push("reposition"); // Purpur PortalInfo shapedetectorshape = (location == null) ? this.findDimensionEntryPoint(worldserver) : new PortalInfo(new Vec3(location.x(), location.y(), location.z()), Vec3.ZERO, this.yRot, this.xRot, worldserver, null); // CraftBukkit if (shapedetectorshape == null) { @@ -3782,7 +3782,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.unRide(); // CraftBukkit end - this.level().getProfiler().popPush("reloading"); + //this.level().getProfiler().popPush("reloading"); // Purpur // Paper start - Fix item duplication and teleport issues if (this instanceof Mob) { ((Mob) this).dropLeash(true, true); // Paper drop lead @@ -3809,10 +3809,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } this.removeAfterChangingDimensions(); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur ((ServerLevel) this.level()).resetEmptyTime(); worldserver.resetEmptyTime(); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur return entity; } } else { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index 3603e26b253c8489d11784f260b38bc7bc8e69e7..cba8fd846bfe8279252e232277d81a59349d3511 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -423,7 +423,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } super.baseTick(); - this.level().getProfiler().push("livingEntityBaseTick"); + //this.level().getProfiler().push("livingEntityBaseTick"); // Purpur if (this.fireImmune() || this.level().isClientSide) { this.clearFire(); } @@ -526,7 +526,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO = this.yHeadRot; this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } public boolean canSpawnSoulSpeedParticle() { @@ -3227,10 +3227,10 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.run += (f3 - this.run) * 0.3F; - this.level().getProfiler().push("headTurn"); + //this.level().getProfiler().push("headTurn"); // Purpur f2 = this.tickHeadTurn(f1, f2); - this.level().getProfiler().pop(); - this.level().getProfiler().push("rangeChecks"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("rangeChecks"); // Purpur // Paper start - stop large pitch and yaw changes from crashing the server this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; @@ -3242,7 +3242,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; // Paper end - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur this.animStep += f2; if (this.isFallFlying()) { ++this.fallFlyTicks; @@ -3465,19 +3465,19 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.setDeltaMovement(d0, d1, d2); - this.level().getProfiler().push("ai"); + //this.level().getProfiler().push("ai"); // Purpur if (this.isImmobile()) { this.jumping = false; this.xxa = 0.0F; this.zza = 0.0F; } else if (this.isEffectiveAi()) { - this.level().getProfiler().push("newAi"); + //this.level().getProfiler().push("newAi"); // Purpur this.serverAiStep(); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } - this.level().getProfiler().pop(); - this.level().getProfiler().push("jump"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("jump"); // Purpur if (this.jumping && this.isAffectedByFluids()) { double d3; @@ -3504,8 +3504,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.noJumpDelay = 0; } - this.level().getProfiler().pop(); - this.level().getProfiler().push("travel"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("travel"); // Purpur this.xxa *= 0.98F; this.zza *= 0.98F; this.updateFallFlying(); @@ -3530,8 +3530,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.travel(vec3d1); } - this.level().getProfiler().pop(); - this.level().getProfiler().push("freezing"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("freezing"); // Purpur if (!this.level().isClientSide && !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API int i = this.getTicksFrozen(); @@ -3548,15 +3548,15 @@ public abstract class LivingEntity extends Entity implements Attackable { this.hurt(this.damageSources().freeze(), 1.0F); } - this.level().getProfiler().pop(); - this.level().getProfiler().push("push"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("push"); // Purpur if (this.autoSpinAttackTicks > 0) { --this.autoSpinAttackTicks; this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } this.pushEntities(); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur // Paper start - Add EntityMoveEvent // Purpur start if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java index ee98efa69d67cd22eb5722cf68f3b7063e2595c8..56da8a4600688efd1987d82d4fcad1757e33f4f2 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -376,13 +376,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti @Override public void baseTick() { super.baseTick(); - this.level().getProfiler().push("mobBaseTick"); + //this.level().getProfiler().push("mobBaseTick"); // Purpur if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) { this.resetAmbientSoundTime(); this.playAmbientSound(); } - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur incrementTicksSinceLastInteraction(); // Purpur } @@ -747,7 +747,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti @Override public void aiStep() { super.aiStep(); - this.level().getProfiler().push("looting"); + //this.level().getProfiler().push("looting"); // Purpur if (!this.level().isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { Vec3i baseblockposition = this.getPickupReach(); List list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ())); @@ -767,7 +767,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti } } - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } protected Vec3i getPickupReach() { @@ -992,44 +992,44 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti return; } // Paper end - Allow nerfed mobs to jump and float - ProfilerFiller gameprofilerfiller = this.level().getProfiler(); + //ProfilerFiller gameprofilerfiller = this.level().getProfiler(); // Purpur - gameprofilerfiller.push("sensing"); + //gameprofilerfiller.push("sensing"); // Purpur this.sensing.tick(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur int i = this.tickCount + this.getId(); if (i % 2 != 0 && this.tickCount > 1) { - gameprofilerfiller.push("targetSelector"); + //gameprofilerfiller.push("targetSelector"); // Purpur this.targetSelector.tickRunningGoals(false); - gameprofilerfiller.pop(); - gameprofilerfiller.push("goalSelector"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("goalSelector"); // Purpur this.goalSelector.tickRunningGoals(false); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } else { - gameprofilerfiller.push("targetSelector"); + //gameprofilerfiller.push("targetSelector"); // Purpur this.targetSelector.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("goalSelector"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("goalSelector"); // Purpur this.goalSelector.tick(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } - gameprofilerfiller.push("navigation"); + //gameprofilerfiller.push("navigation"); // Purpur this.navigation.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("mob tick"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("mob tick"); // Purpur this.customServerAiStep(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("controls"); - gameprofilerfiller.push("move"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("controls"); // Purpur + //gameprofilerfiller.push("move"); // Purpur this.moveControl.tick(); - gameprofilerfiller.popPush("look"); + //gameprofilerfiller.popPush("look"); // Purpur this.lookControl.tick(); - gameprofilerfiller.popPush("jump"); + //gameprofilerfiller.popPush("jump"); // Purpur this.jumpControl.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.pop(); // Purpur this.sendDebugPackets(); } diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java index 74d4f653d5c7f1923c59019effd78337402f7025..b4e4670536f6dcea109c029d75d9710cb386f1d0 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java @@ -87,8 +87,8 @@ public class GoalSelector { } public void tick() { - ProfilerFiller profilerFiller = this.profiler.get(); - profilerFiller.push("goalCleanup"); + //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur + //profilerFiller.push("goalCleanup"); // Purpur for (WrappedGoal wrappedGoal : this.availableGoals) { if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams @@ -97,8 +97,8 @@ public class GoalSelector { } this.lockedFlags.entrySet().removeIf(entry -> !entry.getValue().isRunning()); - profilerFiller.pop(); - profilerFiller.push("goalUpdate"); + //profilerFiller.pop(); // Purpur + //profilerFiller.push("goalUpdate"); // Purpur for (WrappedGoal wrappedGoal2 : this.availableGoals) { // Paper start @@ -118,13 +118,13 @@ public class GoalSelector { } } - profilerFiller.pop(); + //profilerFiller.pop(); // Purpur this.tickRunningGoals(true); } public void tickRunningGoals(boolean tickAll) { - ProfilerFiller profilerFiller = this.profiler.get(); - profilerFiller.push("goalTick"); + //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur + //profilerFiller.push("goalTick"); // Purpur for (WrappedGoal wrappedGoal : this.availableGoals) { if (wrappedGoal.isRunning() && (tickAll || wrappedGoal.requiresUpdateEveryTick())) { @@ -132,7 +132,7 @@ public class GoalSelector { } } - profilerFiller.pop(); + //profilerFiller.pop(); // Purpur } public Set getAvailableGoals() { diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java index 2e9991e6b3c05584002744a2ee2579b1dba218b2..544920a31b649985333f82beafa94a3392f5853e 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java @@ -172,12 +172,12 @@ public abstract class PathNavigation { } } // Paper end - EntityPathfindEvent - this.level.getProfiler().push("pathfind"); + //this.level.getProfiler().push("pathfind"); // Purpur BlockPos blockPos = useHeadPos ? this.mob.blockPosition().above() : this.mob.blockPosition(); int i = (int)(followRange + (float)range); PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i)); Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier); - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur if (path != null && path.getTarget() != null) { this.targetPos = path.getTarget(); this.reachRange = distance; diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java index 51772f03a3469b11e7166ec6f3a1b9c64a606221..02f2f46ccc48bb4d9bd08555818b0489f60d9f13 100644 --- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java +++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java @@ -26,9 +26,9 @@ public class Sensing { } else if (this.unseen.contains(i)) { return false; } else { - this.mob.level().getProfiler().push("hasLineOfSight"); + //this.mob.level().getProfiler().push("hasLineOfSight"); // Purpur boolean bl = this.mob.hasLineOfSight(entity); - this.mob.level().getProfiler().pop(); + //this.mob.level().getProfiler().pop(); // Purpur if (bl) { this.seen.add(i); } else { diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java index 09502b15c20f401c3b56ecedc4d3b515384d654f..bca7b7192debb3a34a08047010a2438e7b7e2a78 100644 --- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java @@ -252,13 +252,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS @Override protected void customServerAiStep() { - this.level().getProfiler().push("allayBrain"); + //this.level().getProfiler().push("allayBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel) this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("allayActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("allayActivityUpdate"); // Purpur AllayAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java index 29412208e329e9fc211b844822a2fc3328a5bc89..f8790ab5b7c1279719271ee57c00f4f2d6ce9714 100644 --- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java @@ -130,12 +130,12 @@ public class Armadillo extends Animal { @Override protected void customServerAiStep() { - this.level().getProfiler().push("armadilloBrain"); + //this.level().getProfiler().push("armadilloBrain"); // Purpur ((Brain) this.brain).tick((ServerLevel) this.level(), this); // CraftBukkit - decompile error - this.level().getProfiler().pop(); - this.level().getProfiler().push("armadilloActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("armadilloActivityUpdate"); // Purpur ArmadilloAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) { this.playSound(SoundEvents.ARMADILLO_SCUTE_DROP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); this.forceDrops = true; // CraftBukkit diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java index ea1515f189bf3bc4cfef4524fb40f0d826f68cc0..d330f79e860662bc93a1703215e66e6564d181b9 100644 --- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java @@ -307,13 +307,13 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder optional = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS); diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java index ed67fcd2b67bfe581863cc6748692c3348f6c883..24a1663cf1cd3f888981a13907811b55bdbf6133 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java @@ -151,14 +151,14 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @Override protected void customServerAiStep() { - this.level().getProfiler().push("camelBrain"); + //this.level().getProfiler().push("camelBrain"); // Purpur Brain behaviorcontroller = (Brain) this.getBrain(); // CraftBukkit - decompile error behaviorcontroller.tick((ServerLevel) this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("camelActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("camelActivityUpdate"); // Purpur CamelAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java index b0f8115b328eda1e3571051870b5310c5a7e115a..ee8c232ddaa518377bdfa54e83ffc04f7a2f2c9a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java @@ -237,13 +237,13 @@ public class Frog extends Animal implements VariantHolder> { @Override protected void customServerAiStep() { - this.level().getProfiler().push("frogBrain"); + //this.level().getProfiler().push("frogBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel)this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("frogActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("frogActivityUpdate"); // Purpur FrogAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java index b98a34357e59168bbb22c967b86a449fc91f47f0..09c4cf772df4644413e40055fedcdf42ee8064fd 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java @@ -122,13 +122,13 @@ public class Tadpole extends AbstractFish { @Override protected void customServerAiStep() { - this.level().getProfiler().push("tadpoleBrain"); + //this.level().getProfiler().push("tadpoleBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel) this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("tadpoleActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("tadpoleActivityUpdate"); // Purpur TadpoleAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java index 79c27b5717fec000ea94138ebc76dbabf5b2eeaf..4e855055abe4d300b6b126e8a9deecaab5827a33 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java @@ -224,13 +224,13 @@ public class Goat extends Animal { @Override protected void customServerAiStep() { - this.level().getProfiler().push("goatBrain"); + //this.level().getProfiler().push("goatBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel) this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("goatActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("goatActivityUpdate"); // Purpur GoatAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java index 0cc5b9e44dd6f1e0afdbb62ef41aa749c0c79b18..21bdcbd51d9f440e0734750b40cefa4c08cdaf5f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java @@ -504,11 +504,11 @@ public class Sniffer extends Animal { @Override protected void customServerAiStep() { - this.level().getProfiler().push("snifferBrain"); + //this.level().getProfiler().push("snifferBrain"); // Purpur this.getBrain().tick((ServerLevel) this.level(), this); - this.level().getProfiler().popPush("snifferActivityUpdate"); + //this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur SnifferAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java index 451762b3cd023b8c5828f68e2778aada9c50ab85..f9bb83f35a41e5b076ae438af613a97b8e60c0c3 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java @@ -266,10 +266,10 @@ public class Zoglin extends Monster implements Enemy, HoglinBase { @Override protected void customServerAiStep() { - this.level().getProfiler().push("zoglinBrain"); + //this.level().getProfiler().push("zoglinBrain"); // Purpur if (getRider() == null || !this.isControllable()) // Purpur - only use brain if no rider this.getBrain().tick((ServerLevel)this.level(), this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur this.updateActivity(); } diff --git a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java index 796ce24185ab9e80864116f9523c4289fcaad243..82391c84789c27353212d3142c036cc5aedb98f9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java +++ b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java @@ -226,11 +226,11 @@ public class Breeze extends Monster { @Override protected void customServerAiStep() { - this.level().getProfiler().push("breezeBrain"); + //this.level().getProfiler().push("breezeBrain"); // Purpur this.getBrain().tick((ServerLevel)this.level(), this); - this.level().getProfiler().popPush("breezeActivityUpdate"); + //this.level().getProfiler().popPush("breezeActivityUpdate"); // Purpur BreezeAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java index a69a4d860cf537322cdf96bfd42e55d3fc684dd1..757d2b7bcb83f5bdcddf85a00e90288f3b82a2d6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java @@ -192,10 +192,10 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { @Override protected void customServerAiStep() { - this.level().getProfiler().push("hoglinBrain"); + //this.level().getProfiler().push("hoglinBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel)this.level(), this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur HoglinAi.updateActivity(this); if (this.isConverting()) { this.timeInOverworld++; diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java index 811b622945ecf67cff1992c3cdd4fcd84f33fb68..1b5977aa14d9a7254e7692bb152cc2808d52107a 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java @@ -328,10 +328,10 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override protected void customServerAiStep() { - this.level().getProfiler().push("piglinBrain"); + //this.level().getProfiler().push("piglinBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel) this.level(), this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur PiglinAi.updateActivity(this); super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java index 71d2501e88a99819ef305fa8715418aad65ec81d..407a0f27719d3944b3a005c664d80246ea1c7cf4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java @@ -138,10 +138,10 @@ public class PiglinBrute extends AbstractPiglin { @Override protected void customServerAiStep() { - this.level().getProfiler().push("piglinBruteBrain"); + //this.level().getProfiler().push("piglinBruteBrain"); // Purpur if (getRider() == null || this.isControllable()) // Purpur - only use brain if no rider this.getBrain().tick((ServerLevel)this.level(), this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur PiglinBruteAi.updateActivity(this); PiglinBruteAi.maybePlayActivitySound(this); super.customServerAiStep(); diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java index 9f5325444cc4f64fc88f85794fbad09ddd4f7860..0bb577ec9ba0d23a741ccf067ac35f6be68312ca 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java @@ -299,9 +299,10 @@ public class Warden extends Monster implements VibrationSystem { protected void customServerAiStep() { ServerLevel worldserver = (ServerLevel) this.level(); - worldserver.getProfiler().push("wardenBrain"); + //worldserver.getProfiler().push("wardenBrain"); // Purpur + //if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - TODO: Move to Ridables patch this.getBrain().tick(worldserver, this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); if ((this.tickCount + this.getId()) % 120 == 0) { Warden.applyDarknessAround(worldserver, this.position(), this, 20); diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java index dcf580d852ede8ea01f5d91944a224ec6eca73e4..4be218129188c1be8736940170a861adc10fdb7d 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -341,7 +341,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } protected void customServerAiStep(boolean inactive) { // Purpur - not final // Paper end - this.level().getProfiler().push("villagerBrain"); + //this.level().getProfiler().push("villagerBrain"); // Purpur // Purpur start if (this.level().purpurConfig.villagerLobotomizeEnabled) { // treat as inactive if lobotomized @@ -357,7 +357,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler this.getBrain().tick((ServerLevel) this.level(), this); // Paper } // Purpur end*/ // Purpur - TODO: Pufferfish - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur if (this.assignProfessionWhenSpawned) { this.assignProfessionWhenSpawned = false; } diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java index 082b804f4793f72e76361f5427f0358273454b3d..bd5fcb028d41b60de183b4d849f1ba10746fa0d0 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -681,7 +681,7 @@ public class Explosion { } if (flag1) { - this.level.getProfiler().push("explosion_blocks"); + //this.level.getProfiler().push("explosion_blocks"); // Purpur List> list = new ArrayList(); Util.shuffle(this.toBlow, this.level.random); @@ -759,7 +759,7 @@ public class Explosion { Block.popResource(this.level, (BlockPos) pair.getSecond(), (ItemStack) pair.getFirst()); } - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur } if (this.fire) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java index 4d00d72d66adfb282d354e22703552b333138694..eda2f8cc034cf46293be1be117a60cf8b663c303 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1303,9 +1303,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } protected void tickBlockEntities() { - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur - gameprofilerfiller.push("blockEntities"); + //gameprofilerfiller.push("blockEntities"); // Purpur //this.timings.tileEntityPending.startTiming(); // Spigot // Purpur this.tickingBlockEntities = true; if (!this.pendingBlockEntityTickers.isEmpty()) { @@ -1346,7 +1346,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { //this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur this.tickingBlockEntities = false; co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur this.spigotConfig.currentPrimedTnt = 0; // Spigot } @@ -1561,7 +1561,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @Override public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { - this.getProfiler().incrementCounter("getEntities"); + //this.getProfiler().incrementCounter("getEntities"); // Purpur List list = Lists.newArrayList(); ((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call return list; @@ -1580,7 +1580,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public void getEntities(EntityTypeTest filter, AABB box, Predicate predicate, List result, int limit) { - this.getProfiler().incrementCounter("getEntities"); + //this.getProfiler().incrementCounter("getEntities"); // Purpur // Paper start - optimise this call //TODO use limit if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) { @@ -1835,6 +1835,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public ProfilerFiller getProfiler() { + //if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur // Purpur - TODO: Pufferfish return (ProfilerFiller) this.profiler.get(); } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java index 2812505185df691e8f08932aa0bba162a7d9db86..35e94c06361795d032f995e8282f8b35c075dae7 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -127,7 +127,7 @@ public final class NaturalSpawner { } public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, boolean spawnAnimals, boolean spawnMonsters, boolean rareSpawn) { - world.getProfiler().push("spawner"); + //world.getProfiler().push("spawner"); // Purpur //world.timings.mobSpawn.startTiming(); // Spigot // Purpur MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES; int i = aenumcreaturetype.length; @@ -182,7 +182,7 @@ public final class NaturalSpawner { } //world.timings.mobSpawn.stopTiming(); // Spigot // Purpur - world.getProfiler().pop(); + //world.getProfiler().pop(); // Purpur } // Paper start - Add mobcaps commands diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java index e8d14bf4120dd9861e4ccb8bd6c14e175343c55d..fd637415625fdabcac07e120e9168d09c06141d4 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -443,11 +443,11 @@ public class LevelChunk extends ChunkAccess { if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) { ProfilerFiller gameprofilerfiller = this.level.getProfiler(); - gameprofilerfiller.push("updateSkyLightSources"); + //gameprofilerfiller.push("updateSkyLightSources"); // Purpur // Paper - starlight - remove skyLightSources - gameprofilerfiller.popPush("queueCheckLight"); + //gameprofilerfiller.popPush("queueCheckLight"); // Purpur this.level.getChunkSource().getLightEngine().checkBlock(blockposition); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } boolean flag3 = iblockdata1.hasBlockEntity(); @@ -1158,9 +1158,9 @@ public class LevelChunk extends ChunkAccess { if (LevelChunk.this.isTicking(blockposition)) { try { - ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); + //ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); - gameprofilerfiller.push(this::getType); + //gameprofilerfiller.push(this::getType); //this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); @@ -1177,7 +1177,7 @@ public class LevelChunk extends ChunkAccess { // Paper end - Remove the Block Entity if it's invalid } - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); } catch (Throwable throwable) { if (throwable instanceof ThreadDeath) throw throwable; // Paper // Paper start - Prevent block entity and entity crashes diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java index 18bbb3f8f99849333ff4bc020c8ce758a69312a5..404080976208c30e9e95e5bee47c2a749e709a45 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java @@ -53,8 +53,8 @@ public class PathFinder { @Nullable // Paper start - Perf: remove streams and optimize collection private Path findPath(ProfilerFiller profiler, Node startNode, List> positions, float followRange, int distance, float rangeMultiplier) { - profiler.push("find_path"); - profiler.markForCharting(MetricCategory.PATH_FINDING); + //profiler.push("find_path"); // Purpur + //profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur // Set set = positions.keySet(); startNode.g = 0.0F; startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection @@ -122,7 +122,7 @@ public class PathFinder { if (best == null || comparator.compare(path, best) < 0) best = path; } - profiler.pop(); + //profiler.pop(); // Purpur return best; // Paper end - Perf: remove streams and optimize collection } diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java index 7a69564572357a7acc043e35b9c113beeb738951..a6d62abd3102770652f914b9d697c6d3c2533cfc 100644 --- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java +++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java @@ -81,20 +81,20 @@ public class LevelTicks implements LevelTickAccess { } public void tick(long time, int maxTicks, BiConsumer ticker) { - ProfilerFiller profilerFiller = this.profiler.get(); - profilerFiller.push("collect"); - this.collectTicks(time, maxTicks, profilerFiller); - profilerFiller.popPush("run"); - profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); + //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur + //profilerFiller.push("collect"); // Purpur + this.collectTicks(time, maxTicks, null); // Purpur + //profilerFiller.popPush("run"); // Purpur + //profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur this.runCollectedTicks(ticker); - profilerFiller.popPush("cleanup"); + //profilerFiller.popPush("cleanup"); // Purpur this.cleanupAfterTick(); - profilerFiller.pop(); + //profilerFiller.pop(); // Purpur } private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) { this.sortContainersToTick(time); - profiler.incrementCounter("containersToTick", this.containersToTick.size()); + //profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur this.drainContainers(time, maxTicks); this.rescheduleLeftoverContainers(); }