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 a66e2d78722847dec4e9d4aba8e6968ef009fcf4..24cb04cd33cfe578286c85a892b20bbf3fc843e6 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java @@ -165,7 +165,7 @@ public class Commands { DamageCommand.register(this.dispatcher, commandRegistryAccess); DataCommands.register(this.dispatcher); DataPackCommand.register(this.dispatcher); - DebugCommand.register(this.dispatcher); + //DebugCommand.register(this.dispatcher); // Purpur DefaultGameModeCommands.register(this.dispatcher); DifficultyCommand.register(this.dispatcher); EffectCommands.register(this.dispatcher, commandRegistryAccess); @@ -346,9 +346,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 { @@ -378,7 +378,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 a7554d272d13747bed32ce4190b58151b106f7e4..0852e14cbb194bd524147ec443eb2791e9ecf3a6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -422,13 +422,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(); @@ -1033,9 +1033,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return false; } : this::haveTime); @@ -1326,7 +1326,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; try { this.isSaving = true; @@ -1642,7 +1642,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 @@ -1833,17 +1833,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { this.executeBlocking(() -> { this.saveDebugReport(path.resolve("server")); @@ -2854,40 +2855,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) { @@ -2940,15 +2941,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 5d52df83c643845ffbeeba3bb640c9deeae11139..4f02f8b6003580fc178991cbece8ad438efd15cb 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -425,16 +425,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected void tick(BooleanSupplier shouldKeepTicking) { - ProfilerFiller gameprofilerfiller = this.level.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur - gameprofilerfiller.push("poi"); + //gameprofilerfiller.push("poi"); // Purpur this.poiManager.tick(shouldKeepTicking); - gameprofilerfiller.popPush("chunk_unload"); + //gameprofilerfiller.popPush("chunk_unload"); // Purpur if (!this.level.noSave()) { this.processUnloads(shouldKeepTicking); } - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } public boolean hasWork() { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java index bb7e02af46ecd313debcfb778d3390ad5f2c3991..01683897aa15cd280f28a26057237e82db46df15 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -381,26 +381,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon // CraftBukkit start - modelled on below public void purgeUnload() { - this.level.getProfiler().push("purge"); + //this.level.getProfiler().push("purge"); // Purpur this.distanceManager.purgeStaleTickets(); this.runDistanceManagerUpdates(); - this.level.getProfiler().popPush("unload"); + //this.level.getProfiler().popPush("unload"); // Purpur this.chunkMap.tick(() -> true); - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur this.clearCache(); } // CraftBukkit end @Override public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { - this.level.getProfiler().push("purge"); + //this.level.getProfiler().push("purge"); // Purpur //this.level.timings.doChunkMap.startTiming(); // Spigot // Purpur if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot this.distanceManager.purgeStaleTickets(); } this.runDistanceManagerUpdates(); //this.level.timings.doChunkMap.stopTiming(); // Spigot // Purpur - this.level.getProfiler().popPush("chunks"); + //this.level.getProfiler().popPush("chunks"); // Purpur if (tickChunks) { //this.level.timings.chunks.startTiming(); // Paper - timings // Purpur ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system @@ -410,10 +410,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } //this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur - this.level.getProfiler().popPush("unload"); + //this.level.getProfiler().popPush("unload"); // Purpur this.chunkMap.tick(shouldKeepTicking); //this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur this.clearCache(); } @@ -424,10 +424,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon this.lastInhabitedUpdate = i; if (!this.level.isDebug()) { - ProfilerFiller gameprofilerfiller = this.level.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur - gameprofilerfiller.push("pollingChunks"); - gameprofilerfiller.push("filteringLoadedChunks"); + //gameprofilerfiller.push("pollingChunks"); // Purpur + //gameprofilerfiller.push("filteringLoadedChunks"); // Purpur List list = Lists.newArrayListWithCapacity(this.chunkMap.size()); Iterator iterator = this.chunkMap.getChunks().iterator(); //if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur @@ -442,7 +442,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } if (this.level.tickRateManager().runsNormally()) { - gameprofilerfiller.popPush("naturalSpawnCount"); + //gameprofilerfiller.popPush("naturalSpawnCount"); // Purpur //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur int k = this.distanceManager.getNaturalSpawnChunkCount(); // Paper start - Optional per player mob spawns @@ -471,7 +471,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur this.lastSpawnState = spawnercreature_d; - gameprofilerfiller.popPush("spawnAndTick"); + //gameprofilerfiller.popPush("spawnAndTick"); // Purpur boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit Util.shuffle(list, this.level.random); @@ -511,7 +511,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur - gameprofilerfiller.popPush("customSpawners"); + //gameprofilerfiller.popPush("customSpawners"); // Purpur if (flag) { //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); @@ -519,14 +519,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } } - gameprofilerfiller.popPush("broadcast"); + //gameprofilerfiller.popPush("broadcast"); // Purpur list.forEach((chunkproviderserver_a1) -> { //this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur chunkproviderserver_a1.holder.broadcastChanges(chunkproviderserver_a1.chunk); //this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur }); - gameprofilerfiller.pop(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.pop(); // Purpur } } @@ -707,7 +707,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @Override protected void doRunTask(Runnable task) { - ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); + //ServerChunkCache.this.level.getProfiler().incrementCounter("runTask"); // Purpur super.doRunTask(task); } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index 17022327262157ad1520fb7d4fc187c8f1da00c2..665d45ba1129a72a1fb393d524bfa845b7a8189d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -669,16 +669,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } public void tick(BooleanSupplier shouldKeepTicking) { - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur this.handlingTick = true; TickRateManager tickratemanager = this.tickRateManager(); boolean flag = tickratemanager.runsNormally(); if (flag) { - gameprofilerfiller.push("world border"); + //gameprofilerfiller.push("world border"); // Purpur this.getWorldBorder().tick(); - gameprofilerfiller.popPush("weather"); + //gameprofilerfiller.popPush("weather"); // Purpur this.advanceWeatherCycle(); } @@ -710,30 +710,30 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. this.tickTime(); } - gameprofilerfiller.popPush("tickPending"); + //gameprofilerfiller.popPush("tickPending"); // Purpur //this.timings.scheduledBlocks.startTiming(); // Paper // Purpur if (!this.isDebug() && flag) { j = this.getGameTime(); - gameprofilerfiller.push("blockTicks"); + //gameprofilerfiller.push("blockTicks"); // Purpur this.blockTicks.tick(j, paperConfig().environment.maxBlockTicks, this::tickBlock); // Paper - configurable max block ticks - gameprofilerfiller.popPush("fluidTicks"); + //gameprofilerfiller.popPush("fluidTicks"); // Purpur this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } //this.timings.scheduledBlocks.stopTiming(); // Paper // Purpur - gameprofilerfiller.popPush("raid"); + //gameprofilerfiller.popPush("raid"); // Purpur if (flag) { // this.timings.raids.startTiming(); // Paper - timings // Purpur this.raids.tick(); // this.timings.raids.stopTiming(); // Paper - timings // Purpur } - gameprofilerfiller.popPush("chunkSource"); + //gameprofilerfiller.popPush("chunkSource"); // Purpur //this.timings.chunkProviderTick.startTiming(); // Paper - timings // Purpur this.getChunkSource().tick(shouldKeepTicking, true); //this.timings.chunkProviderTick.stopTiming(); // Paper - timings // Purpur - gameprofilerfiller.popPush("blockEvents"); + //gameprofilerfiller.popPush("blockEvents"); // Purpur if (flag) { // this.timings.doSounds.startTiming(); // Spigot // Purpur this.runBlockEvents(); @@ -741,7 +741,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } this.handlingTick = false; - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur boolean flag1 = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this if (flag1) { @@ -749,12 +749,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } if (flag1 || this.emptyTime++ < 300) { - gameprofilerfiller.push("entities"); + //gameprofilerfiller.push("entities"); // Purpur //this.timings.tickEntities.startTiming(); // Spigot // Purpur if (this.dragonFight != null && flag) { - gameprofilerfiller.push("dragonFight"); + //gameprofilerfiller.push("dragonFight"); // Purpur this.dragonFight.tick(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } org.spigotmc.ActivationRange.activateEntities(this); // Spigot @@ -764,9 +764,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed entity.discard(); } else if (!tickratemanager.isEntityFrozen(entity)) { - gameprofilerfiller.push("checkDespawn"); + //gameprofilerfiller.push("checkDespawn"); // Purpur entity.checkDespawn(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - rewrite chunk system Entity entity1 = entity.getVehicle(); @@ -778,22 +778,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. entity.stopRiding(); } - gameprofilerfiller.push("tick"); + //gameprofilerfiller.push("tick"); // Purpur this.guardEntityTick(this::tickNonPassenger, entity); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } } } }); //this.timings.entityTick.stopTiming(); // Spigot // Purpur //this.timings.tickEntities.stopTiming(); // Spigot // Purpur - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur this.tickBlockEntities(); } - gameprofilerfiller.push("entityManagement"); + //gameprofilerfiller.push("entityManagement"); // Purpur // Paper - rewrite chunk system - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } @Override @@ -926,9 +926,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. boolean flag = this.isRaining(); int j = chunkcoordintpair.getMinBlockX(); int k = chunkcoordintpair.getMinBlockZ(); - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur - gameprofilerfiller.push("thunder"); + //gameprofilerfiller.push("thunder"); // Purpur if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); @@ -965,7 +965,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } } - gameprofilerfiller.popPush("iceandsnow"); + //gameprofilerfiller.popPush("iceandsnow"); // Purpur if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow for (int l = 0; l < randomTickSpeed; ++l) { @@ -975,14 +975,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. } } // Paper - Option to disable ice and snow - gameprofilerfiller.popPush("tickBlocks"); + //gameprofilerfiller.popPush("tickBlocks"); // Purpur //timings.chunkTicksBlocks.startTiming(); // Paper // Purpur if (randomTickSpeed > 0) { this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking } //timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } @VisibleForTesting @@ -1328,19 +1328,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. //try { // Purpur // Paper end - timings entity.setOldPosAndRot(); - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur ++entity.tickCount; - this.getProfiler().push(() -> { + /*this.getProfiler().push(() -> { // Purpur return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); - }); - gameprofilerfiller.incrementCounter("tickNonPassenger"); + });*/ // Purpur + //gameprofilerfiller.incrementCounter("tickNonPassenger"); // Purpur if (isActive) { // Paper - EAR 2 TimingHistory.activatedEntityTicks++; entity.tick(); entity.postTick(); // CraftBukkit } else { entity.inactiveTick(); } // Paper - EAR 2 - this.getProfiler().pop(); + //this.getProfiler().pop(); // Purpur //} finally { timer.stopTiming(); } // Paper - timings // Purpur Iterator iterator = entity.getPassengers().iterator(); @@ -1369,12 +1369,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. // Paper end passenger.setOldPosAndRot(); ++passenger.tickCount; - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur - gameprofilerfiller.push(() -> { + /*gameprofilerfiller.push(() -> { // Purpur return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString(); - }); - gameprofilerfiller.incrementCounter("tickPassenger"); + });*/ // Purpur + //gameprofilerfiller.incrementCounter("tickPassenger"); // Purpur // Paper start - EAR 2 if (isActive) { passenger.rideTick(); @@ -1386,7 +1386,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. vehicle.positionRider(passenger); } // Paper end - EAR 2 - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur Iterator iterator = passenger.getPassengers().iterator(); while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index 2021e6db4864b5e20a6483605e6372de2efaba4d..7c7124f6b5911d4fa63af03f018323b6032a06a4 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1401,7 +1401,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple this.unsetRemoved(); */ // CraftBukkit end - worldserver1.getProfiler().push("moving"); + //worldserver1.getProfiler().push("moving"); // Purpur if (worldserver != null && resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit - empty to fall through to null to event this.enteredNetherPosition = this.position(); } @@ -1417,8 +1417,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple worldserver = ((CraftWorld) exit.getWorld()).getHandle(); // CraftBukkit end - worldserver1.getProfiler().pop(); - worldserver1.getProfiler().push("placing"); + //worldserver1.getProfiler().pop(); // Purpur + //worldserver1.getProfiler().push("placing"); // Purpur // CraftBukkit start this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds LevelData worlddata = worldserver.getLevelData(); @@ -1436,7 +1436,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple this.connection.teleport(exit); // CraftBukkit - use internal teleport without event this.connection.resetPosition(); worldserver.addDuringTeleport(this); - worldserver1.getProfiler().pop(); + //worldserver1.getProfiler().pop(); // Purpur this.triggerDimensionChangeTriggers(worldserver1); this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); playerlist.sendLevelInfo(this, worldserver); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index e7075e0c59fe99229142ecb518fadc5b481886fb..fac2fb82c381d245f77b7288c34920660ac2c3af 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -266,7 +266,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } protected void keepConnectionAlive() { - this.server.getProfiler().push("keepAlive"); + //this.server.getProfiler().push("keepAlive"); // Purpur // Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings // This should effectively place the keepalive handling back to "as it was" before 1.12.2 long currentTime = Util.getMillis(); @@ -299,7 +299,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } // Paper end - give clients a longer time to respond to pings as per pre 1.12.2 timings - this.server.getProfiler().pop(); + //this.server.getProfiler().pop(); // Purpur } private boolean checkIfClosed(long time) { diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java index f14113eef226e906c0d21641e74a27471254909d..0c25f3ed0a8a538edc7cadd3476100c9b3631f7a 100644 --- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java @@ -16,11 +16,11 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener Executor applyExecutor ) { return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> { - applyProfiler.startTick(); - applyProfiler.push("listener"); + //applyProfiler.startTick(); // Purpur + //applyProfiler.push("listener"); // Purpur this.onResourceManagerReload(manager); - applyProfiler.pop(); - applyProfiler.endTick(); + //applyProfiler.pop(); // Purpur + //applyProfiler.endTick(); // Purpur }, applyExecutor); } diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java index bce2dac613d29083dd5fbb68739304cc5a6d4d27..600a7036b503f60cc9c95f189f73c2dbf020e2e1 100644 --- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java +++ b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java @@ -55,7 +55,7 @@ public class ActiveProfiler implements ProfileCollector { this.started = true; this.path = ""; this.paths.clear(); - this.push("root"); + //this.push("root"); // Purpur } } @@ -64,7 +64,7 @@ public class ActiveProfiler implements ProfileCollector { if (!this.started) { LOGGER.error("Profiler tick already ended - missing startTick()?"); } else { - this.pop(); + //this.pop(); // Purpur this.started = false; if (!this.path.isEmpty()) { LOGGER.error( @@ -93,7 +93,7 @@ public class ActiveProfiler implements ProfileCollector { @Override public void push(Supplier 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 9c294bb8ae3cb9ec18ed633821c64c38bad50e95..42ff02305e9eedb0a7c4a3b25106eb98776696a4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -880,7 +880,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()) { @@ -945,7 +945,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess Leashable.tickLeash((Entity & Leashable) this); // CraftBukkit - decompile error } - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } public void setSharedFlagOnFire(boolean onFire) { @@ -1158,7 +1158,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; @@ -1167,7 +1167,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 @@ -1188,8 +1188,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); @@ -1208,7 +1208,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(); @@ -1311,7 +1311,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 @@ -3303,7 +3303,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.processPortalCooldown(); if (this.portalProcess != null) { if (this.portalProcess.processPortalTeleportation(worldserver, this, this.canUsePortal(false))) { - worldserver.getProfiler().push("portal"); + //worldserver.getProfiler().push("portal"); // Purpur this.setPortalCooldown(); DimensionTransition dimensiontransition = this.portalProcess.getPortalDestination(worldserver, this); @@ -3315,7 +3315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } - worldserver.getProfiler().pop(); + //worldserver.getProfiler().pop(); // Purpur } else if (this.portalProcess.hasExpired()) { this.portalProcess = null; } @@ -3816,7 +3816,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } - worldserver.getProfiler().push("changeDimension"); + //worldserver.getProfiler().push("changeDimension"); // Purpur Entity entity2 = worldserver1.dimension() == worldserver.dimension() ? this : this.getType().create(worldserver1); if (entity2 != null) { @@ -3852,7 +3852,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess teleportTarget.postDimensionTransition().onTransition(entity2); } - worldserver.getProfiler().pop(); + //worldserver.getProfiler().pop(); // Purpur return entity2; } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index 9582498c5cbcc859b942384e8e0e492cb2cdea03..94a1874576ed07bacdd399785666f69d4b4086c8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -445,7 +445,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } super.baseTick(); - this.level().getProfiler().push("livingEntityBaseTick"); + //this.level().getProfiler().push("livingEntityBaseTick"); // Purpur if (this.fireImmune() || this.level().isClientSide) { this.clearFire(); } @@ -551,7 +551,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO = this.yHeadRot; this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } @Override @@ -3272,10 +3272,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; @@ -3287,7 +3287,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; @@ -3527,19 +3527,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; @@ -3566,8 +3566,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(); @@ -3592,8 +3592,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(); @@ -3610,15 +3610,15 @@ public abstract class LivingEntity extends Entity implements Attackable { this.hurt(this.damageSources().freeze(), 1.0F); } - this.level().getProfiler().pop(); - this.level().getProfiler().push("push"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("push"); // Purpur if (this.autoSpinAttackTicks > 0) { --this.autoSpinAttackTicks; this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } this.pushEntities(); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur // Paper start - Add EntityMoveEvent // Purpur start if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java index 6dfb13eef96ff43d368cd8163ae5883571cec604..a07cadcbd73f7058a5cf8535fb317ac0e493eeeb 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -370,13 +370,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override public void baseTick() { super.baseTick(); - this.level().getProfiler().push("mobBaseTick"); + //this.level().getProfiler().push("mobBaseTick"); // Purpur if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) { this.resetAmbientSoundTime(); this.playAmbientSound(); } - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur incrementTicksSinceLastInteraction(); // Purpur } @@ -706,7 +706,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override public void aiStep() { super.aiStep(); - this.level().getProfiler().push("looting"); + //this.level().getProfiler().push("looting"); // Purpur if (!this.level().isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { Vec3i baseblockposition = this.getPickupReach(); List list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ())); @@ -726,7 +726,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab } } - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur } protected Vec3i getPickupReach() { @@ -946,44 +946,44 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab return; } // Paper end - Allow nerfed mobs to jump and float - ProfilerFiller gameprofilerfiller = this.level().getProfiler(); + //ProfilerFiller gameprofilerfiller = this.level().getProfiler(); // Purpur - gameprofilerfiller.push("sensing"); + //gameprofilerfiller.push("sensing"); // Purpur this.sensing.tick(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur int i = this.tickCount + this.getId(); if (i % 2 != 0 && this.tickCount > 1) { - gameprofilerfiller.push("targetSelector"); + //gameprofilerfiller.push("targetSelector"); // Purpur this.targetSelector.tickRunningGoals(false); - gameprofilerfiller.pop(); - gameprofilerfiller.push("goalSelector"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("goalSelector"); // Purpur this.goalSelector.tickRunningGoals(false); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } else { - gameprofilerfiller.push("targetSelector"); + //gameprofilerfiller.push("targetSelector"); // Purpur this.targetSelector.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("goalSelector"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("goalSelector"); // Purpur this.goalSelector.tick(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } - gameprofilerfiller.push("navigation"); + //gameprofilerfiller.push("navigation"); // Purpur this.navigation.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("mob tick"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("mob tick"); // Purpur this.customServerAiStep(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("controls"); - gameprofilerfiller.push("move"); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.push("controls"); // Purpur + //gameprofilerfiller.push("move"); // Purpur this.moveControl.tick(); - gameprofilerfiller.popPush("look"); + //gameprofilerfiller.popPush("look"); // Purpur this.lookControl.tick(); - gameprofilerfiller.popPush("jump"); + //gameprofilerfiller.popPush("jump"); // Purpur this.jumpControl.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur + //gameprofilerfiller.pop(); // Purpur this.sendDebugPackets(); } diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java index 74d4f653d5c7f1923c59019effd78337402f7025..b4e4670536f6dcea109c029d75d9710cb386f1d0 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java @@ -87,8 +87,8 @@ public class GoalSelector { } public void tick() { - ProfilerFiller profilerFiller = this.profiler.get(); - profilerFiller.push("goalCleanup"); + //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur + //profilerFiller.push("goalCleanup"); // Purpur for (WrappedGoal wrappedGoal : this.availableGoals) { if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams @@ -97,8 +97,8 @@ public class GoalSelector { } this.lockedFlags.entrySet().removeIf(entry -> !entry.getValue().isRunning()); - profilerFiller.pop(); - profilerFiller.push("goalUpdate"); + //profilerFiller.pop(); // Purpur + //profilerFiller.push("goalUpdate"); // Purpur for (WrappedGoal wrappedGoal2 : this.availableGoals) { // Paper start @@ -118,13 +118,13 @@ public class GoalSelector { } } - profilerFiller.pop(); + //profilerFiller.pop(); // Purpur this.tickRunningGoals(true); } public void tickRunningGoals(boolean tickAll) { - ProfilerFiller profilerFiller = this.profiler.get(); - profilerFiller.push("goalTick"); + //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur + //profilerFiller.push("goalTick"); // Purpur for (WrappedGoal wrappedGoal : this.availableGoals) { if (wrappedGoal.isRunning() && (tickAll || wrappedGoal.requiresUpdateEveryTick())) { @@ -132,7 +132,7 @@ public class GoalSelector { } } - profilerFiller.pop(); + //profilerFiller.pop(); // Purpur } public Set 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 902882ca639eee6efe102ea70e182fb17df801c2..0f9196cc26e5c670a7f3454326b762f0303f633c 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 @@ -260,13 +260,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 75c05990b9ee6fd429c24415be3b98e258638e89..5b024bc6166a9034eeba729bf3a53236446a03de 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 @@ -163,12 +163,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 091fbd162a63ec523197a953e65c00a54dae5ef9..e3178e2562a45f09c6567bb63112aa84fc59ea1d 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 @@ -309,13 +309,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 c567b946e013852acfae7f5a417a292706e218f4..e88d6d691bb176e33afeb294d735dfb2cbac12ff 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 @@ -154,14 +154,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 057096c5252e86d828a69080bdc70538e516ce99..0656e03bdd71f5d81853e817e136c8f11667c76e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java @@ -122,13 +122,13 @@ public class Tadpole extends AbstractFish { @Override protected void customServerAiStep() { - this.level().getProfiler().push("tadpoleBrain"); + //this.level().getProfiler().push("tadpoleBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel) this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("tadpoleActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("tadpoleActivityUpdate"); // Purpur TadpoleAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java index fab01a3e779e39962ef04305540e2fe3043072a2..4feddea8703d25a671fe11617f99e1fa9c1deaa2 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java @@ -224,13 +224,13 @@ public class Goat extends Animal { @Override protected void customServerAiStep() { - this.level().getProfiler().push("goatBrain"); + //this.level().getProfiler().push("goatBrain"); // Purpur //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Purpur - TODO: Pufferfish this.getBrain().tick((ServerLevel) this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("goatActivityUpdate"); + //this.level().getProfiler().pop(); // Purpur + //this.level().getProfiler().push("goatActivityUpdate"); // Purpur GoatAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java index d82b036b5a759574fe83027ec1000d7eb0455a28..b6f5281705ce4c7a755e3818cf6c4a2235a024f9 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 @@ -505,11 +505,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 6817f88c422480f201552300ae78053321e41bb8..0cf110be4ec7823996e89c1d1e014e091c1d3d8a 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 ee9098f311b5db7251fcaf3ca199ae51ec1f2a2a..0d8e49e4f3c52244f8f84d6e4beeaa60aa6acdd9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java +++ b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java @@ -228,11 +228,11 @@ public class Breeze extends Monster { @Override protected void customServerAiStep() { - this.level().getProfiler().push("breezeBrain"); + //this.level().getProfiler().push("breezeBrain"); // Purpur this.getBrain().tick((ServerLevel)this.level(), this); - this.level().getProfiler().popPush("breezeActivityUpdate"); + //this.level().getProfiler().popPush("breezeActivityUpdate"); // Purpur BreezeAi.updateActivity(this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); } diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java index 705385f5136ab6e063207004a045ed6a860b9903..ef263efa3ec00c36f938158356c34fb87c52c7bc 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 @@ -193,10 +193,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 02294488328707a7a67442669eeb48212c1452ab..6348d7a63b6fcfecc899fd7d1e0b941214acce01 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 5537f4e2bdce05ef5863955b9403eda7b04ec0d5..2f43bef3acd9db78ecc869f5ff0f4d0f5e121d28 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 @@ -139,10 +139,10 @@ public class PiglinBrute extends AbstractPiglin { @Override protected void customServerAiStep() { - this.level().getProfiler().push("piglinBruteBrain"); + //this.level().getProfiler().push("piglinBruteBrain"); // Purpur if (getRider() == null || this.isControllable()) // Purpur - only use brain if no rider this.getBrain().tick((ServerLevel)this.level(), this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur PiglinBruteAi.updateActivity(this); PiglinBruteAi.maybePlayActivitySound(this); super.customServerAiStep(); diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java index ba560ab0340c06614547dcddbdcbd1bbda44bb79..6ee394c1616db9b0203b3e52e39234d064438654 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java @@ -300,9 +300,10 @@ public class Warden extends Monster implements VibrationSystem { protected void customServerAiStep() { ServerLevel worldserver = (ServerLevel) this.level(); - worldserver.getProfiler().push("wardenBrain"); + //worldserver.getProfiler().push("wardenBrain"); // Purpur + //if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - TODO: Move to Ridables patch this.getBrain().tick(worldserver, this); - this.level().getProfiler().pop(); + //this.level().getProfiler().pop(); // Purpur super.customServerAiStep(); if ((this.tickCount + this.getId()) % 120 == 0) { Warden.applyDarknessAround(worldserver, this.position(), this, 20); diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java index d4f64414a0351999a04308a3d26d15c9ddf266c7..88972d9f07eb9088c139d9dbc974b2e61943f292 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -342,7 +342,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 @@ -358,7 +358,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 a248d859cbce48f4a34c4771a7acffc17d7edc84..4ce32603dcd691e018a3e1962311d2ac707439aa 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -646,7 +646,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); @@ -724,7 +724,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 342c8a114b9063b2fa959aae22cdd2c0d412c50d..ba2254ef7688177eff2ed8115726b7b551620560 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -269,7 +269,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public final List getEntitiesOfClass(final Class entityClass, final AABB boundingBox, final Predicate predicate) { - this.getProfiler().incrementCounter("getEntities"); + //this.getProfiler().incrementCounter("getEntities"); // Purpur final List ret = new java.util.ArrayList<>(); ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate); @@ -279,7 +279,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public final List moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate predicate) { - this.getProfiler().incrementCounter("getEntities"); + //this.getProfiler().incrementCounter("getEntities"); // Purpur final List ret = new java.util.ArrayList<>(); ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate); @@ -1412,9 +1412,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl } protected void tickBlockEntities() { - ProfilerFiller gameprofilerfiller = this.getProfiler(); + //ProfilerFiller gameprofilerfiller = this.getProfiler(); // Purpur - gameprofilerfiller.push("blockEntities"); + //gameprofilerfiller.push("blockEntities"); // Purpur //this.timings.tileEntityPending.startTiming(); // Spigot // Purpur this.tickingBlockEntities = true; if (!this.pendingBlockEntityTickers.isEmpty()) { @@ -1457,7 +1457,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl //this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur this.tickingBlockEntities = false; co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur this.spigotConfig.currentPrimedTnt = 0; // Spigot } @@ -1669,7 +1669,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { - this.getProfiler().incrementCounter("getEntities"); + //this.getProfiler().incrementCounter("getEntities"); // Purpur // Paper start - rewrite chunk system final List ret = new java.util.ArrayList<>(); @@ -1695,7 +1695,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public void getEntities(final EntityTypeTest entityTypeTest, final AABB boundingBox, final Predicate predicate, final List into, final int maxCount) { - this.getProfiler().incrementCounter("getEntities"); + //this.getProfiler().incrementCounter("getEntities"); // Purpur if (entityTypeTest instanceof net.minecraft.world.entity.EntityType byType) { if (maxCount != Integer.MAX_VALUE) { @@ -1990,6 +1990,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl } public ProfilerFiller getProfiler() { + //if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur // Purpur - TODO: Pufferfish return (ProfilerFiller) this.profiler.get(); } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java index 2812505185df691e8f08932aa0bba162a7d9db86..35e94c06361795d032f995e8282f8b35c075dae7 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -127,7 +127,7 @@ public final class NaturalSpawner { } public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, boolean spawnAnimals, boolean spawnMonsters, boolean rareSpawn) { - world.getProfiler().push("spawner"); + //world.getProfiler().push("spawner"); // Purpur //world.timings.mobSpawn.startTiming(); // Spigot // Purpur MobCategory[] aenumcreaturetype = NaturalSpawner.SPAWNING_CATEGORIES; int i = aenumcreaturetype.length; @@ -182,7 +182,7 @@ public final class NaturalSpawner { } //world.timings.mobSpawn.stopTiming(); // Spigot // Purpur - world.getProfiler().pop(); + //world.getProfiler().pop(); // Purpur } // Paper start - Add mobcaps commands diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java index 8d48dbd43f29c6ccf268ae2f52f2b75a559c108d..7411e3d132dddde4599c182384f317679de1f2bf 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -372,11 +372,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) { ProfilerFiller gameprofilerfiller = this.level.getProfiler(); - gameprofilerfiller.push("updateSkyLightSources"); + //gameprofilerfiller.push("updateSkyLightSources"); // Purpur // Paper - rewrite chunk system - gameprofilerfiller.popPush("queueCheckLight"); + //gameprofilerfiller.popPush("queueCheckLight"); // Purpur this.level.getChunkSource().getLightEngine().checkBlock(blockposition); - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Purpur } boolean flag3 = iblockdata1.hasBlockEntity(); @@ -1007,9 +1007,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p if (LevelChunk.this.isTicking(blockposition)) { try { - ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); + //ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); - gameprofilerfiller.push(this::getType); + //gameprofilerfiller.push(this::getType); //this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); @@ -1026,7 +1026,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p // Paper end - Remove the Block Entity if it's invalid } - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); } catch (Throwable throwable) { if (throwable instanceof ThreadDeath) throw throwable; // Paper // Paper start - Prevent block entity and entity crashes diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java index 18bbb3f8f99849333ff4bc020c8ce758a69312a5..404080976208c30e9e95e5bee47c2a749e709a45 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java @@ -53,8 +53,8 @@ public class PathFinder { @Nullable // Paper start - Perf: remove streams and optimize collection private Path findPath(ProfilerFiller profiler, Node startNode, List> 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(); }