diff --git a/.gitignore b/.gitignore index a02e753..25d55b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -# Created by https://www.toptal.com/developers/gitignore/api/java,kotlin,jetbrains+all,gradle,git,visualstudiocode,eclipse,netbeans,macos,windows,linux,vim,maven -# Edit at https://www.toptal.com/developers/gitignore?templates=java,kotlin,jetbrains+all,gradle,git,visualstudiocode,eclipse,netbeans,macos,windows,linux,vim,maven +# Generated from https://gitignore.io/ ### Paperweight ### run/ @@ -11,78 +10,9 @@ plazma-api/build.gradle.kts plazma-server/build.gradle.kts plazma-server/src/minecraft/ -### Eclipse ### -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# CDT- autotools -.autotools - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - -# Annotation Processing -.apt_generated/ -.apt_generated_test/ - -# Scala IDE specific (Scala & Java development for Eclipse) -.cache-main -.scala_dependencies -.worksheet - -# Uncomment this line if you wish to ignore the project description file. -# Typically, this file would be tracked if it contains build/dependency configurations: -#.project - -### Eclipse Patch ### -# Spring Boot Tooling -.sts4-cache/ - ### Git ### -# Created by git for backups. To disable backups in Git: -# $ git config --global mergetool.keepBackup false -*.orig - # Created by git when using merge tools for conflicts +*.orig *.BACKUP.* *.BASE.* *.LOCAL.* @@ -93,131 +23,120 @@ local.properties *_REMOTE_*.txt ### Java ### -# Compiled class file *.class - -# Log file *.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # *.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* replay_pid* -### JetBrains+all ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Kotlin DSL +.kotlin/ + +### Gradle ### +.gradle/ +build/ + +# Avoid ignore Gradle wrappper properties +!gradle-wrapper.jar +!gradle-wrapper.properties + +# Cache of project +.gradletasknamecache + +# Java heap dump +*.hprof + +### Eclipse ### +*.tmp +*.bak +*.swp +*~.nib +local.properties +bin/ +tmp/ +.project/ +.metadata/ +.settings/ +.loadpath/ +.recommenders/ + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# Java annotation processor (APT) +.factorypath + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +### JetBrains ### # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### JetBrains+all Patch ### # Ignore everything but code style settings and run configurations -# that are supposed to be shared within teams. - -.idea/* +.idea/ !.idea/codeStyles !.idea/runConfigurations -### Kotlin ### -# Compiled class file +# IntelliJ +out/ -# Log file +# Fleet +.fleet/ -# BlueJ files +### NetBeans ### +**/nbproject/private/ +**/nbproject/Makefile-*.mk +**/nbproject/Package-*.bash +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ -# Mobile Tools for Java (J2ME) +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] -# Package Files # +# Session +Session.vim +Sessionx.vim -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +# Temporary +.netrwhist + +# Auto-generated tag files +tags + +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Ignore all local history of files +.history +.ionide ### Linux ### *~ @@ -243,7 +162,6 @@ fabric.properties # Icon must end with two \r Icon - # Thumbnails ._* @@ -263,78 +181,9 @@ Network Trash Folder Temporary Items .apdisk -### macOS Patch ### # iCloud generated files *.icloud -### Maven ### -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar - -# Eclipse m2e generated files -# Eclipse Core -.project -# JDT-specific (Eclipse Java Development Tools) -.classpath - -### NetBeans ### -**/nbproject/private/ -**/nbproject/Makefile-*.mk -**/nbproject/Package-*.bash -build/ -nbbuild/ -dist/ -nbdist/ -.nb-gradle/ - -### Vim ### -# Swap -[._]*.s[a-v][a-z] -!*.svg # comment out if you don't need vector files -[._]*.sw[a-p] -[._]s[a-rt-v][a-z] -[._]ss[a-gi-z] -[._]sw[a-p] - -# Session -Session.vim -Sessionx.vim - -# Temporary -.netrwhist -# Auto-generated tag files -tags -# Persistent undo -[._]*.un~ - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history -.ionide - ### Windows ### # Windows thumbnail cache files Thumbs.db @@ -360,30 +209,3 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk - -### Gradle ### -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Avoid ignore Gradle wrappper properties -!gradle-wrapper.properties - -# Cache of project -.gradletasknamecache - -# Eclipse Gradle plugin generated files -# Eclipse Core -# JDT-specific (Eclipse Java Development Tools) - -### Gradle Patch ### -# Java heap dump -*.hprof - -# End of https://www.toptal.com/developers/gitignore/api/java,kotlin,jetbrains+all,gradle,git,visualstudiocode,eclipse,netbeans,macos,windows,linux,vim,maven \ No newline at end of file diff --git a/plazma-server/minecraft-patches/features/0002-Remove-unused-client-side-features.patch b/plazma-server/minecraft-patches/features/0002-Remove-unused-client-side-features.patch index 5f6b7b2..9a86b22 100644 --- a/plazma-server/minecraft-patches/features/0002-Remove-unused-client-side-features.patch +++ b/plazma-server/minecraft-patches/features/0002-Remove-unused-client-side-features.patch @@ -353,8 +353,53 @@ index 626e9feb6a6e7a2cbc7c63e30ba4fb6b923e85c7..22050e61506e1f3c2f4998ac1e3de4a3 return item; } +diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java +index 97a70f372756e283810921ad39f4d0a7ba840afc..eb2316e5915e973675c75b4358d20f5ef4124503 100644 +--- a/net/minecraft/server/Main.java ++++ b/net/minecraft/server/Main.java +@@ -41,7 +41,7 @@ import net.minecraft.server.packs.repository.PackRepository; + import net.minecraft.server.packs.repository.ServerPacksSource; + import net.minecraft.util.Mth; + import net.minecraft.util.datafix.DataFixers; +-import net.minecraft.util.profiling.jfr.Environment; ++//import net.minecraft.util.profiling.jfr.Environment; // Plazma - Remove isClientSide on DedicatedServer + import net.minecraft.util.profiling.jfr.JvmProfiler; + import net.minecraft.util.worldupdate.WorldUpgrader; + import net.minecraft.world.flag.FeatureFlags; +@@ -102,7 +102,7 @@ public class Main { + + CrashReport.preload(); + if (optionSet.has("jfrProfile")) { // CraftBukkit +- JvmProfiler.INSTANCE.start(Environment.SERVER); ++ JvmProfiler.INSTANCE.start(/*Environment.SERVER*/); // Plazma - Remove isClientSide on DedicatedServer + } + + // Purpur start - Add toggle for enchant level clamping - load config files early +diff --git a/net/minecraft/server/commands/JfrCommand.java b/net/minecraft/server/commands/JfrCommand.java +index 5b32584379d946dc424c9d716fd0d9be5ddfdd64..cda646e0487087bd78a9bae64a2baa297e8f6094 100644 +--- a/net/minecraft/server/commands/JfrCommand.java ++++ b/net/minecraft/server/commands/JfrCommand.java +@@ -13,7 +13,7 @@ import net.minecraft.commands.Commands; + import net.minecraft.network.chat.ClickEvent; + import net.minecraft.network.chat.Component; + import net.minecraft.network.chat.HoverEvent; +-import net.minecraft.util.profiling.jfr.Environment; ++//import net.minecraft.util.profiling.jfr.Environment; // Plazma - Remove isClientSide on DedicatedServer + import net.minecraft.util.profiling.jfr.JvmProfiler; + + public class JfrCommand { +@@ -35,8 +35,7 @@ public class JfrCommand { + } + + private static int startJfr(CommandSourceStack source) throws CommandSyntaxException { +- Environment environment = Environment.from(source.getServer()); +- if (!JvmProfiler.INSTANCE.start(environment)) { ++ if (!JvmProfiler.INSTANCE.start()) { // Plazma - Remove isClientSide on DedicatedServer + throw START_FAILED.create(); + } else { + source.sendSuccess(() -> Component.translatable("commands.jfr.started"), false); diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index bfc88babf6f3c1884713723d6094303550097363..7c2ce601dc60b100b47d050f5e3b525263ccd91e 100644 +index 1b983393fcb170829f981cf0ab1620d92c80ab1d..be4e3533590cd36bbed6f17f3be5941e70f40b8a 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -597,7 +597,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -383,6 +428,101 @@ index 3ba4b970c3781ab89a60687ec41ffb1e6297c9f9..c3f9c65052713c177169a6367d2b5e30 @Deprecated @Override +diff --git a/net/minecraft/util/profiling/jfr/Environment.java b/net/minecraft/util/profiling/jfr/Environment.java +deleted file mode 100644 +index 2b27173c700dbd9f418d470ca5ce81eadf0bb8ce..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/jfr/Environment.java ++++ /dev/null +@@ -1,22 +0,0 @@ +-package net.minecraft.util.profiling.jfr; +- +-import net.minecraft.server.MinecraftServer; +- +-public enum Environment { +- CLIENT("client"), +- SERVER("server"); +- +- private final String description; +- +- private Environment(final String description) { +- this.description = description; +- } +- +- public static Environment from(MinecraftServer server) { +- return server.isDedicatedServer() ? SERVER : CLIENT; +- } +- +- public String getDescription() { +- return this.description; +- } +-} +diff --git a/net/minecraft/util/profiling/jfr/JfrProfiler.java b/net/minecraft/util/profiling/jfr/JfrProfiler.java +index 5dfddd59f8f9ce4c5991e8e3ff14d6fdbdbbf6cb..29468480d9a0edf661bbfecfea7b8c3265b3f5ab 100644 +--- a/net/minecraft/util/profiling/jfr/JfrProfiler.java ++++ b/net/minecraft/util/profiling/jfr/JfrProfiler.java +@@ -97,7 +97,7 @@ public class JfrProfiler implements JvmProfiler { + } + + @Override +- public boolean start(Environment environment) { ++ public boolean start(/*Environment environment*/) { // Plazma - Remove isClientSide on DedicatedServer + URL resource = JfrProfiler.class.getResource("/flightrecorder-config.jfc"); + if (resource == null) { + LOGGER.warn("Could not find default flight recorder config at {}", "/flightrecorder-config.jfc"); +@@ -106,7 +106,7 @@ public class JfrProfiler implements JvmProfiler { + try { + boolean var4; + try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(resource.openStream()))) { +- var4 = this.start(bufferedReader, environment); ++ var4 = this.start(bufferedReader/*, environment*/); // Plazma - Remove isClientSide on DedicatedServer + } + + return var4; +@@ -139,7 +139,7 @@ public class JfrProfiler implements JvmProfiler { + return FlightRecorder.isAvailable(); + } + +- private boolean start(Reader reader, Environment environment) { ++ private boolean start(final Reader reader/*, Environment environment*/) { // Plazma - Remove isClientSide on DedicatedServer + if (this.isRunning()) { + LOGGER.warn("Profiling already in progress"); + return false; +@@ -154,11 +154,11 @@ public class JfrProfiler implements JvmProfiler { + recording.setDumpOnExit(true); + recording.setToDisk(true); + recording.setName( +- String.format(Locale.ROOT, "%s-%s-%s", environment.getDescription(), SharedConstants.getCurrentVersion().getName(), string) ++ String.format(Locale.ROOT, "server-%s-%s", SharedConstants.getCurrentVersion().getName(), string) // Plazma - Remove isClientSide on DedicatedServer + ); + } + ); +- Path path = Paths.get(String.format(Locale.ROOT, "debug/%s-%s.jfr", environment.getDescription(), string)); ++ Path path = Paths.get(String.format(Locale.ROOT, "debug/server-%s.jfr", string)); // Plazma - Remove isClientSide on DedicatedServer + FileUtil.createDirectoriesSafe(path.getParent()); + this.recording.setDestination(path); + this.recording.start(); +diff --git a/net/minecraft/util/profiling/jfr/JvmProfiler.java b/net/minecraft/util/profiling/jfr/JvmProfiler.java +index 607e176893bbbf2d98f35c413d5d2de82fbe529d..85ca32441df08ac6f404cce6e549e4e1c46b065a 100644 +--- a/net/minecraft/util/profiling/jfr/JvmProfiler.java ++++ b/net/minecraft/util/profiling/jfr/JvmProfiler.java +@@ -21,7 +21,7 @@ public interface JvmProfiler { + ? JfrProfiler.getInstance() + : new JvmProfiler.NoOpProfiler()); + +- boolean start(Environment environment); ++ boolean start(/*Environment environment*/); // Plazma - Remove isClientSide on DedicatedServer + + Path stop(); + +@@ -53,7 +53,7 @@ public interface JvmProfiler { + static final ProfiledDuration noOpCommit = success -> {}; + + @Override +- public boolean start(Environment environment) { ++ public boolean start(/*Environment environment*/) { // Plazma - Remove isClientSide on DedicatedServer + LOGGER.warn("Attempted to start Flight Recorder, but it's not supported on this JVM"); + return false; + } diff --git a/net/minecraft/world/entity/AgeableMob.java b/net/minecraft/world/entity/AgeableMob.java index 179f4e4b9b1eb57f78bbb2f9fa34b11ea79b7a88..1c8c2e246b48c2e76e5805eb7ba4132e8699191c 100644 --- a/net/minecraft/world/entity/AgeableMob.java @@ -6377,7 +6517,7 @@ index 8de482367f3d9d91048b7c85cbaefcda9f9fbcdc..05f1d1590d87c3548c724970eb82afda public void setNextSpawnData(@Nullable Level level, BlockPos pos, SpawnData nextSpawnData) { diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index d350909d37966ecb9e55bf7706b675a18c76e49d..a8375d783280a1b6635ca2bd1768553cdc3d023d 100644 +index d350909d37966ecb9e55bf7706b675a18c76e49d..df28a59ef9f233916d5d32aea7aa1b6bedb36a58 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -126,7 +126,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @@ -6445,37 +6585,23 @@ index d350909d37966ecb9e55bf7706b675a18c76e49d..a8375d783280a1b6635ca2bd1768553c this.updateNeighbourForOutputSignal(blockPos, newBlock.getBlock()); } } -@@ -1445,15 +1447,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1445,6 +1447,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl this.playSeededSound(player, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(event), category, volume, pitch, this.threadSafeRandom.nextLong()); } -- public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) { -+ // /* // Plazma - Remove isClientSide on DedicatedServer -+ @Deprecated(forRemoval = true) -+ @org.jetbrains.annotations.ApiStatus.Experimental -+ @io.papermc.paper.annotation.DoNotUse -+ public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) throws IOException { ++ /* // Plazma - Remove isClientSide on DedicatedServer + public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) { this.playLocalSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, sound, category, volume, pitch, distanceDelay); } +@@ -1454,6 +1457,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl -- public void playLocalSound(Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch) { -+ @Deprecated(forRemoval = true) -+ @org.jetbrains.annotations.ApiStatus.Experimental -+ @io.papermc.paper.annotation.DoNotUse -+ public void playLocalSound(Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch) throws IOException { + public void playLocalSound(double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) { } - -- public void playLocalSound(double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) { -+ @Deprecated(forRemoval = true) -+ @org.jetbrains.annotations.ApiStatus.Experimental -+ @io.papermc.paper.annotation.DoNotUse -+ public void playLocalSound(double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) throws IOException { - } -+ // */ // Plazma - Remove isClientSide on DedicatedServer ++ */ // Plazma - Remove isClientSide on DedicatedServer @Override public void addParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) { -@@ -1680,7 +1693,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1680,7 +1684,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl if (this.isOutsideBuildHeight(pos)) { return null; } else { @@ -6484,7 +6610,7 @@ index d350909d37966ecb9e55bf7706b675a18c76e49d..a8375d783280a1b6635ca2bd1768553c ? null : this.getChunkAt(pos).getBlockEntity(pos, LevelChunk.EntityCreationType.IMMEDIATE); } -@@ -2037,9 +2050,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -2037,9 +2041,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl return this.worldBorder; } diff --git a/plazma-server/minecraft-patches/features/0003-Remove-Mojang-Profiler.patch b/plazma-server/minecraft-patches/features/0003-Remove-Mojang-Profiler.patch new file mode 100644 index 0000000..95adc1b --- /dev/null +++ b/plazma-server/minecraft-patches/features/0003-Remove-Mojang-Profiler.patch @@ -0,0 +1,5079 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Sun, 23 Feb 2025 18:11:08 +0900 +Subject: [PATCH] Remove Mojang Profiler + + +diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java +index d7922847bd398d809e8b8a31bf136c804305a32b..b705539a0e7d5f09c1a922f7ff97fb5d8a2ba185 100644 +--- a/net/minecraft/commands/Commands.java ++++ b/net/minecraft/commands/Commands.java +@@ -132,7 +132,7 @@ import net.minecraft.server.commands.WorldBorderCommand; + import net.minecraft.server.commands.data.DataCommands; + import net.minecraft.server.level.ServerPlayer; + import net.minecraft.tags.TagKey; +-import net.minecraft.util.profiling.Profiler; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler + import net.minecraft.util.profiling.jfr.JvmProfiler; + import net.minecraft.world.flag.FeatureFlagSet; + import net.minecraft.world.flag.FeatureFlags; +@@ -357,7 +357,7 @@ public class Commands { + public void performCommand(ParseResults parseResults, String command, String label, boolean throwCommandError) { + // Paper end + CommandSourceStack commandSourceStack = parseResults.getContext().getSource(); +- Profiler.get().push(() -> "/" + command); ++ //Profiler.get().push(() -> "/" + command); // Plazma - Remove Mojang Profiler + ContextChain contextChain = this.finishParsing(parseResults, command, commandSourceStack, label); // CraftBukkit // Paper - Add UnknownCommandEvent + + try { +@@ -394,9 +394,10 @@ public class Commands { + commandSourceStack.sendFailure(Component.literal(Util.describeError(var12))); + LOGGER.error("'/{}' threw an exception", command, var12); + } +- } finally { ++ } /*finally { // Plazma - Remove Mojang Profiler + Profiler.get().pop(); + } ++ */ // Plazma - Remove Mojang Profiler + } + + @Nullable +@@ -452,7 +453,7 @@ public class Commands { + int max = Math.max(1, server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_CHAIN_LENGTH)); + int _int = server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT); + +- try (ExecutionContext executionContext1 = new ExecutionContext<>(max, _int, Profiler.get())) { ++ try (ExecutionContext executionContext1 = new ExecutionContext<>(max, _int/*, Profiler.get()*/)) { // Plazma - Remove Mojang Profiler + CURRENT_EXECUTION_CONTEXT.set(executionContext1); + contextConsumer.accept(executionContext1); + executionContext1.runCommandQueue(); +diff --git a/net/minecraft/commands/execution/ExecutionContext.java b/net/minecraft/commands/execution/ExecutionContext.java +index 18c7fff36ca26a659fa8ea022c93ea65f3199181..18e32841b66a54344d694e9a312327bc95c09993 100644 +--- a/net/minecraft/commands/execution/ExecutionContext.java ++++ b/net/minecraft/commands/execution/ExecutionContext.java +@@ -12,7 +12,7 @@ import net.minecraft.commands.ExecutionCommandSource; + import net.minecraft.commands.execution.tasks.BuildContexts; + import net.minecraft.commands.execution.tasks.CallFunction; + import net.minecraft.commands.functions.InstantiatedFunction; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import org.slf4j.Logger; + + public class ExecutionContext implements AutoCloseable { +@@ -20,7 +20,7 @@ public class ExecutionContext implements AutoCloseable { + private static final Logger LOGGER = LogUtils.getLogger(); + private final int commandLimit; + private final int forkLimit; +- private final ProfilerFiller profiler; ++ //private final ProfilerFiller profiler; // Plazma - Remove Mojang Profiler + @Nullable + private TraceCallbacks tracer; + private int commandQuota; +@@ -29,10 +29,10 @@ public class ExecutionContext implements AutoCloseable { + private final List> newTopCommands = new ObjectArrayList<>(); + private int currentFrameDepth; + +- public ExecutionContext(int commandLimit, int forkLimit, ProfilerFiller profiler) { ++ public ExecutionContext(int commandLimit, int forkLimit/*, ProfilerFiller profiler*/) { // Plazma - Remove Mojang Profiler + this.commandLimit = commandLimit; + this.forkLimit = forkLimit; +- this.profiler = profiler; ++ //this.profiler = profiler; // Plazma - Remove Mojang Profiler + this.commandQuota = commandLimit; + } + +@@ -131,9 +131,11 @@ public class ExecutionContext implements AutoCloseable { + return this.tracer; + } + ++ /* // Plazma - Remove Mojang Profiler + public ProfilerFiller profiler() { + return this.profiler; + } ++ */ // Plazma - Remove Mojang Profiler + + public int forkLimit() { + return this.forkLimit; +diff --git a/net/minecraft/commands/execution/tasks/BuildContexts.java b/net/minecraft/commands/execution/tasks/BuildContexts.java +index 569abbea01f585990d2017c68580257275bbb06d..9fd9f0955f15cd7638c0ef8358ee0fd3e8dc6846 100644 +--- a/net/minecraft/commands/execution/tasks/BuildContexts.java ++++ b/net/minecraft/commands/execution/tasks/BuildContexts.java +@@ -42,9 +42,9 @@ public class BuildContexts> { + ChainModifiers chainModifiers1 = chainModifiers; + List list = sources; + if (contextChain.getStage() != Stage.EXECUTE) { +- context.profiler().push(() -> "prepare " + this.commandInput); ++ //context.profiler().push(() -> "prepare " + this.commandInput); // Plazma - Remove Mojang Profiler + +- try { ++ //try { // Plazma - Remove Mojang Profiler + for (int forkLimit = context.forkLimit(); contextChain.getStage() != Stage.EXECUTE; contextChain = contextChain.nextStage()) { + CommandContext topContext = contextChain.getTopContext(); + if (topContext.isForked()) { +@@ -84,9 +84,10 @@ public class BuildContexts> { + list = list1; + } + } +- } finally { ++ /*} finally { // Plazma - Remove Mojang Profiler + context.profiler().pop(); + } ++ */ // Plazma - Remove Mojang Profiler + } + + if (list.isEmpty()) { +diff --git a/net/minecraft/commands/execution/tasks/ExecuteCommand.java b/net/minecraft/commands/execution/tasks/ExecuteCommand.java +index 18071dcc69cc28471dddb7de94e803ec1e5fc2e4..8b8ed964767177d9bda01a9ba1bec51da223d4a4 100644 +--- a/net/minecraft/commands/execution/tasks/ExecuteCommand.java ++++ b/net/minecraft/commands/execution/tasks/ExecuteCommand.java +@@ -23,7 +23,7 @@ public class ExecuteCommand> implements Unbo + + @Override + public void execute(T source, ExecutionContext executionContext, Frame frame) { +- executionContext.profiler().push(() -> "execute " + this.commandInput); ++ //executionContext.profiler().push(() -> "execute " + this.commandInput); // Plazma - Remove Mojang Profiler + + try { + executionContext.incrementCost(); +@@ -34,8 +34,9 @@ public class ExecuteCommand> implements Unbo + } + } catch (CommandSyntaxException var9) { + source.handleError(var9, this.modifiers.isForked(), executionContext.tracer()); +- } finally { ++ } /*finally { // Plazma - Remove Mojang Profiler + executionContext.profiler().pop(); + } ++ */ // Plazma - Remove Mojang Profiler + } + } +diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java +index 4c3d5fab206a923dab0d8956bf74eae1f7e60625..2d056c041e454fd2f724c6e42f21d435d527ba4f 100644 +--- a/net/minecraft/server/MinecraftServer.java ++++ b/net/minecraft/server/MinecraftServer.java +@@ -114,19 +114,19 @@ import net.minecraft.util.TimeUtil; + import net.minecraft.util.debugchart.RemoteDebugSampleType; + import net.minecraft.util.debugchart.SampleLogger; + import net.minecraft.util.debugchart.TpsDebugDimensions; +-import net.minecraft.util.profiling.EmptyProfileResults; +-import net.minecraft.util.profiling.ProfileResults; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; +-import net.minecraft.util.profiling.ResultField; +-import net.minecraft.util.profiling.SingleTickProfiler; ++//import net.minecraft.util.profiling.EmptyProfileResults; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfileResults; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ResultField; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.SingleTickProfiler; // Plazma - Remove Mojang Profiler + import net.minecraft.util.profiling.jfr.JvmProfiler; + import net.minecraft.util.profiling.jfr.callback.ProfiledDuration; +-import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; +-import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; +-import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; +-import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; +-import net.minecraft.util.profiling.metrics.storage.MetricsPersister; ++//import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Remove Mojang Profiler + import net.minecraft.util.thread.ReentrantBlockableEventLoop; + import net.minecraft.world.Difficulty; + import net.minecraft.world.RandomSequences; +@@ -201,13 +201,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList(); +- private MetricsRecorder metricsRecorder = InactiveMetricsRecorder.INSTANCE; +- private Consumer onMetricsRecordingStopped = results -> this.stopRecordingMetrics(); +- private Consumer onMetricsRecordingFinished = path -> {}; +- private boolean willStartRecordingMetrics; +- @Nullable +- private MinecraftServer.TimeProfiler debugCommandProfiler; +- private boolean debugCommandProfilerDelayStart; ++ //private MetricsRecorder metricsRecorder = InactiveMetricsRecorder.INSTANCE; // Plazma - Remove Mojang Profiler ++ //private Consumer onMetricsRecordingStopped = results -> this.stopRecordingMetrics(); // Plazma - Remove Mojang Profiler ++ //private Consumer onMetricsRecordingFinished = path -> {}; // Plazma - Remove Mojang Profiler ++ //private boolean willStartRecordingMetrics; // Plazma - Remove Mojang Profiler ++ //@Nullable // Plazma - Remove Mojang Profiler ++ //private MinecraftServer.TimeProfiler debugCommandProfiler; // Plazma - Remove Mojang Profiler ++ //private boolean debugCommandProfilerDelayStart; // Plazma - Remove Mojang Profiler + @Nullable // Plazma - Null safety + private ServerConnectionListener connection; + public final ChunkProgressListenerFactory progressListenerFactory; +@@ -956,9 +956,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop false : this::haveTime); + // Paper start - rewrite chunk system +@@ -1247,7 +1251,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; + try { + this.isSaving = true; +@@ -1550,10 +1555,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop serverPlayer1.connection.suspendFlushing()); // Plazma - Null safety + this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit + // Paper start - Folia scheduler API +@@ -1668,9 +1673,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Purpur - Ridables +- profilerFiller.push(() -> serverLevel + " " + serverLevel.dimension().location()); ++ //profilerFiller.push(() -> serverLevel + " " + serverLevel.dimension().location()); // Plazma - Remove Mojang Profiler + +- profilerFiller.push("tick"); ++ //profilerFiller.push("tick"); // Plazma - Remove Mojang Profiler + + try { + serverLevel.tick(hasTimeLeft); +@@ -1717,34 +1722,34 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { +@@ -32,7 +32,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener object, ResourceManager resourceManager, ProfilerFiller profiler) { ++ protected void apply(Map object, ResourceManager resourceManager/*, ProfilerFiller profiler*/) { // Plazma - Remove Mojang Profiler + Builder builder = ImmutableMap.builder(); + object.forEach((resourceLocation, advancement) -> { + // Spigot start +diff --git a/net/minecraft/server/ServerFunctionManager.java b/net/minecraft/server/ServerFunctionManager.java +index e3cb5d9cd0332c32df82fa6aef37401c523e8af0..30636cc2ea5bd30cae97272d3cbfe734da826115 100644 +--- a/net/minecraft/server/ServerFunctionManager.java ++++ b/net/minecraft/server/ServerFunctionManager.java +@@ -14,8 +14,8 @@ import net.minecraft.commands.execution.ExecutionContext; + import net.minecraft.commands.functions.CommandFunction; + import net.minecraft.commands.functions.InstantiatedFunction; + import net.minecraft.resources.ResourceLocation; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import org.slf4j.Logger; + + public class ServerFunctionManager { +@@ -50,18 +50,18 @@ public class ServerFunctionManager { + } + + private void executeTagFunctions(Collection> functionObjects, ResourceLocation identifier) { +- Profiler.get().push(identifier::toString); ++ //Profiler.get().push(identifier::toString); // Plazma - Remove Mojang Profiler + + for (CommandFunction commandFunction : functionObjects) { + this.execute(commandFunction, this.getGameLoopSender()); + } + +- Profiler.get().pop(); ++ //Profiler.get().pop(); // Plazma - Remove Mojang Profiler + } + + public void execute(CommandFunction function, CommandSourceStack source) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push(() -> "function " + function.id()); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push(() -> "function " + function.id()); // Plazma - Remove Mojang Profiler + + try { + InstantiatedFunction instantiatedFunction = function.instantiate(null, this.getDispatcher()); +@@ -72,9 +72,10 @@ public class ServerFunctionManager { + } catch (FunctionInstantiationException var9) { + } catch (Exception var10) { + LOGGER.warn("Failed to execute function {}", function.id(), var10); +- } finally { ++ } /*finally { // Plazma - Remove Mojang Profiler + profilerFiller.pop(); + } ++ */ // Plazma - Remove Mojang Profiler + } + + public void replaceLibrary(ServerFunctionLibrary reloader) { +diff --git a/net/minecraft/server/commands/DebugCommand.java b/net/minecraft/server/commands/DebugCommand.java +index b246c9885fd8c9cc0de2fd4faa53e0619dd3865c..3cd695079fccb7046414a769db7ade229572383c 100644 +--- a/net/minecraft/server/commands/DebugCommand.java ++++ b/net/minecraft/server/commands/DebugCommand.java +@@ -35,16 +35,12 @@ import net.minecraft.network.chat.Component; + import net.minecraft.resources.ResourceLocation; + import net.minecraft.server.MinecraftServer; + import net.minecraft.util.TimeUtil; +-import net.minecraft.util.profiling.ProfileResults; ++//import net.minecraft.util.profiling.ProfileResults; // Plazma - Remove Mojang Profiler + import org.apache.commons.io.IOUtils; + import org.slf4j.Logger; + + public class DebugCommand { + static final Logger LOGGER = LogUtils.getLogger(); +- private static final SimpleCommandExceptionType ERROR_NOT_RUNNING = new SimpleCommandExceptionType(Component.translatable("commands.debug.notRunning")); +- private static final SimpleCommandExceptionType ERROR_ALREADY_RUNNING = new SimpleCommandExceptionType( +- Component.translatable("commands.debug.alreadyRunning") +- ); + static final SimpleCommandExceptionType NO_RECURSIVE_TRACES = new SimpleCommandExceptionType(Component.translatable("commands.debug.function.noRecursion")); + static final SimpleCommandExceptionType NO_RETURN_RUN = new SimpleCommandExceptionType(Component.translatable("commands.debug.function.noReturnRun")); + +@@ -52,8 +48,8 @@ public class DebugCommand { + dispatcher.register( + Commands.literal("debug") + .requires(source -> source.hasPermission(3)) +- .then(Commands.literal("start").executes(context -> start(context.getSource()))) +- .then(Commands.literal("stop").executes(context -> stop(context.getSource()))) ++ .then(Commands.literal("start").executes(DebugCommand::unsupported)) // Plazma - Remove Mojang Profiler ++ .then(Commands.literal("stop").executes(DebugCommand::unsupported)) // Plazma - Remove Mojang Profiler + .then( + Commands.literal("function") + .requires(source -> source.hasPermission(3)) +@@ -66,34 +62,12 @@ public class DebugCommand { + ); + } + +- private static int start(CommandSourceStack source) throws CommandSyntaxException { +- MinecraftServer server = source.getServer(); +- if (server.isTimeProfilerRunning()) { +- throw ERROR_ALREADY_RUNNING.create(); +- } else { +- server.startTimeProfiler(); +- source.sendSuccess(() -> Component.translatable("commands.debug.started"), true); +- return 0; +- } +- } +- +- private static int stop(CommandSourceStack source) throws CommandSyntaxException { +- MinecraftServer server = source.getServer(); +- if (!server.isTimeProfilerRunning()) { +- throw ERROR_NOT_RUNNING.create(); +- } else { +- ProfileResults profileResults = server.stopTimeProfiler(); +- double d = (double)profileResults.getNanoDuration() / TimeUtil.NANOSECONDS_PER_SECOND; +- double d1 = profileResults.getTickDuration() / d; +- source.sendSuccess( +- () -> Component.translatable( +- "commands.debug.stopped", String.format(Locale.ROOT, "%.2f", d), profileResults.getTickDuration(), String.format(Locale.ROOT, "%.2f", d1) +- ), +- true +- ); +- return (int)d1; +- } ++ // Plazma start - Remove Mojang Profiler ++ private static final SimpleCommandExceptionType ERROR_UNSUPPORTED = new SimpleCommandExceptionType(Component.literal("Mojang Profiler was removed from Plazma. If you need to do profiling, please use Spark instead.")); ++ private static int unsupported(final CommandContext source) throws CommandSyntaxException { ++ throw ERROR_UNSUPPORTED.create(); + } ++ // Plazma end - Remove Mojang Profiler + + static class TraceCustomExecutor + extends CustomCommandExecutor.WithErrorHandling +diff --git a/net/minecraft/server/commands/PerfCommand.java b/net/minecraft/server/commands/PerfCommand.java +index a3192400b37274620977e5a40d4283bfec3ab9b3..a936031e38f8a1f40e484b55dcf0ac84cfdec97a 100644 +--- a/net/minecraft/server/commands/PerfCommand.java ++++ b/net/minecraft/server/commands/PerfCommand.java +@@ -19,89 +19,27 @@ import net.minecraft.network.chat.Component; + import net.minecraft.server.MinecraftServer; + import net.minecraft.util.FileZipper; + import net.minecraft.util.TimeUtil; +-import net.minecraft.util.profiling.EmptyProfileResults; +-import net.minecraft.util.profiling.ProfileResults; +-import net.minecraft.util.profiling.metrics.storage.MetricsPersister; ++//import net.minecraft.util.profiling.EmptyProfileResults; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfileResults; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Remove Mojang Profiler + import org.apache.commons.io.FileUtils; + import org.slf4j.Logger; + + public class PerfCommand { +- private static final Logger LOGGER = LogUtils.getLogger(); +- private static final SimpleCommandExceptionType ERROR_NOT_RUNNING = new SimpleCommandExceptionType(Component.translatable("commands.perf.notRunning")); +- private static final SimpleCommandExceptionType ERROR_ALREADY_RUNNING = new SimpleCommandExceptionType( +- Component.translatable("commands.perf.alreadyRunning") +- ); +- + public static void register(CommandDispatcher dispatcher) { + dispatcher.register( + Commands.literal("perf") + .requires(source -> source.hasPermission(4)) +- .then(Commands.literal("start").executes(context -> startProfilingDedicatedServer(context.getSource()))) +- .then(Commands.literal("stop").executes(context -> stopProfilingDedicatedServer(context.getSource()))) ++ .then(Commands.literal("start").executes(PerfCommand::unsupported)) // Plazma - Remove Mojang Profiler ++ .then(Commands.literal("stop").executes(PerfCommand::unsupported)) // Plazma - Remove Mojang Profiler + ); + } + +- private static int startProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException { +- MinecraftServer server = source.getServer(); +- if (server.isRecordingMetrics()) { +- throw ERROR_ALREADY_RUNNING.create(); +- } else { +- Consumer consumer = results -> whenStopped(source, results); +- Consumer consumer1 = dumpPath -> saveResults(source, dumpPath, server); +- server.startRecordingMetrics(consumer, consumer1); +- source.sendSuccess(() -> Component.translatable("commands.perf.started"), false); +- return 0; +- } +- } +- +- private static int stopProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException { +- MinecraftServer server = source.getServer(); +- if (!server.isRecordingMetrics()) { +- throw ERROR_NOT_RUNNING.create(); +- } else { +- server.finishRecordingMetrics(); +- return 0; +- } ++ // Plazma start - Remove Mojang Profiler ++ private static final SimpleCommandExceptionType ERROR_UNSUPPORTED = new SimpleCommandExceptionType(Component.literal("Mojang Profiler was removed from Plazma. If you need to do profiling, please use Spark instead.")); ++ private static int unsupported(final com.mojang.brigadier.context.CommandContext source) throws CommandSyntaxException { ++ throw ERROR_UNSUPPORTED.create(); + } ++ // Plazma end - Remove Mojang Profiler + +- private static void saveResults(CommandSourceStack source, Path path, MinecraftServer server) { +- String string = String.format( +- Locale.ROOT, "%s-%s-%s", Util.getFilenameFormattedDateTime(), server.getWorldData().getLevelName(), SharedConstants.getCurrentVersion().getId() +- ); +- +- String string1; +- try { +- string1 = FileUtil.findAvailableName(MetricsPersister.PROFILING_RESULTS_DIR, string, ".zip"); +- } catch (IOException var11) { +- source.sendFailure(Component.translatable("commands.perf.reportFailed")); +- LOGGER.error("Failed to create report name", (Throwable)var11); +- return; +- } +- +- try (FileZipper fileZipper = new FileZipper(MetricsPersister.PROFILING_RESULTS_DIR.resolve(string1))) { +- fileZipper.add(Paths.get("system.txt"), server.fillSystemReport(new SystemReport()).toLineSeparatedString()); +- fileZipper.add(path); +- } +- +- try { +- FileUtils.forceDelete(path.toFile()); +- } catch (IOException var9) { +- LOGGER.warn("Failed to delete temporary profiling file {}", path, var9); +- } +- +- source.sendSuccess(() -> Component.translatable("commands.perf.reportSaved", string1), false); +- } +- +- private static void whenStopped(CommandSourceStack source, ProfileResults results) { +- if (results != EmptyProfileResults.EMPTY) { +- int tickDuration = results.getTickDuration(); +- double d = (double)results.getNanoDuration() / TimeUtil.NANOSECONDS_PER_SECOND; +- source.sendSuccess( +- () -> Component.translatable( +- "commands.perf.stopped", String.format(Locale.ROOT, "%.2f", d), tickDuration, String.format(Locale.ROOT, "%.2f", tickDuration / d) +- ), +- false +- ); +- } +- } + } +diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java +index 300e5b09b78089c8ea1e18e046012fae93a4f110..8e56b80201892238a43a90eb5b91ce6fc62f000a 100644 +--- a/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/net/minecraft/server/dedicated/DedicatedServer.java +@@ -767,11 +767,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface + return this.settings.getProperties().serverResourcePackInfo; + } + ++ /* // Plazma - Remove Mojang Profiler + @Override + public void endMetricsRecordingTick() { + super.endMetricsRecordingTick(); + this.debugSampleSubscriptionTracker.tick(this.getTickCount()); + } ++ */ // Plazma - Remove Mojang Profiler + + @Override + public SampleLogger getTickTimeLogger() { +diff --git a/net/minecraft/server/level/ChunkGenerationTask.java b/net/minecraft/server/level/ChunkGenerationTask.java +index 4221af18f5087badb5cd8c7cf66ab3312edf0394..a1966617941a43b034442e8a883703c56ac90484 100644 +--- a/net/minecraft/server/level/ChunkGenerationTask.java ++++ b/net/minecraft/server/level/ChunkGenerationTask.java +@@ -5,8 +5,8 @@ import java.util.List; + import java.util.concurrent.CompletableFuture; + import javax.annotation.Nullable; + import net.minecraft.util.StaticCache2D; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.Zone; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.Zone; // Plazma - Remove Mojang Profiler + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.chunk.ChunkAccess; + import net.minecraft.world.level.chunk.status.ChunkDependencies; +@@ -113,8 +113,8 @@ public class ChunkGenerationTask { + } + + private void scheduleLayer(ChunkStatus status, boolean needsGeneration) { +- try (Zone zone = Profiler.get().zone("scheduleLayer")) { +- zone.addText(status::getName); ++ //try (Zone zone = Profiler.get().zone("scheduleLayer")) { // Plazma - Remove Mojang Profiler ++ //zone.addText(status::getName); // Plazma - Remove Mojang Profiler + int radiusForLayer = this.getRadiusForLayer(status, needsGeneration); + + for (int i = this.pos.x - radiusForLayer; i <= this.pos.x + radiusForLayer; i++) { +@@ -125,7 +125,7 @@ public class ChunkGenerationTask { + } + } + } +- } ++ //} // Plazma - Remove Mojang Profiler + } + + private int getRadiusForLayer(ChunkStatus status, boolean needsGeneration) { +diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java +index b3f498558614243cf633dcd71e3c49c2c55e6e0f..c85c67af039cba44183703ff248d26769698d4f6 100644 +--- a/net/minecraft/server/level/ChunkMap.java ++++ b/net/minecraft/server/level/ChunkMap.java +@@ -60,8 +60,8 @@ import net.minecraft.server.network.ServerPlayerConnection; + import net.minecraft.util.CsvOutput; + import net.minecraft.util.Mth; + import net.minecraft.util.StaticCache2D; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.util.thread.BlockableEventLoop; + import net.minecraft.util.thread.ConsecutiveExecutor; + import net.minecraft.world.entity.Entity; +@@ -410,15 +410,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + } + + protected void tick(BooleanSupplier hasMoreTime) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("poi"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("poi"); // Plazma - Remove Mojang Profiler + this.poiManager.tick(hasMoreTime); +- profilerFiller.popPush("chunk_unload"); ++ //profilerFiller.popPush("chunk_unload"); // Plazma - Remove Mojang Profiler + if (!this.level.noSave()) { + this.processUnloads(hasMoreTime); + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + public boolean hasWork() { +diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java +index 6540b2d6a1062d883811ce240c49d30d1925b291..81d52d29c906e52da3e5bde480d2197d82e5fea1 100644 +--- a/net/minecraft/server/level/ServerChunkCache.java ++++ b/net/minecraft/server/level/ServerChunkCache.java +@@ -25,8 +25,8 @@ import net.minecraft.network.protocol.Packet; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.progress.ChunkProgressListener; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.util.thread.BlockableEventLoop; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.MobCategory; +@@ -467,37 +467,37 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + // CraftBukkit start - modelled on below + public void purgeUnload() { + if (true) return; // Paper - rewrite chunk system +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Plazma - Remove Mojang Profiler + +- gameprofilerfiller.push("purge"); ++ //gameprofilerfiller.push("purge"); // Plazma - Remove Mojang Profiler + this.distanceManager.purgeStaleTickets(); + this.runDistanceManagerUpdates(); +- gameprofilerfiller.popPush("unload"); ++ //gameprofilerfiller.popPush("unload"); // Plazma - Remove Mojang Profiler + this.chunkMap.tick(() -> true); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Plazma - Remove Mojang Profiler + this.clearCache(); + } + // CraftBukkit end + + @Override + public void tick(BooleanSupplier hasTimeLeft, boolean tickChunks) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("purge"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("purge"); // Plazma - Remove Mojang Profiler + if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot + this.distanceManager.purgeStaleTickets(); + } + + this.runDistanceManagerUpdates(); +- profilerFiller.popPush("chunks"); ++ //profilerFiller.popPush("chunks"); // Plazma - Remove Mojang Profiler + if (tickChunks) { + ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system + this.tickChunks(); + this.chunkMap.tick(); + } + +- profilerFiller.popPush("unload"); ++ //profilerFiller.popPush("unload"); // Plazma - Remove Mojang Profiler + this.chunkMap.tick(hasTimeLeft); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.clearCache(); + } + +@@ -506,33 +506,33 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + long l = gameTime - this.lastInhabitedUpdate; + this.lastInhabitedUpdate = gameTime; + if (!this.level.isDebug()) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("pollingChunks"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("pollingChunks"); // Plazma - Remove Mojang Profiler + if (this.level.tickRateManager().runsNormally()) { + List list = this.tickingChunks; + + try { +- profilerFiller.push("filteringTickingChunks"); ++ //profilerFiller.push("filteringTickingChunks"); // Plazma - Remove Mojang Profiler + this.collectTickingChunks(list); +- profilerFiller.popPush("shuffleChunks"); ++ //profilerFiller.popPush("shuffleChunks"); // Plazma - Remove Mojang Profiler + // Paper start - chunk tick iteration optimisation + this.shuffleRandom.setSeed(this.level.random.nextLong()); + if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled + // Paper end - chunk tick iteration optimisation +- this.tickChunks(profilerFiller, l, list); +- profilerFiller.pop(); ++ this.tickChunks(l, list); // Plazma - Remove Mojang Profiler ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } finally { + list.clear(); + } + } + +- this.broadcastChangedChunks(profilerFiller); +- profilerFiller.pop(); ++ this.broadcastChangedChunks(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + } + +- private void broadcastChangedChunks(ProfilerFiller profiler) { +- profiler.push("broadcast"); ++ private void broadcastChangedChunks() { // Plazma - Remove Mojang Profiler ++ //profiler.push("broadcast"); // Plazma - Remove Mojang Profiler + + for (ChunkHolder chunkHolder : this.chunkHoldersToBroadcast) { + LevelChunk tickingChunk = chunkHolder.getChunkToSend(); // Paper - rewrite chunk system +@@ -542,7 +542,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + } + + this.chunkHoldersToBroadcast.clear(); +- profiler.pop(); ++ //profiler.pop(); // Plazma - Remove Mojang Profiler + } + + private void collectTickingChunks(List output) { +@@ -568,8 +568,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + // Paper end - chunk tick iteration optimisation + } + +- private void tickChunks(ProfilerFiller profiler, long timeInhabited, List chunks) { +- profiler.popPush("naturalSpawnCount"); ++ private void tickChunks(/*ProfilerFiller profiler,*/ long timeInhabited, List chunks) { // Plazma - Remove Mojang Profiler ++ //profiler.popPush("naturalSpawnCount"); // Plazma - Remove Mojang Profiler + int naturalSpawnChunkCount = this.distanceManager.getNaturalSpawnChunkCount(); + // Paper start - Optional per player mob spawns + NaturalSpawner.SpawnState spawnState; +@@ -594,7 +594,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + } + // Paper end - Optional per player mob spawns + this.lastSpawnState = spawnState; +- profiler.popPush("spawnAndTick"); ++ //profiler.popPush("spawnAndTick"); // Plazma - Remove Mojang Profiler + boolean _boolean = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit + int _int = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING); + List filteredSpawningCategories; +@@ -625,7 +625,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + } + } + +- profiler.popPush("customSpawners"); ++ //profiler.popPush("customSpawners"); // Plazma - Remove Mojang Profiler + if (_boolean) { + this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies); + } +@@ -814,7 +814,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + + @Override + protected void doRunTask(Runnable task) { +- Profiler.get().incrementCounter("runTask"); ++ //Profiler.get().incrementCounter("runTask"); // Plazma - Remove Mojang Profiler + super.doRunTask(task); + } + +diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java +index be4e3533590cd36bbed6f17f3be5941e70f40b8a..684052e40649d499d6f538922354f54438cc438a 100644 +--- a/net/minecraft/server/level/ServerLevel.java ++++ b/net/minecraft/server/level/ServerLevel.java +@@ -77,8 +77,8 @@ import net.minecraft.util.ProgressListener; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; + import net.minecraft.util.datafix.DataFixTypes; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.util.valueproviders.IntProvider; + import net.minecraft.util.valueproviders.UniformInt; + import net.minecraft.world.DifficultyInstance; +@@ -752,16 +752,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + } + + public void tick(BooleanSupplier hasTimeLeft) { +- ProfilerFiller profilerFiller = Profiler.get(); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler + this.handlingTick = true; + TickRateManager tickRateManager = this.tickRateManager(); + boolean runsNormally = tickRateManager.runsNormally(); + if (runsNormally) { +- profilerFiller.push("world border"); ++ //profilerFiller.push("world border"); // Plazma - Remove Mojang Profiler + this.getWorldBorder().tick(); +- profilerFiller.popPush("weather"); ++ //profilerFiller.popPush("weather"); // Plazma - Remove Mojang Profiler + this.advanceWeatherCycle(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); +@@ -795,41 +795,41 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + this.tickTime(); + } + +- profilerFiller.push("tickPending"); ++ //profilerFiller.push("tickPending"); // Plazma - Remove Mojang Profiler + if (!this.isDebug() && runsNormally) { + long l = this.getGameTime(); +- profilerFiller.push("blockTicks"); ++ //profilerFiller.push("blockTicks"); // Plazma - Remove Mojang Profiler + this.blockTicks.tick(l, paperConfig().environment.maxBlockTicks, this::tickBlock); // Paper - configurable max block ticks +- profilerFiller.popPush("fluidTicks"); ++ //profilerFiller.popPush("fluidTicks"); // Plazma - Remove Mojang Profiler + this.fluidTicks.tick(l, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + +- profilerFiller.popPush("raid"); ++ //profilerFiller.popPush("raid"); // Plazma - Remove Mojang Profiler + if (runsNormally) { + this.raids.tick(); + } + +- profilerFiller.popPush("chunkSource"); ++ //profilerFiller.popPush("chunkSource"); // Plazma - Remove Mojang Profiler + this.getChunkSource().tick(hasTimeLeft, true); +- profilerFiller.popPush("blockEvents"); ++ //profilerFiller.popPush("blockEvents"); // Plazma - Remove Mojang Profiler + if (runsNormally) { + this.runBlockEvents(); + } + + this.handlingTick = false; +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + boolean flag = !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 (flag) { + this.resetEmptyTime(); + } + + if (flag || this.emptyTime++ < 300) { +- profilerFiller.push("entities"); ++ //profilerFiller.push("entities"); // Plazma - Remove Mojang Profiler + if (this.dragonFight != null && runsNormally) { +- profilerFiller.push("dragonFight"); ++ //profilerFiller.push("dragonFight"); // Plazma - Remove Mojang Profiler + this.dragonFight.tick(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR +@@ -839,9 +839,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + } + + if (!tickRateManager.isEntityFrozen(entity)) { +- profilerFiller.push("checkDespawn"); ++ //profilerFiller.push("checkDespawn"); // Plazma - Remove Mojang Profiler + entity.checkDespawn(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + // Plazma start - Improve code styling + // Paper start - Rewrite chunk system + Entity vehicle = entity.getVehicle(); +@@ -853,20 +853,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + entity.stopRiding(); + } + +- profilerFiller.push("tick"); ++ //profilerFiller.push("tick"); // Plazma - Remove Mojang Profiler + this.guardEntityTick(this::tickNonPassenger, entity); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + // Paper end - Rewrite chunk system + // Plazma end - Improve code styling + } + }); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.tickBlockEntities(); + } + +- profilerFiller.push("entityManagement"); ++ //profilerFiller.push("entityManagement"); // Plazma - Remove Mojang Profiler + // Paper - rewrite chunk system +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + @Override +@@ -883,9 +883,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + + long l = this.levelData.getGameTime() + 1L; + this.serverLevelData.setGameTime(l); +- Profiler.get().push("scheduledFunctions"); ++ //Profiler.get().push("scheduledFunctions"); // Plazma - Remove Mojang Profiler + this.serverLevelData.getScheduledEvents().tick(this.server, l); +- Profiler.get().pop(); ++ //Profiler.get().pop(); // Plazma - Remove Mojang Profiler + if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { + // Purpur start - Configurable daylight cycle + int incrementTicks = isDay() ? this.purpurConfig.daytimeTicks : this.purpurConfig.nighttimeTicks; +@@ -986,8 +986,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + boolean isRaining = this.isRaining(); + int minBlockX = pos.getMinBlockX(); + int minBlockZ = pos.getMinBlockZ(); +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("thunder"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("thunder"); // Plazma - Remove Mojang Profiler + if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 && simpleRandom.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder // Paper - optimise random ticking + BlockPos blockPos = this.findLightningTargetAround(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15)); + if (this.isRainingAt(blockPos)) { +@@ -1023,7 +1023,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + } + } + +- profilerFiller.popPush("iceandsnow"); ++ //profilerFiller.popPush("iceandsnow"); // Plazma - Remove Mojang Profiler + + if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow + for (int i = 0; i < randomTickSpeed; i++) { +@@ -1033,12 +1033,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + } + } // Paper - Option to disable ice and snow + +- profilerFiller.popPush("tickBlocks"); ++ //profilerFiller.popPush("tickBlocks"); // Plazma - Remove Mojang Profiler + if (randomTickSpeed > 0) { + this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + @VisibleForTesting +@@ -1335,11 +1335,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + // Plazma start - Improve code quality + // Paper end - log detailed entity tick information + entity.setOldPosAndRot(); +- ProfilerFiller profilerFiller = Profiler.get(); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler + entity.tickCount++; + entity.totalEntityAge++; // Paper - age-like counter for all entities +- profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString()); +- profilerFiller.incrementCounter("tickNonPassenger"); ++ //profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString()); // Plazma - Remove Mojang Profiler ++ //profilerFiller.incrementCounter("tickNonPassenger"); // Plazma - Remove Mojang Profiler + final boolean isActive = io.papermc.paper.entity.activation.ActivationRange.checkIfActive(entity); // Paper - EAR 2 + if (isActive) { // Paper - EAR 2 + entity.tick(); +@@ -1347,7 +1347,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + } else { + entity.inactiveTick(); // Paper - EAR 2 + } +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + + for (Entity entity1 : entity.getPassengers()) { + this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2 +@@ -1373,9 +1373,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + passengerEntity.setOldPosAndRot(); + passengerEntity.tickCount++; + passengerEntity.totalEntityAge++; // Paper - age-like counter for all entities +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(passengerEntity.getType()).toString()); +- profilerFiller.incrementCounter("tickPassenger"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(passengerEntity.getType()).toString()); // Plazma - Remove Mojang Profiler ++ //profilerFiller.incrementCounter("tickPassenger"); // Plazma - Remove Mojang Profiler + // Paper start - EAR 2 + if (isActive) { + passengerEntity.rideTick(); +@@ -1387,7 +1387,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + ridingEntity.positionRider(passengerEntity); + } + // Paper end - EAR 2 +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + + for (Entity entity : passengerEntity.getPassengers()) { + this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2 +diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java +index 43a873acfb8596147e950713eab2ecfe0153b038..02a98ceb68fc69e926f1e0907ba5160bcaea1a1d 100644 +--- a/net/minecraft/server/level/ServerPlayer.java ++++ b/net/minecraft/server/level/ServerPlayer.java +@@ -96,8 +96,8 @@ import net.minecraft.tags.FluidTags; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.Container; + import net.minecraft.world.Difficulty; + import net.minecraft.world.InteractionHand; +@@ -1459,14 +1459,14 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc + this.unsetRemoved(); + */ + // CraftBukkit end +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("moving"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("moving"); // Plazma - Remove Mojang Profiler + if (level != null && resourceKey == net.minecraft.world.level.dimension.LevelStem.OVERWORLD && level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER) { // CraftBukkit - empty to fall through to null to event + this.enteredNetherPosition = this.position(); + } + +- profilerFiller.pop(); +- profilerFiller.push("placing"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("placing"); // Plazma - Remove Mojang Profiler + // CraftBukkit start + this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds + LevelData worlddata = level.getLevelData(); +@@ -1484,7 +1484,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc + this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event + this.connection.resetPosition(); + level.addDuringTeleport(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.triggerDimensionChangeTriggers(serverLevel); + this.stopUsingItem(); + this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); +diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +index 398c1733824b689520170de0be94006731afa5cd..f44467c6ceae194f781d046b8040698a398211fa 100644 +--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -24,7 +24,7 @@ import net.minecraft.network.protocol.cookie.ServerboundCookieResponsePacket; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.ClientInformation; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler + import org.slf4j.Logger; + + public abstract class ServerCommonPacketListenerImpl implements ServerCommonPacketListener, org.bukkit.craftbukkit.entity.CraftPlayer.TransferCookieConnection { // CraftBukkit +@@ -252,7 +252,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + } + + protected void keepConnectionAlive() { +- Profiler.get().push("keepAlive"); ++ //Profiler.get().push("keepAlive"); // Plazma - Remove Mojang Profiler + long millis = Util.getMillis(); + // Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings + // This should effectively place the keepalive handling back to "as it was" before 1.12.2 +@@ -287,7 +287,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + } + } + +- Profiler.get().pop(); ++ //Profiler.get().pop(); // Plazma - Remove Mojang Profiler + } + + private boolean checkIfClosed(long time) { +diff --git a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java +index 71a4a0b8535a21667261fd66d41cca1216fd9933..e3ef58e30c976a455e7e2cd3a09b52a1dc0ac5d1 100644 +--- a/net/minecraft/server/packs/resources/ProfiledReloadInstance.java ++++ b/net/minecraft/server/packs/resources/ProfiledReloadInstance.java +@@ -9,8 +9,8 @@ import java.util.concurrent.TimeUnit; + import java.util.concurrent.atomic.AtomicLong; + import net.minecraft.Util; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import org.slf4j.Logger; + + public class ProfiledReloadInstance extends SimpleReloadInstance { +@@ -51,12 +51,12 @@ public class ProfiledReloadInstance extends SimpleReloadInstance executor.execute(() -> { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push(name); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push(name); // Plazma - Remove Mojang Profiler + long nanos = Util.getNanos(); + runnable.run(); + timeTaken.addAndGet(Util.getNanos() - nanos); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + }); + } + +diff --git a/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +index 407bd4b8026869bc14ee5e79ff80e7bdd1a07bcb..501db9337be8ae70e7277bf4ae82bea75ce176b1 100644 +--- a/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java ++++ b/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +@@ -3,8 +3,8 @@ package net.minecraft.server.packs.resources; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + + public interface ResourceManagerReloadListener extends PreparableReloadListener { + @Override +@@ -12,10 +12,10 @@ public interface ResourceManagerReloadListener extends PreparableReloadListener + PreparableReloadListener.PreparationBarrier barrier, ResourceManager manager, Executor backgroundExecutor, Executor gameExecutor + ) { + return barrier.wait(Unit.INSTANCE).thenRunAsync(() -> { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("listener"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("listener"); // Plazma - Remove Mojang Profiler + this.onResourceManagerReload(manager); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + }, gameExecutor); + } + +diff --git a/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java b/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java +index 0029521553425d8257d8d682eefd4b602327a0df..b40dc276d0c8139499e55e688f5d82c7ba9cca37 100644 +--- a/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java ++++ b/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java +@@ -17,7 +17,7 @@ import net.minecraft.core.Registry; + import net.minecraft.resources.FileToIdConverter; + import net.minecraft.resources.ResourceKey; + import net.minecraft.resources.ResourceLocation; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import org.slf4j.Logger; + + public abstract class SimpleJsonResourceReloadListener extends SimplePreparableReloadListener> { +@@ -41,7 +41,7 @@ public abstract class SimpleJsonResourceReloadListener extends SimplePreparab + } + + @Override +- protected Map prepare(ResourceManager resourceManager, ProfilerFiller profiler) { ++ protected Map prepare(ResourceManager resourceManager/*, ProfilerFiller profiler*/) { // Plazma - Remove Mojang Profiler + Map map = new HashMap<>(); + scanDirectory(resourceManager, this.lister, this.ops, this.codec, map); + return map; +diff --git a/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java +index 64b0508ef21952c65b0b967b756b2a4c64d96899..61d66c67a986859f05cc74c993c6e6c2eb52eab9 100644 +--- a/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java ++++ b/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java +@@ -2,20 +2,20 @@ package net.minecraft.server.packs.resources; + + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + + public abstract class SimplePreparableReloadListener implements PreparableReloadListener { + @Override + public final CompletableFuture reload( + PreparableReloadListener.PreparationBarrier barrier, ResourceManager manager, Executor backgroundExecutor, Executor gameExecutor + ) { +- return CompletableFuture.supplyAsync(() -> this.prepare(manager, Profiler.get()), backgroundExecutor) ++ return CompletableFuture.supplyAsync(() -> this.prepare(manager/*, Profiler.get()*/), backgroundExecutor) // Plazma - Remove Mojang Profiler + .thenCompose(barrier::wait) +- .thenAcceptAsync(object -> this.apply((T)object, manager, Profiler.get()), gameExecutor); ++ .thenAcceptAsync(object -> this.apply((T)object, manager/*, Profiler.get()*/), gameExecutor); // Plazma - Remove Mojang Profiler + } + +- protected abstract T prepare(ResourceManager resourceManager, ProfilerFiller profiler); ++ protected abstract T prepare(ResourceManager resourceManager/*, ProfilerFiller profiler*/); // Plazma - Remove Mojang Profiler + +- protected abstract void apply(T object, ResourceManager resourceManager, ProfilerFiller profiler); ++ protected abstract void apply(T object, ResourceManager resourceManager/*, ProfilerFiller profiler*/); // Plazma - Remove Mojang Profiler + } +diff --git a/net/minecraft/util/profiling/ActiveProfiler.java b/net/minecraft/util/profiling/ActiveProfiler.java +deleted file mode 100644 +index 595e0fd9bf08bcb8358bce2a46d4322f1394e7cb..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/ActiveProfiler.java ++++ /dev/null +@@ -1,206 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import com.google.common.collect.Lists; +-import com.google.common.collect.Maps; +-import com.mojang.logging.LogUtils; +-import it.unimi.dsi.fastutil.longs.LongArrayList; +-import it.unimi.dsi.fastutil.longs.LongList; +-import it.unimi.dsi.fastutil.objects.Object2LongMap; +-import it.unimi.dsi.fastutil.objects.Object2LongMaps; +-import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap; +-import it.unimi.dsi.fastutil.objects.ObjectArraySet; +-import java.time.Duration; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.function.IntSupplier; +-import java.util.function.LongSupplier; +-import java.util.function.Supplier; +-import javax.annotation.Nullable; +-import net.minecraft.Util; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import org.apache.commons.lang3.tuple.Pair; +-import org.slf4j.Logger; +- +-public class ActiveProfiler implements ProfileCollector { +- private static final long WARNING_TIME_NANOS = Duration.ofMillis(100L).toNanos(); +- private static final Logger LOGGER = LogUtils.getLogger(); +- private final List paths = Lists.newArrayList(); +- private final LongList startTimes = new LongArrayList(); +- private final Map entries = Maps.newHashMap(); +- private final IntSupplier getTickTime; +- private final LongSupplier getRealTime; +- private final long startTimeNano; +- private final int startTimeTicks; +- private String path = ""; +- private boolean started; +- @Nullable +- private ActiveProfiler.PathEntry currentEntry; +- private final boolean warn; +- private final Set> chartedPaths = new ObjectArraySet<>(); +- +- public ActiveProfiler(LongSupplier startTimeNano, IntSupplier startTimeTicks, boolean warn) { +- this.startTimeNano = startTimeNano.getAsLong(); +- this.getRealTime = startTimeNano; +- this.startTimeTicks = startTimeTicks.getAsInt(); +- this.getTickTime = startTimeTicks; +- this.warn = warn; +- } +- +- @Override +- public void startTick() { +- if (this.started) { +- LOGGER.error("Profiler tick already started - missing endTick()?"); +- } else { +- this.started = true; +- this.path = ""; +- this.paths.clear(); +- this.push("root"); +- } +- } +- +- @Override +- public void endTick() { +- if (!this.started) { +- LOGGER.error("Profiler tick already ended - missing startTick()?"); +- } else { +- this.pop(); +- this.started = false; +- if (!this.path.isEmpty()) { +- LOGGER.error( +- "Profiler tick ended before path was fully popped (remainder: '{}'). Mismatched push/pop?", +- LogUtils.defer(() -> ProfileResults.demanglePath(this.path)) +- ); +- } +- } +- } +- +- @Override +- public void push(String name) { +- if (!this.started) { +- LOGGER.error("Cannot push '{}' to profiler if profiler tick hasn't started - missing startTick()?", name); +- } else { +- if (!this.path.isEmpty()) { +- this.path = this.path + "\u001e"; +- } +- +- this.path = this.path + name; +- this.paths.add(this.path); +- this.startTimes.add(Util.getNanos()); +- this.currentEntry = null; +- } +- } +- +- @Override +- public void push(Supplier nameSupplier) { +- this.push(nameSupplier.get()); +- } +- +- @Override +- public void markForCharting(MetricCategory category) { +- this.chartedPaths.add(Pair.of(this.path, category)); +- } +- +- @Override +- public void pop() { +- if (!this.started) { +- LOGGER.error("Cannot pop from profiler if profiler tick hasn't started - missing startTick()?"); +- } else if (this.startTimes.isEmpty()) { +- LOGGER.error("Tried to pop one too many times! Mismatched push() and pop()?"); +- } else { +- long nanos = Util.getNanos(); +- long l = this.startTimes.removeLong(this.startTimes.size() - 1); +- this.paths.remove(this.paths.size() - 1); +- long l1 = nanos - l; +- ActiveProfiler.PathEntry currentEntry = this.getCurrentEntry(); +- currentEntry.accumulatedDuration += l1; +- currentEntry.count++; +- currentEntry.maxDuration = Math.max(currentEntry.maxDuration, l1); +- currentEntry.minDuration = Math.min(currentEntry.minDuration, l1); +- if (this.warn && l1 > WARNING_TIME_NANOS) { +- LOGGER.warn( +- "Something's taking too long! '{}' took aprox {} ms", +- LogUtils.defer(() -> ProfileResults.demanglePath(this.path)), +- LogUtils.defer(() -> l1 / 1000000.0) +- ); +- } +- +- this.path = this.paths.isEmpty() ? "" : this.paths.get(this.paths.size() - 1); +- this.currentEntry = null; +- } +- } +- +- @Override +- public void popPush(String name) { +- this.pop(); +- this.push(name); +- } +- +- @Override +- public void popPush(Supplier nameSupplier) { +- this.pop(); +- this.push(nameSupplier); +- } +- +- private ActiveProfiler.PathEntry getCurrentEntry() { +- if (this.currentEntry == null) { +- this.currentEntry = this.entries.computeIfAbsent(this.path, string -> new ActiveProfiler.PathEntry()); +- } +- +- return this.currentEntry; +- } +- +- @Override +- public void incrementCounter(String counterName, int increment) { +- this.getCurrentEntry().counters.addTo(counterName, increment); +- } +- +- @Override +- public void incrementCounter(Supplier counterNameSupplier, int increment) { +- this.getCurrentEntry().counters.addTo(counterNameSupplier.get(), increment); +- } +- +- @Override +- public ProfileResults getResults() { +- return new FilledProfileResults(this.entries, this.startTimeNano, this.startTimeTicks, this.getRealTime.getAsLong(), this.getTickTime.getAsInt()); +- } +- +- @Nullable +- @Override +- public ActiveProfiler.PathEntry getEntry(String entryId) { +- return this.entries.get(entryId); +- } +- +- @Override +- public Set> getChartedPaths() { +- return this.chartedPaths; +- } +- +- public static class PathEntry implements ProfilerPathEntry { +- long maxDuration = Long.MIN_VALUE; +- long minDuration = Long.MAX_VALUE; +- long accumulatedDuration; +- long count; +- final Object2LongOpenHashMap counters = new Object2LongOpenHashMap<>(); +- +- @Override +- public long getDuration() { +- return this.accumulatedDuration; +- } +- +- @Override +- public long getMaxDuration() { +- return this.maxDuration; +- } +- +- @Override +- public long getCount() { +- return this.count; +- } +- +- @Override +- public Object2LongMap getCounters() { +- return Object2LongMaps.unmodifiable(this.counters); +- } +- } +-} +diff --git a/net/minecraft/util/profiling/ContinuousProfiler.java b/net/minecraft/util/profiling/ContinuousProfiler.java +deleted file mode 100644 +index e96949cc279aeb4ef670ec07b6ec2407da2f68bd..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/ContinuousProfiler.java ++++ /dev/null +@@ -1,35 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import java.util.function.IntSupplier; +-import java.util.function.LongSupplier; +- +-public class ContinuousProfiler { +- private final LongSupplier realTime; +- private final IntSupplier tickCount; +- private ProfileCollector profiler = InactiveProfiler.INSTANCE; +- +- public ContinuousProfiler(LongSupplier realTime, IntSupplier tickCount) { +- this.realTime = realTime; +- this.tickCount = tickCount; +- } +- +- public boolean isEnabled() { +- return this.profiler != InactiveProfiler.INSTANCE; +- } +- +- public void disable() { +- this.profiler = InactiveProfiler.INSTANCE; +- } +- +- public void enable() { +- this.profiler = new ActiveProfiler(this.realTime, this.tickCount, true); +- } +- +- public ProfilerFiller getFiller() { +- return this.profiler; +- } +- +- public ProfileResults getResults() { +- return this.profiler.getResults(); +- } +-} +diff --git a/net/minecraft/util/profiling/EmptyProfileResults.java b/net/minecraft/util/profiling/EmptyProfileResults.java +deleted file mode 100644 +index 76930ff8c88c4cfc687d09653720ca05e87bec1a..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/EmptyProfileResults.java ++++ /dev/null +@@ -1,47 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import java.nio.file.Path; +-import java.util.Collections; +-import java.util.List; +- +-public class EmptyProfileResults implements ProfileResults { +- public static final EmptyProfileResults EMPTY = new EmptyProfileResults(); +- +- private EmptyProfileResults() { +- } +- +- @Override +- public List getTimes(String sectionPath) { +- return Collections.emptyList(); +- } +- +- @Override +- public boolean saveResults(Path path) { +- return false; +- } +- +- @Override +- public long getStartTimeNano() { +- return 0L; +- } +- +- @Override +- public int getStartTimeTicks() { +- return 0; +- } +- +- @Override +- public long getEndTimeNano() { +- return 0L; +- } +- +- @Override +- public int getEndTimeTicks() { +- return 0; +- } +- +- @Override +- public String getProfilerResults() { +- return ""; +- } +-} +diff --git a/net/minecraft/util/profiling/FilledProfileResults.java b/net/minecraft/util/profiling/FilledProfileResults.java +deleted file mode 100644 +index 706e39e04e72a71f9c271a2a26cc6e7613b7c3ba..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/FilledProfileResults.java ++++ /dev/null +@@ -1,313 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import com.google.common.base.Splitter; +-import com.google.common.collect.Lists; +-import com.google.common.collect.Maps; +-import com.mojang.logging.LogUtils; +-import it.unimi.dsi.fastutil.objects.Object2LongMap; +-import it.unimi.dsi.fastutil.objects.Object2LongMaps; +-import java.io.Writer; +-import java.nio.charset.StandardCharsets; +-import java.nio.file.Files; +-import java.nio.file.Path; +-import java.util.Collections; +-import java.util.Comparator; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Locale; +-import java.util.Map; +-import java.util.Map.Entry; +-import net.minecraft.ReportType; +-import net.minecraft.SharedConstants; +-import org.apache.commons.io.IOUtils; +-import org.apache.commons.lang3.ObjectUtils; +-import org.slf4j.Logger; +- +-public class FilledProfileResults implements ProfileResults { +- private static final Logger LOGGER = LogUtils.getLogger(); +- private static final ProfilerPathEntry EMPTY = new ProfilerPathEntry() { +- @Override +- public long getDuration() { +- return 0L; +- } +- +- @Override +- public long getMaxDuration() { +- return 0L; +- } +- +- @Override +- public long getCount() { +- return 0L; +- } +- +- @Override +- public Object2LongMap getCounters() { +- return Object2LongMaps.emptyMap(); +- } +- }; +- private static final Splitter SPLITTER = Splitter.on('\u001e'); +- private static final Comparator> COUNTER_ENTRY_COMPARATOR = Entry.comparingByValue( +- Comparator.comparingLong(counterCollector -> counterCollector.totalValue) +- ) +- .reversed(); +- private final Map entries; +- private final long startTimeNano; +- private final int startTimeTicks; +- private final long endTimeNano; +- private final int endTimeTicks; +- private final int tickDuration; +- +- public FilledProfileResults(Map entries, long startTimeNano, int startTimeTicks, long endTimeNano, int endTimeTicks) { +- this.entries = entries; +- this.startTimeNano = startTimeNano; +- this.startTimeTicks = startTimeTicks; +- this.endTimeNano = endTimeNano; +- this.endTimeTicks = endTimeTicks; +- this.tickDuration = endTimeTicks - startTimeTicks; +- } +- +- private ProfilerPathEntry getEntry(String key) { +- ProfilerPathEntry profilerPathEntry = this.entries.get(key); +- return profilerPathEntry != null ? profilerPathEntry : EMPTY; +- } +- +- @Override +- public List getTimes(String sectionPath) { +- String string = sectionPath; +- ProfilerPathEntry entry = this.getEntry("root"); +- long duration = entry.getDuration(); +- ProfilerPathEntry entry1 = this.getEntry(sectionPath); +- long duration1 = entry1.getDuration(); +- long count = entry1.getCount(); +- List list = Lists.newArrayList(); +- if (!sectionPath.isEmpty()) { +- sectionPath = sectionPath + "\u001e"; +- } +- +- long l = 0L; +- +- for (String string1 : this.entries.keySet()) { +- if (isDirectChild(sectionPath, string1)) { +- l += this.getEntry(string1).getDuration(); +- } +- } +- +- float f = (float)l; +- if (l < duration1) { +- l = duration1; +- } +- +- if (duration < l) { +- duration = l; +- } +- +- for (String string2 : this.entries.keySet()) { +- if (isDirectChild(sectionPath, string2)) { +- ProfilerPathEntry entry2 = this.getEntry(string2); +- long duration2 = entry2.getDuration(); +- double d = duration2 * 100.0 / l; +- double d1 = duration2 * 100.0 / duration; +- String sub = string2.substring(sectionPath.length()); +- list.add(new ResultField(sub, d, d1, entry2.getCount())); +- } +- } +- +- if ((float)l > f) { +- list.add(new ResultField("unspecified", ((float)l - f) * 100.0 / l, ((float)l - f) * 100.0 / duration, count)); +- } +- +- Collections.sort(list); +- list.add(0, new ResultField(string, 100.0, l * 100.0 / duration, count)); +- return list; +- } +- +- private static boolean isDirectChild(String sectionPath, String entry) { +- return entry.length() > sectionPath.length() && entry.startsWith(sectionPath) && entry.indexOf(30, sectionPath.length() + 1) < 0; +- } +- +- private Map getCounterValues() { +- Map map = Maps.newTreeMap(); +- this.entries +- .forEach( +- (string, profilerPathEntry) -> { +- Object2LongMap counters = profilerPathEntry.getCounters(); +- if (!counters.isEmpty()) { +- List parts = SPLITTER.splitToList(string); +- counters.forEach( +- (string1, _long) -> map.computeIfAbsent(string1, string2 -> new FilledProfileResults.CounterCollector()) +- .addValue(parts.iterator(), _long) +- ); +- } +- } +- ); +- return map; +- } +- +- @Override +- public long getStartTimeNano() { +- return this.startTimeNano; +- } +- +- @Override +- public int getStartTimeTicks() { +- return this.startTimeTicks; +- } +- +- @Override +- public long getEndTimeNano() { +- return this.endTimeNano; +- } +- +- @Override +- public int getEndTimeTicks() { +- return this.endTimeTicks; +- } +- +- @Override +- public boolean saveResults(Path path) { +- Writer writer = null; +- +- boolean var4; +- try { +- Files.createDirectories(path.getParent()); +- writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8); +- writer.write(this.getProfilerResults(this.getNanoDuration(), this.getTickDuration())); +- return true; +- } catch (Throwable var8) { +- LOGGER.error("Could not save profiler results to {}", path, var8); +- var4 = false; +- } finally { +- IOUtils.closeQuietly(writer); +- } +- +- return var4; +- } +- +- protected String getProfilerResults(long timeSpan, int tickSpan) { +- StringBuilder stringBuilder = new StringBuilder(); +- ReportType.PROFILE.appendHeader(stringBuilder, List.of()); +- stringBuilder.append("Version: ").append(SharedConstants.getCurrentVersion().getId()).append('\n'); +- stringBuilder.append("Time span: ").append(timeSpan / 1000000L).append(" ms\n"); +- stringBuilder.append("Tick span: ").append(tickSpan).append(" ticks\n"); +- stringBuilder.append("// This is approximately ") +- .append(String.format(Locale.ROOT, "%.2f", tickSpan / ((float)timeSpan / 1.0E9F))) +- .append(" ticks per second. It should be ") +- .append(20) +- .append(" ticks per second\n\n"); +- stringBuilder.append("--- BEGIN PROFILE DUMP ---\n\n"); +- this.appendProfilerResults(0, "root", stringBuilder); +- stringBuilder.append("--- END PROFILE DUMP ---\n\n"); +- Map counterValues = this.getCounterValues(); +- if (!counterValues.isEmpty()) { +- stringBuilder.append("--- BEGIN COUNTER DUMP ---\n\n"); +- this.appendCounters(counterValues, stringBuilder, tickSpan); +- stringBuilder.append("--- END COUNTER DUMP ---\n\n"); +- } +- +- return stringBuilder.toString(); +- } +- +- @Override +- public String getProfilerResults() { +- StringBuilder stringBuilder = new StringBuilder(); +- this.appendProfilerResults(0, "root", stringBuilder); +- return stringBuilder.toString(); +- } +- +- private static StringBuilder indentLine(StringBuilder builder, int indents) { +- builder.append(String.format(Locale.ROOT, "[%02d] ", indents)); +- +- for (int i = 0; i < indents; i++) { +- builder.append("| "); +- } +- +- return builder; +- } +- +- private void appendProfilerResults(int depth, String sectionPath, StringBuilder builder) { +- List times = this.getTimes(sectionPath); +- Object2LongMap counters = ObjectUtils.firstNonNull(this.entries.get(sectionPath), EMPTY).getCounters(); +- counters.forEach( +- (string, _long) -> indentLine(builder, depth) +- .append('#') +- .append(string) +- .append(' ') +- .append(_long) +- .append('/') +- .append(_long / this.tickDuration) +- .append('\n') +- ); +- if (times.size() >= 3) { +- for (int i = 1; i < times.size(); i++) { +- ResultField resultField = times.get(i); +- indentLine(builder, depth) +- .append(resultField.name) +- .append('(') +- .append(resultField.count) +- .append('/') +- .append(String.format(Locale.ROOT, "%.0f", (float)resultField.count / this.tickDuration)) +- .append(')') +- .append(" - ") +- .append(String.format(Locale.ROOT, "%.2f", resultField.percentage)) +- .append("%/") +- .append(String.format(Locale.ROOT, "%.2f", resultField.globalPercentage)) +- .append("%\n"); +- if (!"unspecified".equals(resultField.name)) { +- try { +- this.appendProfilerResults(depth + 1, sectionPath + "\u001e" + resultField.name, builder); +- } catch (Exception var9) { +- builder.append("[[ EXCEPTION ").append(var9).append(" ]]"); +- } +- } +- } +- } +- } +- +- private void appendCounterResults(int indents, String name, FilledProfileResults.CounterCollector collector, int tickSpan, StringBuilder builder) { +- indentLine(builder, indents) +- .append(name) +- .append(" total:") +- .append(collector.selfValue) +- .append('/') +- .append(collector.totalValue) +- .append(" average: ") +- .append(collector.selfValue / tickSpan) +- .append('/') +- .append(collector.totalValue / tickSpan) +- .append('\n'); +- collector.children +- .entrySet() +- .stream() +- .sorted(COUNTER_ENTRY_COMPARATOR) +- .forEach(entry -> this.appendCounterResults(indents + 1, entry.getKey(), entry.getValue(), tickSpan, builder)); +- } +- +- private void appendCounters(Map counters, StringBuilder builder, int tickSpan) { +- counters.forEach((string, counterCollector) -> { +- builder.append("-- Counter: ").append(string).append(" --\n"); +- this.appendCounterResults(0, "root", counterCollector.children.get("root"), tickSpan, builder); +- builder.append("\n\n"); +- }); +- } +- +- @Override +- public int getTickDuration() { +- return this.tickDuration; +- } +- +- static class CounterCollector { +- long selfValue; +- long totalValue; +- final Map children = Maps.newHashMap(); +- +- public void addValue(Iterator counters, long value) { +- this.totalValue += value; +- if (!counters.hasNext()) { +- this.selfValue += value; +- } else { +- this.children.computeIfAbsent(counters.next(), string -> new FilledProfileResults.CounterCollector()).addValue(counters, value); +- } +- } +- } +-} +diff --git a/net/minecraft/util/profiling/InactiveProfiler.java b/net/minecraft/util/profiling/InactiveProfiler.java +deleted file mode 100644 +index dbeb1117938b0f118250bc66d41676bc35a6aa1e..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/InactiveProfiler.java ++++ /dev/null +@@ -1,81 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import com.google.common.collect.ImmutableSet; +-import java.util.Set; +-import java.util.function.Supplier; +-import javax.annotation.Nullable; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import org.apache.commons.lang3.tuple.Pair; +- +-public class InactiveProfiler implements ProfileCollector { +- public static final InactiveProfiler INSTANCE = new InactiveProfiler(); +- +- private InactiveProfiler() { +- } +- +- @Override +- public void startTick() { +- } +- +- @Override +- public void endTick() { +- } +- +- @Override +- public void push(String name) { +- } +- +- @Override +- public void push(Supplier nameSupplier) { +- } +- +- @Override +- public void markForCharting(MetricCategory category) { +- } +- +- @Override +- public void pop() { +- } +- +- @Override +- public void popPush(String name) { +- } +- +- @Override +- public void popPush(Supplier nameSupplier) { +- } +- +- @Override +- public Zone zone(String name) { +- return Zone.INACTIVE; +- } +- +- @Override +- public Zone zone(Supplier name) { +- return Zone.INACTIVE; +- } +- +- @Override +- public void incrementCounter(String counterName, int increment) { +- } +- +- @Override +- public void incrementCounter(Supplier counterNameSupplier, int increment) { +- } +- +- @Override +- public ProfileResults getResults() { +- return EmptyProfileResults.EMPTY; +- } +- +- @Nullable +- @Override +- public ActiveProfiler.PathEntry getEntry(String entryId) { +- return null; +- } +- +- @Override +- public Set> getChartedPaths() { +- return ImmutableSet.of(); +- } +-} +diff --git a/net/minecraft/util/profiling/ProfileCollector.java b/net/minecraft/util/profiling/ProfileCollector.java +deleted file mode 100644 +index 7ea05ee86d9afe648a5301bdd9fcff9b91e1ba36..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/ProfileCollector.java ++++ /dev/null +@@ -1,15 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import java.util.Set; +-import javax.annotation.Nullable; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import org.apache.commons.lang3.tuple.Pair; +- +-public interface ProfileCollector extends ProfilerFiller { +- ProfileResults getResults(); +- +- @Nullable +- ActiveProfiler.PathEntry getEntry(String entryId); +- +- Set> getChartedPaths(); +-} +diff --git a/net/minecraft/util/profiling/ProfileResults.java b/net/minecraft/util/profiling/ProfileResults.java +deleted file mode 100644 +index 47d68f2b8d0dbe2f0e268c3d00eec434d8964f7a..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/ProfileResults.java ++++ /dev/null +@@ -1,34 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import java.nio.file.Path; +-import java.util.List; +- +-public interface ProfileResults { +- char PATH_SEPARATOR = '\u001e'; +- +- List getTimes(String sectionPath); +- +- boolean saveResults(Path path); +- +- long getStartTimeNano(); +- +- int getStartTimeTicks(); +- +- long getEndTimeNano(); +- +- int getEndTimeTicks(); +- +- default long getNanoDuration() { +- return this.getEndTimeNano() - this.getStartTimeNano(); +- } +- +- default int getTickDuration() { +- return this.getEndTimeTicks() - this.getStartTimeTicks(); +- } +- +- String getProfilerResults(); +- +- static String demanglePath(String path) { +- return path.replace('\u001e', '.'); +- } +-} +diff --git a/net/minecraft/util/profiling/Profiler.java b/net/minecraft/util/profiling/Profiler.java +deleted file mode 100644 +index cbd57d68e169ed044f325a776075da78b473b6f3..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/Profiler.java ++++ /dev/null +@@ -1,58 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import com.mojang.jtracy.TracyClient; +-import java.util.Objects; +-import java.util.concurrent.atomic.AtomicInteger; +- +-public final class Profiler { +- private static final ThreadLocal TRACY_FILLER = ThreadLocal.withInitial(TracyZoneFiller::new); +- private static final ThreadLocal ACTIVE = new ThreadLocal<>(); +- private static final AtomicInteger ACTIVE_COUNT = new AtomicInteger(); +- +- private Profiler() { +- } +- +- public static Profiler.Scope use(ProfilerFiller profiler) { +- startUsing(profiler); +- return Profiler::stopUsing; +- } +- +- private static void startUsing(ProfilerFiller profiler) { +- if (ACTIVE.get() != null) { +- throw new IllegalStateException("Profiler is already active"); +- } else { +- ProfilerFiller profilerFiller = decorateFiller(profiler); +- ACTIVE.set(profilerFiller); +- ACTIVE_COUNT.incrementAndGet(); +- profilerFiller.startTick(); +- } +- } +- +- private static void stopUsing() { +- ProfilerFiller profilerFiller = ACTIVE.get(); +- if (profilerFiller == null) { +- throw new IllegalStateException("Profiler was not active"); +- } else { +- ACTIVE.remove(); +- ACTIVE_COUNT.decrementAndGet(); +- profilerFiller.endTick(); +- } +- } +- +- private static ProfilerFiller decorateFiller(ProfilerFiller filler) { +- return ProfilerFiller.combine(getDefaultFiller(), filler); +- } +- +- public static ProfilerFiller get() { +- return ACTIVE_COUNT.get() == 0 ? getDefaultFiller() : Objects.requireNonNullElseGet(ACTIVE.get(), Profiler::getDefaultFiller); +- } +- +- private static ProfilerFiller getDefaultFiller() { +- return (ProfilerFiller)(TracyClient.isAvailable() ? TRACY_FILLER.get() : InactiveProfiler.INSTANCE); +- } +- +- public interface Scope extends AutoCloseable { +- @Override +- void close(); +- } +-} +diff --git a/net/minecraft/util/profiling/ProfilerFiller.java b/net/minecraft/util/profiling/ProfilerFiller.java +deleted file mode 100644 +index aed01a8c918361d2302ba5219117e32aac98e19d..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/ProfilerFiller.java ++++ /dev/null +@@ -1,151 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import java.util.function.Supplier; +-import net.minecraft.util.profiling.metrics.MetricCategory; +- +-public interface ProfilerFiller { +- String ROOT = "root"; +- +- void startTick(); +- +- void endTick(); +- +- void push(String name); +- +- void push(Supplier nameSupplier); +- +- void pop(); +- +- void popPush(String name); +- +- void popPush(Supplier nameSupplier); +- +- default void addZoneText(String text) { +- } +- +- default void addZoneValue(long value) { +- } +- +- default void setZoneColor(int color) { +- } +- +- default Zone zone(String name) { +- this.push(name); +- return new Zone(this); +- } +- +- default Zone zone(Supplier name) { +- this.push(name); +- return new Zone(this); +- } +- +- void markForCharting(MetricCategory category); +- +- default void incrementCounter(String entryId) { +- this.incrementCounter(entryId, 1); +- } +- +- void incrementCounter(String counterName, int increment); +- +- default void incrementCounter(Supplier entryIdSupplier) { +- this.incrementCounter(entryIdSupplier, 1); +- } +- +- void incrementCounter(Supplier counterNameSupplier, int increment); +- +- static ProfilerFiller combine(ProfilerFiller first, ProfilerFiller second) { +- if (first == InactiveProfiler.INSTANCE) { +- return second; +- } else { +- return (ProfilerFiller)(second == InactiveProfiler.INSTANCE ? first : new ProfilerFiller.CombinedProfileFiller(first, second)); +- } +- } +- +- public static class CombinedProfileFiller implements ProfilerFiller { +- private final ProfilerFiller first; +- private final ProfilerFiller second; +- +- public CombinedProfileFiller(ProfilerFiller first, ProfilerFiller second) { +- this.first = first; +- this.second = second; +- } +- +- @Override +- public void startTick() { +- this.first.startTick(); +- this.second.startTick(); +- } +- +- @Override +- public void endTick() { +- this.first.endTick(); +- this.second.endTick(); +- } +- +- @Override +- public void push(String name) { +- this.first.push(name); +- this.second.push(name); +- } +- +- @Override +- public void push(Supplier nameSupplier) { +- this.first.push(nameSupplier); +- this.second.push(nameSupplier); +- } +- +- @Override +- public void markForCharting(MetricCategory category) { +- this.first.markForCharting(category); +- this.second.markForCharting(category); +- } +- +- @Override +- public void pop() { +- this.first.pop(); +- this.second.pop(); +- } +- +- @Override +- public void popPush(String name) { +- this.first.popPush(name); +- this.second.popPush(name); +- } +- +- @Override +- public void popPush(Supplier nameSupplier) { +- this.first.popPush(nameSupplier); +- this.second.popPush(nameSupplier); +- } +- +- @Override +- public void incrementCounter(String counterName, int increment) { +- this.first.incrementCounter(counterName, increment); +- this.second.incrementCounter(counterName, increment); +- } +- +- @Override +- public void incrementCounter(Supplier counterNameSupplier, int increment) { +- this.first.incrementCounter(counterNameSupplier, increment); +- this.second.incrementCounter(counterNameSupplier, increment); +- } +- +- @Override +- public void addZoneText(String text) { +- this.first.addZoneText(text); +- this.second.addZoneText(text); +- } +- +- @Override +- public void addZoneValue(long value) { +- this.first.addZoneValue(value); +- this.second.addZoneValue(value); +- } +- +- @Override +- public void setZoneColor(int color) { +- this.first.setZoneColor(color); +- this.second.setZoneColor(color); +- } +- } +-} +diff --git a/net/minecraft/util/profiling/ProfilerPathEntry.java b/net/minecraft/util/profiling/ProfilerPathEntry.java +deleted file mode 100644 +index c073262f663309e6f73e67b303927b3996ea0c16..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/ProfilerPathEntry.java ++++ /dev/null +@@ -1,13 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import it.unimi.dsi.fastutil.objects.Object2LongMap; +- +-public interface ProfilerPathEntry { +- long getDuration(); +- +- long getMaxDuration(); +- +- long getCount(); +- +- Object2LongMap getCounters(); +-} +diff --git a/net/minecraft/util/profiling/ResultField.java b/net/minecraft/util/profiling/ResultField.java +deleted file mode 100644 +index 82aef3d962e8ee6bb9c49a5655a5db49c331b022..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/ResultField.java ++++ /dev/null +@@ -1,28 +0,0 @@ +-package net.minecraft.util.profiling; +- +-public final class ResultField implements Comparable { +- public final double percentage; +- public final double globalPercentage; +- public final long count; +- public final String name; +- +- public ResultField(String name, double percentage, double globalPercentage, long count) { +- this.name = name; +- this.percentage = percentage; +- this.globalPercentage = globalPercentage; +- this.count = count; +- } +- +- @Override +- public int compareTo(ResultField resultField) { +- if (resultField.percentage < this.percentage) { +- return -1; +- } else { +- return resultField.percentage > this.percentage ? 1 : resultField.name.compareTo(this.name); +- } +- } +- +- public int getColor() { +- return (this.name.hashCode() & 11184810) + 4473924; +- } +-} +diff --git a/net/minecraft/util/profiling/SingleTickProfiler.java b/net/minecraft/util/profiling/SingleTickProfiler.java +deleted file mode 100644 +index 6ead9eb534103a001427ee5bec84cebe7ae97162..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/SingleTickProfiler.java ++++ /dev/null +@@ -1,50 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import com.mojang.logging.LogUtils; +-import java.io.File; +-import java.util.function.LongSupplier; +-import javax.annotation.Nullable; +-import net.minecraft.Util; +-import org.slf4j.Logger; +- +-public class SingleTickProfiler { +- private static final Logger LOGGER = LogUtils.getLogger(); +- private final LongSupplier realTime; +- private final long saveThreshold; +- private int tick; +- private final File location; +- private ProfileCollector profiler = InactiveProfiler.INSTANCE; +- +- public SingleTickProfiler(LongSupplier realTime, String location, long saveThreshold) { +- this.realTime = realTime; +- this.location = new File("debug", location); +- this.saveThreshold = saveThreshold; +- } +- +- public ProfilerFiller startTick() { +- this.profiler = new ActiveProfiler(this.realTime, () -> this.tick, false); +- this.tick++; +- return this.profiler; +- } +- +- public void endTick() { +- if (this.profiler != InactiveProfiler.INSTANCE) { +- ProfileResults results = this.profiler.getResults(); +- this.profiler = InactiveProfiler.INSTANCE; +- if (results.getNanoDuration() >= this.saveThreshold) { +- File file = new File(this.location, "tick-results-" + Util.getFilenameFormattedDateTime() + ".txt"); +- results.saveResults(file.toPath()); +- LOGGER.info("Recorded long tick -- wrote info to: {}", file.getAbsolutePath()); +- } +- } +- } +- +- @Nullable +- public static SingleTickProfiler createTickProfiler(String name) { +- return null; +- } +- +- public static ProfilerFiller decorateFiller(ProfilerFiller profiler, @Nullable SingleTickProfiler singleTickProfiler) { +- return singleTickProfiler != null ? ProfilerFiller.combine(singleTickProfiler.startTick(), profiler) : profiler; +- } +-} +diff --git a/net/minecraft/util/profiling/TracyZoneFiller.java b/net/minecraft/util/profiling/TracyZoneFiller.java +deleted file mode 100644 +index 4f855149f2a06379ecdc7d9218e40ef4887e1d6f..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/TracyZoneFiller.java ++++ /dev/null +@@ -1,140 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import com.mojang.jtracy.Plot; +-import com.mojang.jtracy.TracyClient; +-import com.mojang.logging.LogUtils; +-import java.lang.StackWalker.Option; +-import java.lang.StackWalker.StackFrame; +-import java.util.ArrayList; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Set; +-import java.util.function.Supplier; +-import net.minecraft.SharedConstants; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import org.slf4j.Logger; +- +-public class TracyZoneFiller implements ProfilerFiller { +- private static final Logger LOGGER = LogUtils.getLogger(); +- private static final StackWalker STACK_WALKER = StackWalker.getInstance(Set.of(Option.RETAIN_CLASS_REFERENCE), 5); +- private final List activeZones = new ArrayList<>(); +- private final Map plots = new HashMap<>(); +- private final String name = Thread.currentThread().getName(); +- +- @Override +- public void startTick() { +- } +- +- @Override +- public void endTick() { +- for (TracyZoneFiller.PlotAndValue plotAndValue : this.plots.values()) { +- plotAndValue.set(0); +- } +- } +- +- @Override +- public void push(String name) { +- String string = ""; +- String string1 = ""; +- int i = 0; +- if (SharedConstants.IS_RUNNING_IN_IDE) { +- Optional optional = STACK_WALKER.walk( +- stream -> stream.filter( +- stackFrame1 -> stackFrame1.getDeclaringClass() != TracyZoneFiller.class +- && stackFrame1.getDeclaringClass() != ProfilerFiller.CombinedProfileFiller.class +- ) +- .findFirst() +- ); +- if (optional.isPresent()) { +- StackFrame stackFrame = optional.get(); +- string = stackFrame.getMethodName(); +- string1 = stackFrame.getFileName(); +- i = stackFrame.getLineNumber(); +- } +- } +- +- com.mojang.jtracy.Zone zone = TracyClient.beginZone(name, string, string1, i); +- this.activeZones.add(zone); +- } +- +- @Override +- public void push(Supplier nameSupplier) { +- this.push(nameSupplier.get()); +- } +- +- @Override +- public void pop() { +- if (this.activeZones.isEmpty()) { +- LOGGER.error("Tried to pop one too many times! Mismatched push() and pop()?"); +- } else { +- com.mojang.jtracy.Zone zone = this.activeZones.removeLast(); +- zone.close(); +- } +- } +- +- @Override +- public void popPush(String name) { +- this.pop(); +- this.push(name); +- } +- +- @Override +- public void popPush(Supplier nameSupplier) { +- this.pop(); +- this.push(nameSupplier.get()); +- } +- +- @Override +- public void markForCharting(MetricCategory category) { +- } +- +- @Override +- public void incrementCounter(String counterName, int increment) { +- this.plots.computeIfAbsent(counterName, string -> new TracyZoneFiller.PlotAndValue(this.name + " " + counterName)).add(increment); +- } +- +- @Override +- public void incrementCounter(Supplier counterNameSupplier, int increment) { +- this.incrementCounter(counterNameSupplier.get(), increment); +- } +- +- private com.mojang.jtracy.Zone activeZone() { +- return this.activeZones.getLast(); +- } +- +- @Override +- public void addZoneText(String text) { +- this.activeZone().addText(text); +- } +- +- @Override +- public void addZoneValue(long value) { +- this.activeZone().addValue(value); +- } +- +- @Override +- public void setZoneColor(int color) { +- this.activeZone().setColor(color); +- } +- +- static final class PlotAndValue { +- private final Plot plot; +- private int value; +- +- PlotAndValue(String name) { +- this.plot = TracyClient.createPlot(name); +- this.value = 0; +- } +- +- void set(int value) { +- this.value = value; +- this.plot.setValue(value); +- } +- +- void add(int value) { +- this.set(this.value + value); +- } +- } +-} +diff --git a/net/minecraft/util/profiling/Zone.java b/net/minecraft/util/profiling/Zone.java +deleted file mode 100644 +index 01bd7726e89f2e1b3c16a39b18385fcbb8716ebc..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/Zone.java ++++ /dev/null +@@ -1,53 +0,0 @@ +-package net.minecraft.util.profiling; +- +-import java.util.function.Supplier; +-import javax.annotation.Nullable; +- +-public class Zone implements AutoCloseable { +- public static final Zone INACTIVE = new Zone(null); +- @Nullable +- private final ProfilerFiller profiler; +- +- Zone(@Nullable ProfilerFiller profiler) { +- this.profiler = profiler; +- } +- +- public Zone addText(String text) { +- if (this.profiler != null) { +- this.profiler.addZoneText(text); +- } +- +- return this; +- } +- +- public Zone addText(Supplier text) { +- if (this.profiler != null) { +- this.profiler.addZoneText(text.get()); +- } +- +- return this; +- } +- +- public Zone addValue(long value) { +- if (this.profiler != null) { +- this.profiler.addZoneValue(value); +- } +- +- return this; +- } +- +- public Zone setColor(int color) { +- if (this.profiler != null) { +- this.profiler.setZoneColor(color); +- } +- +- return this; +- } +- +- @Override +- public void close() { +- if (this.profiler != null) { +- this.profiler.pop(); +- } +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/MetricCategory.java b/net/minecraft/util/profiling/metrics/MetricCategory.java +deleted file mode 100644 +index 6bf739dc8f427bd4368431aa060a06845141fedb..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/MetricCategory.java ++++ /dev/null +@@ -1,23 +0,0 @@ +-package net.minecraft.util.profiling.metrics; +- +-public enum MetricCategory { +- PATH_FINDING("pathfinding"), +- EVENT_LOOPS("event-loops"), +- CONSECUTIVE_EXECUTORS("consecutive-executors"), +- TICK_LOOP("ticking"), +- JVM("jvm"), +- CHUNK_RENDERING("chunk rendering"), +- CHUNK_RENDERING_DISPATCHING("chunk rendering dispatching"), +- CPU("cpu"), +- GPU("gpu"); +- +- private final String description; +- +- private MetricCategory(final String description) { +- this.description = description; +- } +- +- public String getDescription() { +- return this.description; +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/MetricSampler.java b/net/minecraft/util/profiling/metrics/MetricSampler.java +deleted file mode 100644 +index 5fa1d836bc9326a461331ff19e234e4dd3b15df5..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/MetricSampler.java ++++ /dev/null +@@ -1,213 +0,0 @@ +-package net.minecraft.util.profiling.metrics; +- +-import io.netty.buffer.ByteBuf; +-import io.netty.buffer.ByteBufAllocator; +-import it.unimi.dsi.fastutil.ints.Int2DoubleMap; +-import it.unimi.dsi.fastutil.ints.Int2DoubleOpenHashMap; +-import java.util.Locale; +-import java.util.function.Consumer; +-import java.util.function.DoubleSupplier; +-import java.util.function.ToDoubleFunction; +-import javax.annotation.Nullable; +- +-public class MetricSampler { +- private final String name; +- private final MetricCategory category; +- private final DoubleSupplier sampler; +- private final ByteBuf ticks; +- private final ByteBuf values; +- private volatile boolean isRunning; +- @Nullable +- private final Runnable beforeTick; +- @Nullable +- final MetricSampler.ThresholdTest thresholdTest; +- private double currentValue; +- +- protected MetricSampler( +- String name, MetricCategory category, DoubleSupplier sampler, @Nullable Runnable beforeTick, @Nullable MetricSampler.ThresholdTest thresholdTest +- ) { +- this.name = name; +- this.category = category; +- this.beforeTick = beforeTick; +- this.sampler = sampler; +- this.thresholdTest = thresholdTest; +- this.values = ByteBufAllocator.DEFAULT.buffer(); +- this.ticks = ByteBufAllocator.DEFAULT.buffer(); +- this.isRunning = true; +- } +- +- public static MetricSampler create(String name, MetricCategory category, DoubleSupplier sampler) { +- return new MetricSampler(name, category, sampler, null, null); +- } +- +- public static MetricSampler create(String name, MetricCategory category, T context, ToDoubleFunction sampler) { +- return builder(name, category, sampler, context).build(); +- } +- +- public static MetricSampler.MetricSamplerBuilder builder(String name, MetricCategory category, ToDoubleFunction sampler, T context) { +- return new MetricSampler.MetricSamplerBuilder<>(name, category, sampler, context); +- } +- +- public void onStartTick() { +- if (!this.isRunning) { +- throw new IllegalStateException("Not running"); +- } else { +- if (this.beforeTick != null) { +- this.beforeTick.run(); +- } +- } +- } +- +- public void onEndTick(int tickTime) { +- this.verifyRunning(); +- this.currentValue = this.sampler.getAsDouble(); +- this.values.writeDouble(this.currentValue); +- this.ticks.writeInt(tickTime); +- } +- +- public void onFinished() { +- this.verifyRunning(); +- this.values.release(); +- this.ticks.release(); +- this.isRunning = false; +- } +- +- private void verifyRunning() { +- if (!this.isRunning) { +- throw new IllegalStateException(String.format(Locale.ROOT, "Sampler for metric %s not started!", this.name)); +- } +- } +- +- DoubleSupplier getSampler() { +- return this.sampler; +- } +- +- public String getName() { +- return this.name; +- } +- +- public MetricCategory getCategory() { +- return this.category; +- } +- +- public MetricSampler.SamplerResult result() { +- Int2DoubleMap map = new Int2DoubleOpenHashMap(); +- int i = Integer.MIN_VALUE; +- int i1 = Integer.MIN_VALUE; +- +- while (this.values.isReadable(8)) { +- int _int = this.ticks.readInt(); +- if (i == Integer.MIN_VALUE) { +- i = _int; +- } +- +- map.put(_int, this.values.readDouble()); +- i1 = _int; +- } +- +- return new MetricSampler.SamplerResult(i, i1, map); +- } +- +- public boolean triggersThreshold() { +- return this.thresholdTest != null && this.thresholdTest.test(this.currentValue); +- } +- +- @Override +- public boolean equals(Object other) { +- if (this == other) { +- return true; +- } else if (other != null && this.getClass() == other.getClass()) { +- MetricSampler metricSampler = (MetricSampler)other; +- return this.name.equals(metricSampler.name) && this.category.equals(metricSampler.category); +- } else { +- return false; +- } +- } +- +- @Override +- public int hashCode() { +- return this.name.hashCode(); +- } +- +- public static class MetricSamplerBuilder { +- private final String name; +- private final MetricCategory category; +- private final DoubleSupplier sampler; +- private final T context; +- @Nullable +- private Runnable beforeTick; +- @Nullable +- private MetricSampler.ThresholdTest thresholdTest; +- +- public MetricSamplerBuilder(String name, MetricCategory category, ToDoubleFunction sampler, T context) { +- this.name = name; +- this.category = category; +- this.sampler = () -> sampler.applyAsDouble(context); +- this.context = context; +- } +- +- public MetricSampler.MetricSamplerBuilder withBeforeTick(Consumer beforeTick) { +- this.beforeTick = () -> beforeTick.accept(this.context); +- return this; +- } +- +- public MetricSampler.MetricSamplerBuilder withThresholdAlert(MetricSampler.ThresholdTest thresholdTest) { +- this.thresholdTest = thresholdTest; +- return this; +- } +- +- public MetricSampler build() { +- return new MetricSampler(this.name, this.category, this.sampler, this.beforeTick, this.thresholdTest); +- } +- } +- +- public static class SamplerResult { +- private final Int2DoubleMap recording; +- private final int firstTick; +- private final int lastTick; +- +- public SamplerResult(int firstTick, int lastTick, Int2DoubleMap recording) { +- this.firstTick = firstTick; +- this.lastTick = lastTick; +- this.recording = recording; +- } +- +- public double valueAtTick(int tick) { +- return this.recording.get(tick); +- } +- +- public int getFirstTick() { +- return this.firstTick; +- } +- +- public int getLastTick() { +- return this.lastTick; +- } +- } +- +- public interface ThresholdTest { +- boolean test(double value); +- } +- +- public static class ValueIncreasedByPercentage implements MetricSampler.ThresholdTest { +- private final float percentageIncreaseThreshold; +- private double previousValue = Double.MIN_VALUE; +- +- public ValueIncreasedByPercentage(float percentageIncreaseThreshold) { +- this.percentageIncreaseThreshold = percentageIncreaseThreshold; +- } +- +- @Override +- public boolean test(double value) { +- boolean flag; +- if (this.previousValue != Double.MIN_VALUE && !(value <= this.previousValue)) { +- flag = (value - this.previousValue) / this.previousValue >= this.percentageIncreaseThreshold; +- } else { +- flag = false; +- } +- +- this.previousValue = value; +- return flag; +- } +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/MetricsRegistry.java b/net/minecraft/util/profiling/metrics/MetricsRegistry.java +deleted file mode 100644 +index 9b6a6aa2e94ceffc014194d218a36925a54e7abc..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/MetricsRegistry.java ++++ /dev/null +@@ -1,85 +0,0 @@ +-package net.minecraft.util.profiling.metrics; +- +-import java.util.List; +-import java.util.Map; +-import java.util.Objects; +-import java.util.WeakHashMap; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; +- +-public class MetricsRegistry { +- public static final MetricsRegistry INSTANCE = new MetricsRegistry(); +- private final WeakHashMap measuredInstances = new WeakHashMap<>(); +- +- private MetricsRegistry() { +- } +- +- public void add(ProfilerMeasured key) { +- this.measuredInstances.put(key, null); +- } +- +- public List getRegisteredSamplers() { +- Map> map = this.measuredInstances +- .keySet() +- .stream() +- .flatMap(profilerMeasured -> profilerMeasured.profiledMetrics().stream()) +- .collect(Collectors.groupingBy(MetricSampler::getName)); +- return aggregateDuplicates(map); +- } +- +- private static List aggregateDuplicates(Map> samplers) { +- return samplers.entrySet().stream().map(entry -> { +- String string = entry.getKey(); +- List list = entry.getValue(); +- return (MetricSampler)(list.size() > 1 ? new MetricsRegistry.AggregatedMetricSampler(string, list) : list.get(0)); +- }).collect(Collectors.toList()); +- } +- +- static class AggregatedMetricSampler extends MetricSampler { +- private final List delegates; +- +- AggregatedMetricSampler(String name, List delegates) { +- super(name, delegates.get(0).getCategory(), () -> averageValueFromDelegates(delegates), () -> beforeTick(delegates), thresholdTest(delegates)); +- this.delegates = delegates; +- } +- +- private static MetricSampler.ThresholdTest thresholdTest(List samplers) { +- return value -> samplers.stream().anyMatch(metricSampler -> metricSampler.thresholdTest != null && metricSampler.thresholdTest.test(value)); +- } +- +- private static void beforeTick(List samplers) { +- for (MetricSampler metricSampler : samplers) { +- metricSampler.onStartTick(); +- } +- } +- +- private static double averageValueFromDelegates(List samplers) { +- double d = 0.0; +- +- for (MetricSampler metricSampler : samplers) { +- d += metricSampler.getSampler().getAsDouble(); +- } +- +- return d / samplers.size(); +- } +- +- @Override +- public boolean equals(@Nullable Object other) { +- if (this == other) { +- return true; +- } else if (other == null || this.getClass() != other.getClass()) { +- return false; +- } else if (!super.equals(other)) { +- return false; +- } else { +- MetricsRegistry.AggregatedMetricSampler aggregatedMetricSampler = (MetricsRegistry.AggregatedMetricSampler)other; +- return this.delegates.equals(aggregatedMetricSampler.delegates); +- } +- } +- +- @Override +- public int hashCode() { +- return Objects.hash(super.hashCode(), this.delegates); +- } +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/MetricsSamplerProvider.java b/net/minecraft/util/profiling/metrics/MetricsSamplerProvider.java +deleted file mode 100644 +index a9bb6f4303e84f99d74a4285377cd9ea20ebed60..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/MetricsSamplerProvider.java ++++ /dev/null +@@ -1,9 +0,0 @@ +-package net.minecraft.util.profiling.metrics; +- +-import java.util.Set; +-import java.util.function.Supplier; +-import net.minecraft.util.profiling.ProfileCollector; +- +-public interface MetricsSamplerProvider { +- Set samplers(Supplier profiles); +-} +diff --git a/net/minecraft/util/profiling/metrics/ProfilerMeasured.java b/net/minecraft/util/profiling/metrics/ProfilerMeasured.java +deleted file mode 100644 +index 3057e9caa1936d114e07b3dfbd0dffd8aca1223c..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/ProfilerMeasured.java ++++ /dev/null +@@ -1,7 +0,0 @@ +-package net.minecraft.util.profiling.metrics; +- +-import java.util.List; +- +-public interface ProfilerMeasured { +- List profiledMetrics(); +-} +diff --git a/net/minecraft/util/profiling/metrics/package-info.java b/net/minecraft/util/profiling/metrics/package-info.java +deleted file mode 100644 +index 4cfaf358f9d7d07c8d58dc152a1c85d6c7824d57..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/package-info.java ++++ /dev/null +@@ -1,8 +0,0 @@ +-@ParametersAreNonnullByDefault +-@MethodsReturnNonnullByDefault +-@FieldsAreNonnullByDefault +-package net.minecraft.util.profiling.metrics; +- +-import javax.annotation.ParametersAreNonnullByDefault; +-import net.minecraft.FieldsAreNonnullByDefault; +-import net.minecraft.MethodsReturnNonnullByDefault; +diff --git a/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java b/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java +deleted file mode 100644 +index 0cb8ee7b629cb3db348d4c050a63a79fbdcc99b2..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java ++++ /dev/null +@@ -1,168 +0,0 @@ +-package net.minecraft.util.profiling.metrics.profiling; +- +-import com.google.common.collect.ImmutableSet; +-import com.google.common.collect.Lists; +-import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +-import java.nio.file.Path; +-import java.time.Instant; +-import java.util.Collection; +-import java.util.HashSet; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.concurrent.Executor; +-import java.util.concurrent.TimeUnit; +-import java.util.function.Consumer; +-import java.util.function.LongSupplier; +-import javax.annotation.Nullable; +-import net.minecraft.util.profiling.ActiveProfiler; +-import net.minecraft.util.profiling.ContinuousProfiler; +-import net.minecraft.util.profiling.EmptyProfileResults; +-import net.minecraft.util.profiling.InactiveProfiler; +-import net.minecraft.util.profiling.ProfileCollector; +-import net.minecraft.util.profiling.ProfileResults; +-import net.minecraft.util.profiling.ProfilerFiller; +-import net.minecraft.util.profiling.metrics.MetricSampler; +-import net.minecraft.util.profiling.metrics.MetricsSamplerProvider; +-import net.minecraft.util.profiling.metrics.storage.MetricsPersister; +-import net.minecraft.util.profiling.metrics.storage.RecordedDeviation; +- +-public class ActiveMetricsRecorder implements MetricsRecorder { +- public static final int PROFILING_MAX_DURATION_SECONDS = 10; +- @Nullable +- private static Consumer globalOnReportFinished = null; +- private final Map> deviationsBySampler = new Object2ObjectOpenHashMap<>(); +- private final ContinuousProfiler taskProfiler; +- private final Executor ioExecutor; +- private final MetricsPersister metricsPersister; +- private final Consumer onProfilingEnd; +- private final Consumer onReportFinished; +- private final MetricsSamplerProvider metricsSamplerProvider; +- private final LongSupplier wallTimeSource; +- private final long deadlineNano; +- private int currentTick; +- private ProfileCollector singleTickProfiler; +- private volatile boolean killSwitch; +- private Set thisTickSamplers = ImmutableSet.of(); +- +- private ActiveMetricsRecorder( +- MetricsSamplerProvider metricsSamplerProvider, +- LongSupplier wallTimeSource, +- Executor ioExecutor, +- MetricsPersister metricPersister, +- Consumer onProfilerEnd, +- Consumer onReportFinished +- ) { +- this.metricsSamplerProvider = metricsSamplerProvider; +- this.wallTimeSource = wallTimeSource; +- this.taskProfiler = new ContinuousProfiler(wallTimeSource, () -> this.currentTick); +- this.ioExecutor = ioExecutor; +- this.metricsPersister = metricPersister; +- this.onProfilingEnd = onProfilerEnd; +- this.onReportFinished = globalOnReportFinished == null ? onReportFinished : onReportFinished.andThen(globalOnReportFinished); +- this.deadlineNano = wallTimeSource.getAsLong() + TimeUnit.NANOSECONDS.convert(10L, TimeUnit.SECONDS); +- this.singleTickProfiler = new ActiveProfiler(this.wallTimeSource, () -> this.currentTick, false); +- this.taskProfiler.enable(); +- } +- +- public static ActiveMetricsRecorder createStarted( +- MetricsSamplerProvider metricsSamplerProvider, +- LongSupplier wallTimeSource, +- Executor ioExecutor, +- MetricsPersister metricsPersister, +- Consumer onProfilerEnd, +- Consumer onReportFinished +- ) { +- return new ActiveMetricsRecorder(metricsSamplerProvider, wallTimeSource, ioExecutor, metricsPersister, onProfilerEnd, onReportFinished); +- } +- +- @Override +- public synchronized void end() { +- if (this.isRecording()) { +- this.killSwitch = true; +- } +- } +- +- @Override +- public synchronized void cancel() { +- if (this.isRecording()) { +- this.singleTickProfiler = InactiveProfiler.INSTANCE; +- this.onProfilingEnd.accept(EmptyProfileResults.EMPTY); +- this.cleanup(this.thisTickSamplers); +- } +- } +- +- @Override +- public void startTick() { +- this.verifyStarted(); +- this.thisTickSamplers = this.metricsSamplerProvider.samplers(() -> this.singleTickProfiler); +- +- for (MetricSampler metricSampler : this.thisTickSamplers) { +- metricSampler.onStartTick(); +- } +- +- this.currentTick++; +- } +- +- @Override +- public void endTick() { +- this.verifyStarted(); +- if (this.currentTick != 0) { +- for (MetricSampler metricSampler : this.thisTickSamplers) { +- metricSampler.onEndTick(this.currentTick); +- if (metricSampler.triggersThreshold()) { +- RecordedDeviation recordedDeviation = new RecordedDeviation(Instant.now(), this.currentTick, this.singleTickProfiler.getResults()); +- this.deviationsBySampler.computeIfAbsent(metricSampler, metricSampler1 -> Lists.newArrayList()).add(recordedDeviation); +- } +- } +- +- if (!this.killSwitch && this.wallTimeSource.getAsLong() <= this.deadlineNano) { +- this.singleTickProfiler = new ActiveProfiler(this.wallTimeSource, () -> this.currentTick, false); +- } else { +- this.killSwitch = false; +- ProfileResults results = this.taskProfiler.getResults(); +- this.singleTickProfiler = InactiveProfiler.INSTANCE; +- this.onProfilingEnd.accept(results); +- this.scheduleSaveResults(results); +- } +- } +- } +- +- @Override +- public boolean isRecording() { +- return this.taskProfiler.isEnabled(); +- } +- +- @Override +- public ProfilerFiller getProfiler() { +- return ProfilerFiller.combine(this.taskProfiler.getFiller(), this.singleTickProfiler); +- } +- +- private void verifyStarted() { +- if (!this.isRecording()) { +- throw new IllegalStateException("Not started!"); +- } +- } +- +- private void scheduleSaveResults(ProfileResults results) { +- HashSet set = new HashSet<>(this.thisTickSamplers); +- this.ioExecutor.execute(() -> { +- Path path = this.metricsPersister.saveReports(set, this.deviationsBySampler, results); +- this.cleanup(set); +- this.onReportFinished.accept(path); +- }); +- } +- +- private void cleanup(Collection samplers) { +- for (MetricSampler metricSampler : samplers) { +- metricSampler.onFinished(); +- } +- +- this.deviationsBySampler.clear(); +- this.taskProfiler.disable(); +- } +- +- public static void registerGlobalCompletionCallback(Consumer globalOnReportFinished) { +- ActiveMetricsRecorder.globalOnReportFinished = globalOnReportFinished; +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder.java b/net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder.java +deleted file mode 100644 +index 12d7b7c86115b667bd8f940206985d9ed4b837d4..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder.java ++++ /dev/null +@@ -1,34 +0,0 @@ +-package net.minecraft.util.profiling.metrics.profiling; +- +-import net.minecraft.util.profiling.InactiveProfiler; +-import net.minecraft.util.profiling.ProfilerFiller; +- +-public class InactiveMetricsRecorder implements MetricsRecorder { +- public static final MetricsRecorder INSTANCE = new InactiveMetricsRecorder(); +- +- @Override +- public void end() { +- } +- +- @Override +- public void cancel() { +- } +- +- @Override +- public void startTick() { +- } +- +- @Override +- public boolean isRecording() { +- return false; +- } +- +- @Override +- public ProfilerFiller getProfiler() { +- return InactiveProfiler.INSTANCE; +- } +- +- @Override +- public void endTick() { +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java b/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java +deleted file mode 100644 +index 48e7211e01691a677c52cf1f5982b0c179eaf83b..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java ++++ /dev/null +@@ -1,17 +0,0 @@ +-package net.minecraft.util.profiling.metrics.profiling; +- +-import net.minecraft.util.profiling.ProfilerFiller; +- +-public interface MetricsRecorder { +- void end(); +- +- void cancel(); +- +- void startTick(); +- +- boolean isRecording(); +- +- ProfilerFiller getProfiler(); +- +- void endTick(); +-} +diff --git a/net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter.java b/net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter.java +deleted file mode 100644 +index 44f6dfd6efb8bd7894d6b15b45ea6cdd8babd234..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter.java ++++ /dev/null +@@ -1,37 +0,0 @@ +-package net.minecraft.util.profiling.metrics.profiling; +- +-import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +-import java.util.Set; +-import java.util.function.Supplier; +-import java.util.stream.Collectors; +-import net.minecraft.util.TimeUtil; +-import net.minecraft.util.profiling.ActiveProfiler; +-import net.minecraft.util.profiling.ProfileCollector; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import net.minecraft.util.profiling.metrics.MetricSampler; +- +-public class ProfilerSamplerAdapter { +- private final Set previouslyFoundSamplerNames = new ObjectOpenHashSet<>(); +- +- public Set newSamplersFoundInProfiler(Supplier profiles) { +- Set set = profiles.get() +- .getChartedPaths() +- .stream() +- .filter(pair -> !this.previouslyFoundSamplerNames.contains(pair.getLeft())) +- .map(pair -> samplerForProfilingPath(profiles, pair.getLeft(), pair.getRight())) +- .collect(Collectors.toSet()); +- +- for (MetricSampler metricSampler : set) { +- this.previouslyFoundSamplerNames.add(metricSampler.getName()); +- } +- +- return set; +- } +- +- private static MetricSampler samplerForProfilingPath(Supplier profiles, String name, MetricCategory category) { +- return MetricSampler.create(name, category, () -> { +- ActiveProfiler.PathEntry entry = profiles.get().getEntry(name); +- return entry == null ? 0.0 : (double)entry.getMaxDuration() / TimeUtil.NANOSECONDS_PER_MILLISECOND; +- }); +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider.java b/net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider.java +deleted file mode 100644 +index f59e633e3dfae3f1b27f94a912b749e164213198..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider.java ++++ /dev/null +@@ -1,106 +0,0 @@ +-package net.minecraft.util.profiling.metrics.profiling; +- +-import com.google.common.base.Stopwatch; +-import com.google.common.base.Ticker; +-import com.google.common.collect.ImmutableSet; +-import com.google.common.collect.ImmutableSet.Builder; +-import com.mojang.logging.LogUtils; +-import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +-import java.util.Set; +-import java.util.concurrent.TimeUnit; +-import java.util.function.LongSupplier; +-import java.util.function.Supplier; +-import java.util.function.ToDoubleFunction; +-import java.util.stream.IntStream; +-import net.minecraft.SystemReport; +-import net.minecraft.util.profiling.ProfileCollector; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import net.minecraft.util.profiling.metrics.MetricSampler; +-import net.minecraft.util.profiling.metrics.MetricsRegistry; +-import net.minecraft.util.profiling.metrics.MetricsSamplerProvider; +-import org.slf4j.Logger; +-import oshi.SystemInfo; +-import oshi.hardware.CentralProcessor; +- +-public class ServerMetricsSamplersProvider implements MetricsSamplerProvider { +- private static final Logger LOGGER = LogUtils.getLogger(); +- private final Set samplers = new ObjectOpenHashSet<>(); +- private final ProfilerSamplerAdapter samplerFactory = new ProfilerSamplerAdapter(); +- +- public ServerMetricsSamplersProvider(LongSupplier timeSource, boolean dedicatedServer) { +- this.samplers.add(tickTimeSampler(timeSource)); +- if (dedicatedServer) { +- this.samplers.addAll(runtimeIndependentSamplers()); +- } +- } +- +- public static Set runtimeIndependentSamplers() { +- Builder builder = ImmutableSet.builder(); +- +- try { +- ServerMetricsSamplersProvider.CpuStats cpuStats = new ServerMetricsSamplersProvider.CpuStats(); +- IntStream.range(0, cpuStats.nrOfCpus) +- .mapToObj(i -> MetricSampler.create("cpu#" + i, MetricCategory.CPU, () -> cpuStats.loadForCpu(i))) +- .forEach(builder::add); +- } catch (Throwable var2) { +- LOGGER.warn("Failed to query cpu, no cpu stats will be recorded", var2); +- } +- +- builder.add( +- MetricSampler.create( +- "heap MiB", MetricCategory.JVM, () -> SystemReport.sizeInMiB(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) +- ) +- ); +- builder.addAll(MetricsRegistry.INSTANCE.getRegisteredSamplers()); +- return builder.build(); +- } +- +- @Override +- public Set samplers(Supplier profiles) { +- this.samplers.addAll(this.samplerFactory.newSamplersFoundInProfiler(profiles)); +- return this.samplers; +- } +- +- public static MetricSampler tickTimeSampler(final LongSupplier timeSource) { +- Stopwatch stopwatch = Stopwatch.createUnstarted(new Ticker() { +- @Override +- public long read() { +- return timeSource.getAsLong(); +- } +- }); +- ToDoubleFunction toDoubleFunction = stopwatch1 -> { +- if (stopwatch1.isRunning()) { +- stopwatch1.stop(); +- } +- +- long l = stopwatch1.elapsed(TimeUnit.NANOSECONDS); +- stopwatch1.reset(); +- return l; +- }; +- MetricSampler.ValueIncreasedByPercentage valueIncreasedByPercentage = new MetricSampler.ValueIncreasedByPercentage(2.0F); +- return MetricSampler.builder("ticktime", MetricCategory.TICK_LOOP, toDoubleFunction, stopwatch) +- .withBeforeTick(Stopwatch::start) +- .withThresholdAlert(valueIncreasedByPercentage) +- .build(); +- } +- +- static class CpuStats { +- private final SystemInfo systemInfo = new SystemInfo(); +- private final CentralProcessor processor = this.systemInfo.getHardware().getProcessor(); +- public final int nrOfCpus = this.processor.getLogicalProcessorCount(); +- private long[][] previousCpuLoadTick = this.processor.getProcessorCpuLoadTicks(); +- private double[] currentLoad = this.processor.getProcessorCpuLoadBetweenTicks(this.previousCpuLoadTick); +- private long lastPollMs; +- +- public double loadForCpu(int index) { +- long l = System.currentTimeMillis(); +- if (this.lastPollMs == 0L || this.lastPollMs + 501L < l) { +- this.currentLoad = this.processor.getProcessorCpuLoadBetweenTicks(this.previousCpuLoadTick); +- this.previousCpuLoadTick = this.processor.getProcessorCpuLoadTicks(); +- this.lastPollMs = l; +- } +- +- return this.currentLoad[index] * 100.0; +- } +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/profiling/package-info.java b/net/minecraft/util/profiling/metrics/profiling/package-info.java +deleted file mode 100644 +index f823bd9a9a819d7d7ca2cbf83af5b37b19fa301e..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/profiling/package-info.java ++++ /dev/null +@@ -1,8 +0,0 @@ +-@ParametersAreNonnullByDefault +-@MethodsReturnNonnullByDefault +-@FieldsAreNonnullByDefault +-package net.minecraft.util.profiling.metrics.profiling; +- +-import javax.annotation.ParametersAreNonnullByDefault; +-import net.minecraft.FieldsAreNonnullByDefault; +-import net.minecraft.MethodsReturnNonnullByDefault; +diff --git a/net/minecraft/util/profiling/metrics/storage/MetricsPersister.java b/net/minecraft/util/profiling/metrics/storage/MetricsPersister.java +deleted file mode 100644 +index 43d63490b8c5337b426966608085ee3de1347a96..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/storage/MetricsPersister.java ++++ /dev/null +@@ -1,125 +0,0 @@ +-package net.minecraft.util.profiling.metrics.storage; +- +-import com.mojang.logging.LogUtils; +-import java.io.IOException; +-import java.io.UncheckedIOException; +-import java.io.Writer; +-import java.nio.charset.StandardCharsets; +-import java.nio.file.Files; +-import java.nio.file.Path; +-import java.nio.file.Paths; +-import java.time.ZoneId; +-import java.time.format.DateTimeFormatter; +-import java.util.List; +-import java.util.Locale; +-import java.util.Map; +-import java.util.Set; +-import java.util.stream.Collectors; +-import java.util.stream.Stream; +-import net.minecraft.Util; +-import net.minecraft.resources.ResourceLocation; +-import net.minecraft.util.CsvOutput; +-import net.minecraft.util.profiling.ProfileResults; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import net.minecraft.util.profiling.metrics.MetricSampler; +-import org.apache.commons.io.IOUtils; +-import org.slf4j.Logger; +- +-public class MetricsPersister { +- public static final Path PROFILING_RESULTS_DIR = Paths.get("debug/profiling"); +- public static final String METRICS_DIR_NAME = "metrics"; +- public static final String DEVIATIONS_DIR_NAME = "deviations"; +- public static final String PROFILING_RESULT_FILENAME = "profiling.txt"; +- private static final Logger LOGGER = LogUtils.getLogger(); +- private final String rootFolderName; +- +- public MetricsPersister(String rootFolderName) { +- this.rootFolderName = rootFolderName; +- } +- +- public Path saveReports(Set samplers, Map> deviations, ProfileResults results) { +- try { +- Files.createDirectories(PROFILING_RESULTS_DIR); +- } catch (IOException var8) { +- throw new UncheckedIOException(var8); +- } +- +- try { +- Path path = Files.createTempDirectory("minecraft-profiling"); +- path.toFile().deleteOnExit(); +- Files.createDirectories(PROFILING_RESULTS_DIR); +- Path path1 = path.resolve(this.rootFolderName); +- Path path2 = path1.resolve("metrics"); +- this.saveMetrics(samplers, path2); +- if (!deviations.isEmpty()) { +- this.saveDeviations(deviations, path1.resolve("deviations")); +- } +- +- this.saveProfilingTaskExecutionResult(results, path1); +- return path; +- } catch (IOException var7) { +- throw new UncheckedIOException(var7); +- } +- } +- +- private void saveMetrics(Set samplers, Path path) { +- if (samplers.isEmpty()) { +- throw new IllegalArgumentException("Expected at least one sampler to persist"); +- } else { +- Map> map = samplers.stream().collect(Collectors.groupingBy(MetricSampler::getCategory)); +- map.forEach((metricCategory, list) -> this.saveCategory(metricCategory, (List)list, path)); +- } +- } +- +- private void saveCategory(MetricCategory category, List samplers, Path path) { +- Path path1 = path.resolve(Util.sanitizeName(category.getDescription(), ResourceLocation::validPathChar) + ".csv"); +- Writer writer = null; +- +- try { +- Files.createDirectories(path1.getParent()); +- writer = Files.newBufferedWriter(path1, StandardCharsets.UTF_8); +- CsvOutput.Builder builder = CsvOutput.builder(); +- builder.addColumn("@tick"); +- +- for (MetricSampler metricSampler : samplers) { +- builder.addColumn(metricSampler.getName()); +- } +- +- CsvOutput csvOutput = builder.build(writer); +- List list = samplers.stream().map(MetricSampler::result).collect(Collectors.toList()); +- int min = list.stream().mapToInt(MetricSampler.SamplerResult::getFirstTick).summaryStatistics().getMin(); +- int max = list.stream().mapToInt(MetricSampler.SamplerResult::getLastTick).summaryStatistics().getMax(); +- +- for (int i = min; i <= max; i++) { +- int i1 = i; +- Stream stream = list.stream().map(samplerResult -> String.valueOf(samplerResult.valueAtTick(i1))); +- Object[] objects = Stream.concat(Stream.of(String.valueOf(i)), stream).toArray(String[]::new); +- csvOutput.writeRow(objects); +- } +- +- LOGGER.info("Flushed metrics to {}", path1); +- } catch (Exception var18) { +- LOGGER.error("Could not save profiler results to {}", path1, var18); +- } finally { +- IOUtils.closeQuietly(writer); +- } +- } +- +- private void saveDeviations(Map> deviations, Path path) { +- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss.SSS", Locale.UK).withZone(ZoneId.systemDefault()); +- deviations.forEach( +- (metricSampler, list) -> list.forEach( +- recordedDeviation -> { +- String string = dateTimeFormatter.format(recordedDeviation.timestamp); +- Path path1 = path.resolve(Util.sanitizeName(metricSampler.getName(), ResourceLocation::validPathChar)) +- .resolve(String.format(Locale.ROOT, "%d@%s.txt", recordedDeviation.tick, string)); +- recordedDeviation.profilerResultAtTick.saveResults(path1); +- } +- ) +- ); +- } +- +- private void saveProfilingTaskExecutionResult(ProfileResults results, Path outputPath) { +- results.saveResults(outputPath.resolve("profiling.txt")); +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/storage/RecordedDeviation.java b/net/minecraft/util/profiling/metrics/storage/RecordedDeviation.java +deleted file mode 100644 +index 4f73764d32ddbb7142ca46f68a0291e1ac200b65..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/storage/RecordedDeviation.java ++++ /dev/null +@@ -1,16 +0,0 @@ +-package net.minecraft.util.profiling.metrics.storage; +- +-import java.time.Instant; +-import net.minecraft.util.profiling.ProfileResults; +- +-public final class RecordedDeviation { +- public final Instant timestamp; +- public final int tick; +- public final ProfileResults profilerResultAtTick; +- +- public RecordedDeviation(Instant timestamp, int tick, ProfileResults profilerResultAtTick) { +- this.timestamp = timestamp; +- this.tick = tick; +- this.profilerResultAtTick = profilerResultAtTick; +- } +-} +diff --git a/net/minecraft/util/profiling/metrics/storage/package-info.java b/net/minecraft/util/profiling/metrics/storage/package-info.java +deleted file mode 100644 +index a2af6177a16997835eb91de3c6f4f83ee5e7e944..0000000000000000000000000000000000000000 +--- a/net/minecraft/util/profiling/metrics/storage/package-info.java ++++ /dev/null +@@ -1,8 +0,0 @@ +-@ParametersAreNonnullByDefault +-@MethodsReturnNonnullByDefault +-@FieldsAreNonnullByDefault +-package net.minecraft.util.profiling.metrics.storage; +- +-import javax.annotation.ParametersAreNonnullByDefault; +-import net.minecraft.FieldsAreNonnullByDefault; +-import net.minecraft.MethodsReturnNonnullByDefault; +diff --git a/net/minecraft/util/thread/AbstractConsecutiveExecutor.java b/net/minecraft/util/thread/AbstractConsecutiveExecutor.java +index f4aa10bbd98f514f27224346b3b9332f2218602d..fa9384b529b1ad981e81d36b5b078afc1f5d7005 100644 +--- a/net/minecraft/util/thread/AbstractConsecutiveExecutor.java ++++ b/net/minecraft/util/thread/AbstractConsecutiveExecutor.java +@@ -7,13 +7,13 @@ import java.util.concurrent.Executor; + import java.util.concurrent.RejectedExecutionException; + import java.util.concurrent.atomic.AtomicReference; + import net.minecraft.Util; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import net.minecraft.util.profiling.metrics.MetricSampler; +-import net.minecraft.util.profiling.metrics.MetricsRegistry; +-import net.minecraft.util.profiling.metrics.ProfilerMeasured; ++//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.MetricSampler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.ProfilerMeasured; // Plazma - Remove Mojang Profiler + import org.slf4j.Logger; + +-public abstract class AbstractConsecutiveExecutor implements ProfilerMeasured, TaskScheduler, Runnable { ++public abstract class AbstractConsecutiveExecutor implements /*ProfilerMeasured,*/ TaskScheduler, Runnable { // Plazma - Remove Mojang Profiler + private static final Logger LOGGER = LogUtils.getLogger(); + private final AtomicReference status = new AtomicReference<>(AbstractConsecutiveExecutor.Status.SLEEPING); + private final StrictQueue queue; +@@ -24,7 +24,7 @@ public abstract class AbstractConsecutiveExecutor implements + this.executor = executor; + this.queue = queue; + this.name = name; +- MetricsRegistry.INSTANCE.add(this); ++ //MetricsRegistry.INSTANCE.add(this); // Plazma - Remove Mojang Profiler + } + + private boolean canBeScheduled() { +@@ -108,10 +108,12 @@ public abstract class AbstractConsecutiveExecutor implements + return this.name; + } + ++ /* // Plazma - Remove Mojang Profiler + @Override + public List profiledMetrics() { + return ImmutableList.of(MetricSampler.create(this.name + "-queue-size", MetricCategory.CONSECUTIVE_EXECUTORS, this::size)); + } ++ */ // Plazma - Remove Mojang Profiler + + private boolean setRunning() { + return this.status.compareAndSet(AbstractConsecutiveExecutor.Status.SLEEPING, AbstractConsecutiveExecutor.Status.RUNNING); +diff --git a/net/minecraft/util/thread/BlockableEventLoop.java b/net/minecraft/util/thread/BlockableEventLoop.java +index 186c1b2e3599770385150eb7acdcd890aa5835eb..91f3998430f0f39d10ab60c91fac7ae532208646 100644 +--- a/net/minecraft/util/thread/BlockableEventLoop.java ++++ b/net/minecraft/util/thread/BlockableEventLoop.java +@@ -15,13 +15,13 @@ import java.util.function.Supplier; + import javax.annotation.CheckReturnValue; + import net.minecraft.ReportedException; + import net.minecraft.SharedConstants; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import net.minecraft.util.profiling.metrics.MetricSampler; +-import net.minecraft.util.profiling.metrics.MetricsRegistry; +-import net.minecraft.util.profiling.metrics.ProfilerMeasured; ++//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.MetricSampler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.ProfilerMeasured; // Plazma - Remove Mojang Profiler + import org.slf4j.Logger; + +-public abstract class BlockableEventLoop implements ProfilerMeasured, TaskScheduler, Executor { ++public abstract class BlockableEventLoop implements /*ProfilerMeasured,*/ TaskScheduler, Executor { // Plazma - Remove Mojang Profiler + public static final long BLOCK_TIME_NANOS = 100000L; + private final String name; + private static final Logger LOGGER = LogUtils.getLogger(); +@@ -30,7 +30,7 @@ public abstract class BlockableEventLoop implements Profiler + + protected BlockableEventLoop(String name) { + this.name = name; +- MetricsRegistry.INSTANCE.add(this); ++ //MetricsRegistry.INSTANCE.add(this); // Plazma - Remove Mojang Profiler + } + + protected abstract boolean shouldRun(R runnable); +@@ -161,10 +161,12 @@ public abstract class BlockableEventLoop implements Profiler + } + } + ++ /* // Plazma - Remove Mojang Profiler + @Override + public List profiledMetrics() { + return ImmutableList.of(MetricSampler.create(this.name + "-pending-tasks", MetricCategory.EVENT_LOOPS, this::getPendingTasksCount)); + } ++ */ // Plazma - Remove Mojang Profiler + + public static boolean isNonRecoverable(Throwable error) { + return error instanceof ReportedException reportedException +diff --git a/net/minecraft/util/thread/PriorityConsecutiveExecutor.java b/net/minecraft/util/thread/PriorityConsecutiveExecutor.java +index 39a604c9a53930b53d959b1d2eb504aa964e9a58..e1366b8f3565800c8a90b7effe80b29fffb9fd04 100644 +--- a/net/minecraft/util/thread/PriorityConsecutiveExecutor.java ++++ b/net/minecraft/util/thread/PriorityConsecutiveExecutor.java +@@ -3,12 +3,12 @@ package net.minecraft.util.thread; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; + import java.util.function.Consumer; +-import net.minecraft.util.profiling.metrics.MetricsRegistry; ++//import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Remove Mojang Profiler + + public class PriorityConsecutiveExecutor extends AbstractConsecutiveExecutor { + public PriorityConsecutiveExecutor(int size, Executor executor, String name) { + super(new StrictQueue.FixedPriorityQueue(size), executor, name); +- MetricsRegistry.INSTANCE.add(this); ++ //MetricsRegistry.INSTANCE.add(this); // Plazma - Remove Mojang Profiler + } + + @Override +diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java +index bd24ef83f9366806961b185ceb15703734a8b2ff..6b6a19a90ca7958a8ac864b9d6e61be589c32682 100644 +--- a/net/minecraft/world/entity/Entity.java ++++ b/net/minecraft/world/entity/Entity.java +@@ -78,8 +78,8 @@ import net.minecraft.tags.FluidTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.Nameable; +@@ -857,8 +857,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + // CraftBukkit end + + public void baseTick() { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("entityBaseTick"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("entityBaseTick"); // Plazma - Remove Mojang Profiler + 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()) { +@@ -922,7 +922,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + Leashable.tickLeash(serverLevelx, (Entity & Leashable)this); + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + public void setSharedFlagOnFire(boolean isOnFire) { +@@ -1141,8 +1141,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + } + } + +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("move"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("move"); // Plazma - Remove Mojang Profiler + if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7) { + movement = movement.multiply(this.stuckSpeedMultiplier); + this.stuckSpeedMultiplier = Vec3.ZERO; +@@ -1151,7 +1151,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + // Paper start - ignore movement changes while inactive. + if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) { + setDeltaMovement(Vec3.ZERO); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + return; + } + // Paper end +@@ -1173,8 +1173,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + this.setPos(this.getX() + vec3.x, this.getY() + vec3.y, this.getZ() + vec3.z); + } + +- profilerFiller.pop(); +- profilerFiller.push("rest"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("rest"); // Plazma - Remove Mojang Profiler + boolean flag = !Mth.equal(movement.x, vec3.x); + boolean flag1 = !Mth.equal(movement.z, vec3.z); + this.horizontalCollision = flag || flag1; +@@ -1197,7 +1197,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + } + + if (this.isRemoved()) { +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } else { + if (this.horizontalCollision) { + Vec3 deltaMovement = this.getDeltaMovement(); +@@ -1242,7 +1242,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + + float blockSpeedFactor = this.getBlockSpeedFactor(); + this.setDeltaMovement(this.getDeltaMovement().multiply(blockSpeedFactor, 1.0, blockSpeedFactor)); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + } + // Paper start - detailed watchdog information +@@ -3325,8 +3325,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + this.processPortalCooldown(); + if (this.portalProcess != null) { + if (this.portalProcess.processPortalTeleportation(serverLevel, this, this.canUsePortal(false))) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("portal"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("portal"); // Plazma - Remove Mojang Profiler + this.setPortalCooldown(); + TeleportTransition portalDestination = this.portalProcess.getPortalDestination(serverLevel, this); + if (portalDestination != null) { +@@ -3337,7 +3337,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + } + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } else if (this.portalProcess.hasExpired()) { + this.portalProcess = null; + } +@@ -3858,15 +3858,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + entity.teleport(this.calculatePassengerTransition(teleportTransition, entity)); + } + +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("teleportSameDimension"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("teleportSameDimension"); // Plazma - Remove Mojang Profiler + this.teleportSetPosition(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); + if (!teleportTransition.asPassenger()) { + this.sendTeleportTransitionToRidingPlayers(teleportTransition); + } + + teleportTransition.postTeleportTransition().onTransition(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + return this; + } + +@@ -3882,11 +3882,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + } + } + +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("teleportCrossDimension"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("teleportCrossDimension"); // Plazma - Remove Mojang Profiler + Entity entityx = this.getType().create(level, EntitySpawnReason.DIMENSION_TRAVEL); + if (entityx == null) { +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + return null; + } else { + // Paper start - Fix item duplication and teleport issues +@@ -3909,7 +3909,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + + level.resetEmptyTime(); + teleportTransition.postTeleportTransition().onTransition(entityx); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + return entityx; + } + } +diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java +index 70f848346a13b3aedb4c0787b7bdc62b8733f885..83040a740a602314ec85e80f834cbccf743fe594 100644 +--- a/net/minecraft/world/entity/LivingEntity.java ++++ b/net/minecraft/world/entity/LivingEntity.java +@@ -72,8 +72,8 @@ import net.minecraft.tags.FluidTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.Difficulty; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.damagesource.CombatRules; +@@ -448,8 +448,8 @@ public abstract class LivingEntity extends Entity implements Attackable { + } + + super.baseTick(); +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("livingEntityBaseTick"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("livingEntityBaseTick"); // Plazma - Remove Mojang Profiler + if (this.fireImmune() /*|| this.level().isClientSide*/) { // == false // Plazma - Remove isClientSide on DedicatedServer + this.clearFire(); + } +@@ -565,7 +565,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + this.yHeadRotO = this.yHeadRot; + this.yRotO = this.getYRot(); + this.xRotO = this.getXRot(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + @Override +@@ -3252,11 +3252,11 @@ public abstract class LivingEntity extends Entity implements Attackable { + } + + this.run = this.run + (f3 - this.run) * 0.3F; +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("headTurn"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("headTurn"); // Plazma - Remove Mojang Profiler + f2 = this.tickHeadTurn(f1, f2); +- profilerFiller.pop(); +- profilerFiller.push("rangeChecks"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("rangeChecks"); // Plazma - Remove Mojang Profiler + + // Paper start - stop large pitch and yaw changes from crashing the server + this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; +@@ -3267,7 +3267,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + + this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.animStep += f2; + if (this.isFallFlying()) { + this.fallFlyTicks++; +@@ -3479,20 +3479,20 @@ public abstract class LivingEntity extends Entity implements Attackable { + } + + this.setDeltaMovement(d, d1, d2); +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("ai"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("ai"); // Plazma - Remove Mojang Profiler + if (this.isImmobile()) { + this.jumping = false; + this.xxa = 0.0F; + this.zza = 0.0F; + } else if (this.isEffectiveAi()) { +- profilerFiller.push("newAi"); ++ //profilerFiller.push("newAi"); // Plazma - Remove Mojang Profiler + this.serverAiStep(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + +- profilerFiller.pop(); +- profilerFiller.push("jump"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("jump"); // Plazma - Remove Mojang Profiler + if (this.jumping && this.isAffectedByFluids()) { + double fluidHeight; + if (this.isInLava()) { +@@ -3521,8 +3521,8 @@ public abstract class LivingEntity extends Entity implements Attackable { + this.noJumpDelay = 0; + } + +- profilerFiller.pop(); +- profilerFiller.push("travel"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("travel"); // Plazma - Remove Mojang Profiler + this.xxa *= 0.98F; + this.zza *= 0.98F; + if (this.isFallFlying()) { +@@ -3544,8 +3544,8 @@ public abstract class LivingEntity extends Entity implements Attackable { + this.applyEffectsFromBlocks(); // Plazma - Remove isClientSide on DedicatedServer + + this.calculateEntityAnimation(this instanceof FlyingAnimal); +- profilerFiller.pop(); +- profilerFiller.push("freezing"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("freezing"); // Plazma - Remove Mojang Profiler + if (/*!this.level().isClientSide &&*/ !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API // == true // Plazma - Remove isClientSide on DedicatedServer + int ticksFrozen = this.getTicksFrozen(); + if (this.isInPowderSnow && this.canFreeze()) { +@@ -3561,15 +3561,15 @@ public abstract class LivingEntity extends Entity implements Attackable { + this.hurtServer(serverLevel, this.damageSources().freeze(), 1.0F); + } + +- profilerFiller.pop(); +- profilerFiller.push("push"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("push"); // Plazma - Remove Mojang Profiler + if (this.autoSpinAttackTicks > 0) { + this.autoSpinAttackTicks--; + this.checkAutoSpinAttack(boundingBox, this.getBoundingBox()); + } + + this.pushEntities(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + // Paper start - Add EntityMoveEvent + // Purpur start - Ridables + if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { +diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java +index b786fef4c0e8c1c4ec043904a574b445deae695a..be5a3da146062781de2e71fb4275e90b61ba44fd 100644 +--- a/net/minecraft/world/entity/Mob.java ++++ b/net/minecraft/world/entity/Mob.java +@@ -33,8 +33,8 @@ import net.minecraft.sounds.SoundEvent; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.Difficulty; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; +@@ -331,14 +331,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab + @Override + public void baseTick() { + super.baseTick(); +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("mobBaseTick"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("mobBaseTick"); // Plazma - Remove Mojang Profiler + if (this.isAlive() && this.random.nextInt(1000) < this.ambientSoundTime++) { + this.resetAmbientSoundTime(); + this.playAmbientSound(); + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + incrementTicksSinceLastInteraction(); // Purpur - Entity lifespan + } + +@@ -638,8 +638,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab + @Override + public void aiStep() { + super.aiStep(); +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("looting"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("looting"); // Plazma - Remove Mojang Profiler + if (this.level() instanceof ServerLevel serverLevel + && this.canPickUpLoot() + && this.isAlive() +@@ -663,7 +663,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab + } + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + protected Vec3i getPickupReach() { +@@ -878,42 +878,42 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab + return; + } + // Paper end - Allow nerfed mobs to jump and float +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("sensing"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("sensing"); // Plazma - Remove Mojang Profiler + this.sensing.tick(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + int i = this.tickCount + this.getId(); + if (i % 2 != 0 && this.tickCount > 1) { +- profilerFiller.push("targetSelector"); ++ //profilerFiller.push("targetSelector"); // Plazma - Remove Mojang Profiler + this.targetSelector.tickRunningGoals(false); +- profilerFiller.pop(); +- profilerFiller.push("goalSelector"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("goalSelector"); // Plazma - Remove Mojang Profiler + this.goalSelector.tickRunningGoals(false); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } else { +- profilerFiller.push("targetSelector"); ++ //profilerFiller.push("targetSelector"); // Plazma - Remove Mojang Profiler + this.targetSelector.tick(); +- profilerFiller.pop(); +- profilerFiller.push("goalSelector"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("goalSelector"); // Plazma - Remove Mojang Profiler + this.goalSelector.tick(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + +- profilerFiller.push("navigation"); ++ //profilerFiller.push("navigation"); // Plazma - Remove Mojang Profiler + this.navigation.tick(); +- profilerFiller.pop(); +- profilerFiller.push("mob tick"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("mob tick"); // Plazma - Remove Mojang Profiler + this.customServerAiStep((ServerLevel)this.level()); +- profilerFiller.pop(); +- profilerFiller.push("controls"); +- profilerFiller.push("move"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("controls"); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("move"); // Plazma - Remove Mojang Profiler + this.moveControl.tick(); +- profilerFiller.popPush("look"); ++ //profilerFiller.popPush("look"); // Plazma - Remove Mojang Profiler + this.lookControl.tick(); +- profilerFiller.popPush("jump"); ++ //profilerFiller.popPush("jump"); // Plazma - Remove Mojang Profiler + this.jumpControl.tick(); +- profilerFiller.pop(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.sendDebugPackets(); + } + +diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java +index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..75c23ae204e9decd9e16819afc29ce95baf35369 100644 +--- a/net/minecraft/world/entity/ai/goal/GoalSelector.java ++++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java +@@ -7,8 +7,8 @@ import java.util.EnumSet; + import java.util.Map; + import java.util.Set; + import java.util.function.Predicate; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + + public class GoalSelector { + private static final WrappedGoal NO_GOAL = new WrappedGoal(Integer.MAX_VALUE, new Goal() { +@@ -84,8 +84,8 @@ public class GoalSelector { + } + + public void tick() { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("goalCleanup"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("goalCleanup"); // Plazma - Remove Mojang Profiler + + for (WrappedGoal wrappedGoal : this.availableGoals) { + if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams +@@ -94,8 +94,8 @@ public class GoalSelector { + } + + this.lockedFlags.entrySet().removeIf(entry -> !entry.getValue().isRunning()); +- profilerFiller.pop(); +- profilerFiller.push("goalUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("goalUpdate"); // Plazma - Remove Mojang Profiler + + for (WrappedGoal wrappedGoalx : this.availableGoals) { + // Paper start +@@ -115,13 +115,13 @@ public class GoalSelector { + } + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.tickRunningGoals(true); + } + + public void tickRunningGoals(boolean tickAllRunning) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("goalTick"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("goalTick"); // Plazma - Remove Mojang Profiler + + for (WrappedGoal wrappedGoal : this.availableGoals) { + if (wrappedGoal.isRunning() && (tickAllRunning || wrappedGoal.requiresUpdateEveryTick())) { +@@ -129,7 +129,7 @@ public class GoalSelector { + } + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + public Set getAvailableGoals() { +diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java +index b44f2c49509d847817a78e9c4fb1499fb378054b..03d2beca9e5e7b7a03bbfe3bcf34322cfb54f3b9 100644 +--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java ++++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java +@@ -10,8 +10,8 @@ import net.minecraft.core.Vec3i; + import net.minecraft.network.protocol.game.DebugPackets; + import net.minecraft.tags.BlockTags; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.Mob; + import net.minecraft.world.entity.ai.attributes.Attributes; +@@ -189,13 +189,13 @@ public abstract class PathNavigation { + } + } + // Paper end - EntityPathfindEvent +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("pathfind"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("pathfind"); // Plazma - Remove Mojang Profiler + BlockPos blockPos = offsetUpward ? this.mob.blockPosition().above() : this.mob.blockPosition(); + int i = (int)(followRange + regionOffset); + PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i)); + Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, targets, followRange, accuracy, this.maxVisitedNodesMultiplier); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + if (path != null && path.getTarget() != null) { + this.targetPos = path.getTarget(); + this.reachRange = accuracy; +diff --git a/net/minecraft/world/entity/ai/sensing/Sensing.java b/net/minecraft/world/entity/ai/sensing/Sensing.java +index c569074403b1d8b443aaa98ba9cf9bbd0e98bd2d..96d6c46771fb43f728c2aa523b904f25aa12dea2 100644 +--- a/net/minecraft/world/entity/ai/sensing/Sensing.java ++++ b/net/minecraft/world/entity/ai/sensing/Sensing.java +@@ -2,8 +2,8 @@ package net.minecraft.world.entity.ai.sensing; + + import it.unimi.dsi.fastutil.ints.IntOpenHashSet; + import it.unimi.dsi.fastutil.ints.IntSet; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.Mob; + +@@ -28,10 +28,10 @@ public class Sensing { + } else if (this.unseen.contains(id)) { + return false; + } else { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("hasLineOfSight"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("hasLineOfSight"); // Plazma - Remove Mojang Profiler + boolean hasLineOfSight = this.mob.hasLineOfSight(entity); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + if (hasLineOfSight) { + this.seen.add(id); + } else { +diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java +index 1259c94aee332be1979613d63ff510eb7f0b213c..bc12c8464ffb75eda11735ed85c14b637439740d 100644 +--- a/net/minecraft/world/entity/animal/allay/Allay.java ++++ b/net/minecraft/world/entity/animal/allay/Allay.java +@@ -30,8 +30,8 @@ import net.minecraft.tags.GameEventTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; ++//import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.SimpleContainer; +@@ -288,14 +288,14 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("allayBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("allayBrain"); // Plazma - Remove Mojang Profiler + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); +- profilerFiller.push("allayActivityUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("allayActivityUpdate"); // Plazma - Remove Mojang Profiler + AllayAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + } + +diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java +index 760f69b13e3f0fc4ea892c3310d5bb50cf0d99b4..51e7a09e9d6105cc75d41d10782600226f710c77 100644 +--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java ++++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java +@@ -23,8 +23,8 @@ import net.minecraft.util.ByIdMap; + import net.minecraft.util.RandomSource; + import net.minecraft.util.StringRepresentable; + import net.minecraft.util.TimeUtil; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; ++//import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.damagesource.DamageSource; +@@ -165,13 +165,13 @@ public class Armadillo extends Animal { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("armadilloBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("armadilloBrain"); // Plazma - Remove Mojang Profiler + ((Brain)this.brain).tick(level, this); +- profilerFiller.pop(); +- profilerFiller.push("armadilloActivityUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("armadilloActivityUpdate"); // Plazma - Remove Mojang Profiler + ArmadilloAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) { + this.forceDrops = true; // CraftBukkit + if (this.dropFromGiftLootTable(level, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) { +diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java +index da98d3483ea3d81d84ff12e7726058fb6da437d0..4c390928da3caff2d8bac7efdd6d9ec18f0f142e 100644 +--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java ++++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java +@@ -26,8 +26,8 @@ import net.minecraft.util.ByIdMap; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.StringRepresentable; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +@@ -351,14 +351,14 @@ public class Axolotl extends Animal implements VariantHolder, B + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("axolotlBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("axolotlBrain"); // Plazma - Remove Mojang Profiler + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); +- profilerFiller.push("axolotlActivityUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("axolotlActivityUpdate"); // Plazma - Remove Mojang Profiler + AxolotlAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + if (!this.isNoAi()) { + Optional memory = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS); + this.setPlayingDead(memory.isPresent() && memory.get() > 0); +diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java +index e2f0b2e4a87072d4f938933cd10f20b65a51c27c..8df14c0294f0474c91af25d01c0aabb3ce37666c 100644 +--- a/net/minecraft/world/entity/animal/camel/Camel.java ++++ b/net/minecraft/world/entity/animal/camel/Camel.java +@@ -17,8 +17,8 @@ import net.minecraft.sounds.SoundSource; + import net.minecraft.tags.BlockTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +@@ -159,14 +159,14 @@ public class Camel extends AbstractHorse { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("camelBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("camelBrain"); // Plazma - Remove Mojang Profiler + Brain brain = this.getBrain(); + ((Brain)brain).tick(level, this); +- profilerFiller.pop(); +- profilerFiller.push("camelActivityUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("camelActivityUpdate"); // Plazma - Remove Mojang Profiler + CamelAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + } + +diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java +index 6ed4abd646f86961cbbb126d6637b4f333a8c8e0..4690266adaaf8a126852970d0cdaae3166a9deb5 100644 +--- a/net/minecraft/world/entity/animal/frog/Frog.java ++++ b/net/minecraft/world/entity/animal/frog/Frog.java +@@ -28,8 +28,8 @@ import net.minecraft.tags.ItemTags; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.AgeableMob; +@@ -243,14 +243,14 @@ public class Frog extends Animal implements VariantHolder> { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("frogBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("frogBrain"); // Plazma - Remove Mojang Profiler + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); +- profilerFiller.push("frogActivityUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("frogActivityUpdate"); // Plazma - Remove Mojang Profiler + FrogAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + } + +diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java +index 4dca4348a91e0c78ffab1b0ce540ebf4ecfe7d34..015b3f72e82de9fce7bc87ff4694de01779f205b 100644 +--- a/net/minecraft/world/entity/animal/frog/Tadpole.java ++++ b/net/minecraft/world/entity/animal/frog/Tadpole.java +@@ -12,8 +12,8 @@ import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; + import net.minecraft.tags.ItemTags; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.damagesource.DamageSource; +@@ -134,14 +134,14 @@ public class Tadpole extends AbstractFish { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("tadpoleBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("tadpoleBrain"); // Plazma - Remove Mojang Profiler + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); +- profilerFiller.push("tadpoleActivityUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("tadpoleActivityUpdate"); // Plazma - Remove Mojang Profiler + TadpoleAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + } + +diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java +index 6f106f10466440f8e65e04511f67d48f082d703f..45881c3a792b07e6e868027c71969a87a793539e 100644 +--- a/net/minecraft/world/entity/animal/goat/Goat.java ++++ b/net/minecraft/world/entity/animal/goat/Goat.java +@@ -21,8 +21,8 @@ import net.minecraft.tags.ItemTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +@@ -224,14 +224,14 @@ public class Goat extends Animal { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("goatBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("goatBrain"); // Plazma - Remove Mojang Profiler + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); +- profilerFiller.push("goatActivityUpdate"); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("goatActivityUpdate"); // Plazma - Remove Mojang Profiler + GoatAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + } + +diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java +index 58ab17819e54c5ac209882f49e22a6af7494fc66..1fc17322d54008ef42be52e3a1ff08f08b287bcc 100644 +--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java ++++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java +@@ -29,8 +29,8 @@ import net.minecraft.tags.BlockTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.ByIdMap; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.damagesource.DamageSource; +@@ -490,12 +490,12 @@ public class Sniffer extends Animal { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("snifferBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("snifferBrain"); // Plazma - Remove Mojang Profiler + this.getBrain().tick(level, this); +- profilerFiller.popPush("snifferActivityUpdate"); ++ //profilerFiller.popPush("snifferActivityUpdate"); // Plazma - Remove Mojang Profiler + SnifferAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + } + +diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java +index 67a6b23ee305cec3e373f543daa72d67508b21e4..67f2d4ff9af997abec556183dfa456504084b804 100644 +--- a/net/minecraft/world/entity/monster/Zoglin.java ++++ b/net/minecraft/world/entity/monster/Zoglin.java +@@ -15,8 +15,8 @@ import net.minecraft.network.syncher.SynchedEntityData; + import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.util.valueproviders.UniformInt; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; +@@ -287,11 +287,11 @@ public class Zoglin extends Monster implements HoglinBase { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("zoglinBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("zoglinBrain"); // Plazma - Remove Mojang Profiler + if (getRider() == null || !this.isControllable()) // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.updateActivity(); + } + +diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java +index ec93f1f402aa66134f658fc542fd0d309f70739b..f15fb05d8a915a08c61fa9123de8ab120cf0b1e2 100644 +--- a/net/minecraft/world/entity/monster/breeze/Breeze.java ++++ b/net/minecraft/world/entity/monster/breeze/Breeze.java +@@ -12,8 +12,8 @@ import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; + import net.minecraft.sounds.SoundSource; + import net.minecraft.tags.EntityTypeTags; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.AnimationState; + import net.minecraft.world.entity.Entity; +@@ -240,12 +240,12 @@ public class Breeze extends Monster { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("breezeBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("breezeBrain"); // Plazma - Remove Mojang Profiler + this.getBrain().tick(level, this); +- profilerFiller.popPush("breezeActivityUpdate"); ++ //profilerFiller.popPush("breezeActivityUpdate"); // Plazma - Remove Mojang Profiler + BreezeAi.updateActivity(this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + } + +diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java +index 9975699ea5f79200b324b04d500551fcebd07a8d..e145adf8bd3b371b5130282f6644d5701a5c441e 100644 +--- a/net/minecraft/world/entity/monster/creaking/Creaking.java ++++ b/net/minecraft/world/entity/monster/creaking/Creaking.java +@@ -18,8 +18,8 @@ import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; + import net.minecraft.tags.DamageTypeTags; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.AnimationState; + import net.minecraft.world.entity.Entity; +@@ -234,10 +234,10 @@ public class Creaking extends Monster { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("creakingBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("creakingBrain"); // Plazma - Remove Mojang Profiler + this.getBrain().tick((ServerLevel)this.level(), this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + CreakingAi.updateActivity(this); + } + +diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java +index f80fd583531a7ee2147503fd04fef48802c2a3e5..29426e922ba1829ee47a936f0b96db88bde77788 100644 +--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java ++++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java +@@ -16,8 +16,8 @@ import net.minecraft.sounds.SoundEvents; + import net.minecraft.sounds.SoundSource; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +@@ -204,11 +204,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("hoglinBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("hoglinBrain"); // Plazma - Remove Mojang Profiler + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + HoglinAi.updateActivity(this); + if (this.isConverting()) { + this.timeInOverworld++; +diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java +index 83e07ccc72788271c9a6f06ad40a55b4dea727d7..6b57c89346b4fc1a4830dcb3d6cd5b7c01a10cba 100644 +--- a/net/minecraft/world/entity/monster/piglin/Piglin.java ++++ b/net/minecraft/world/entity/monster/piglin/Piglin.java +@@ -17,8 +17,8 @@ import net.minecraft.tags.ItemTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.RandomSource; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +@@ -383,11 +383,11 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("piglinBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("piglinBrain"); // Plazma - Remove Mojang Profiler + //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + PiglinAi.updateActivity(this); + super.customServerAiStep(level); + } +diff --git a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +index 4984b9864b63f92bc939b530253e871ca94a3277..b3a5ba218de65a2a08d3933ae493e8c58ed09765 100644 +--- a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java ++++ b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +@@ -8,8 +8,8 @@ import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.EntitySpawnReason; +@@ -154,11 +154,11 @@ public class PiglinBrute extends AbstractPiglin { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("piglinBruteBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("piglinBruteBrain"); // Plazma - Remove Mojang Profiler + if (getRider() == null || this.isControllable()) // Purpur - only use brain if no rider + this.getBrain().tick(level, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + PiglinBruteAi.updateActivity(this); + PiglinBruteAi.maybePlayActivitySound(this); + super.customServerAiStep(level); +diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java +index a4311f887b3df9065070a2d6f3da532ec36dcd8d..873c096826b222466448209c1476832458924c26 100644 +--- a/net/minecraft/world/entity/monster/warden/Warden.java ++++ b/net/minecraft/world/entity/monster/warden/Warden.java +@@ -32,8 +32,8 @@ import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.effect.MobEffectInstance; +@@ -311,10 +311,10 @@ public class Warden extends Monster implements VibrationSystem { + + @Override + protected void customServerAiStep(ServerLevel level) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("wardenBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("wardenBrain"); // Plazma - Remove Mojang Profiler + this.getBrain().tick(level, this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + super.customServerAiStep(level); + if ((this.tickCount + this.getId()) % 120 == 0) { + applyDarknessAround(level, this.position(), this, 20); +diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java +index a488abb5035cda96605945c96bc53a4718263326..4dd23802f60b0b7f721c179256ea2e674fc0ba8e 100644 +--- a/net/minecraft/world/entity/npc/Villager.java ++++ b/net/minecraft/world/entity/npc/Villager.java +@@ -35,8 +35,8 @@ import net.minecraft.stats.Stats; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.Mth; + import net.minecraft.util.SpawnUtil; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.Difficulty; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; +@@ -390,8 +390,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler + } + protected void customServerAiStep(ServerLevel level, boolean inactive) { // Purpur - Lobotomize stuck villagers - not final + // Paper end - EAR 2 +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("villagerBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("villagerBrain"); // Plazma - Remove Mojang Profiler + // Purpur start - Lobotomize stuck villagers + if (this.level().purpurConfig.villagerLobotomizeEnabled) { + // treat as inactive if lobotomized +@@ -406,7 +406,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler + } + else if (this.isLobotomized && shouldRestock()) restock(); // Purpur - Lobotomize stuck villagers + // Pufferfish end +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + if (this.assignProfessionWhenSpawned) { + this.assignProfessionWhenSpawned = false; + } +diff --git a/net/minecraft/world/item/crafting/RecipeManager.java b/net/minecraft/world/item/crafting/RecipeManager.java +index aefaac550b58be479cc282f52dea91d4b1e530f6..cdbf58e4594726d0b02f891eb62a94e8f9cc0c34 100644 +--- a/net/minecraft/world/item/crafting/RecipeManager.java ++++ b/net/minecraft/world/item/crafting/RecipeManager.java +@@ -28,7 +28,7 @@ import net.minecraft.server.level.ServerLevel; + import net.minecraft.server.packs.resources.ResourceManager; + import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener; + import net.minecraft.server.packs.resources.SimplePreparableReloadListener; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.flag.FeatureFlagSet; + import net.minecraft.world.item.crafting.display.RecipeDisplay; + import net.minecraft.world.item.crafting.display.RecipeDisplayEntry; +@@ -67,7 +67,7 @@ public class RecipeManager extends SimplePreparableReloadListener imp + } + + @Override +- protected RecipeMap prepare(ResourceManager resourceManager, ProfilerFiller profiler) { ++ protected RecipeMap prepare(ResourceManager resourceManager/*, ProfilerFiller profiler*/) { // Plazma - Remove Mojang Profiler + SortedMap> map = new TreeMap<>(); + SimpleJsonResourceReloadListener.scanDirectory( + resourceManager, RECIPE_LISTER, this.registries.createSerializationContext(JsonOps.INSTANCE), Recipe.CODEC, map +@@ -82,7 +82,7 @@ public class RecipeManager extends SimplePreparableReloadListener imp + } + + @Override +- protected void apply(RecipeMap object, ResourceManager resourceManager, ProfilerFiller profiler) { ++ protected void apply(RecipeMap object, ResourceManager resourceManager/*, ProfilerFiller profiler*/) { // Plazma - Remove Mojang Profiler + this.recipes = object; + LOGGER.info("Loaded {} recipes", object.values().size()); + } +diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java +index df28a59ef9f233916d5d32aea7aa1b6bedb36a58..54f9686676611d43db1f8b61a11eea6145106b58 100644 +--- a/net/minecraft/world/level/Level.java ++++ b/net/minecraft/world/level/Level.java +@@ -35,8 +35,8 @@ import net.minecraft.util.AbortableIterationConsumer; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.StringRepresentable; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.TickRateManager; + import net.minecraft.world.damagesource.DamageSource; +@@ -263,7 +263,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + + @Override + public final List getEntitiesOfClass(final Class entityClass, final AABB boundingBox, final Predicate predicate) { +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Plazma - Remove Mojang Profiler + final List ret = new java.util.ArrayList<>(); + + ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate); +@@ -273,7 +273,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) { +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Plazma - Remove Mojang Profiler + final List ret = new java.util.ArrayList<>(); + + ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate); +@@ -1486,8 +1486,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + } + + protected void tickBlockEntities() { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("blockEntities"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("blockEntities"); // Plazma - Remove Mojang Profiler + this.tickingBlockEntities = true; + if (!this.pendingBlockEntityTickers.isEmpty()) { + this.blockEntityTickers.addAll(this.pendingBlockEntityTickers); +@@ -1516,7 +1516,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075 + + this.tickingBlockEntities = false; +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + this.spigotConfig.currentPrimedTnt = 0; // Spigot + } + +@@ -1776,7 +1776,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + + @Override + public List getEntities(@Nullable Entity entity, AABB boundingBox, Predicate predicate) { +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Plazma - Remove Mojang Profiler + + // Paper start - rewrite chunk system + final List ret = new java.util.ArrayList<>(); +@@ -1806,7 +1806,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + final @Nullable List into, + final int maxCount + ) { +- Profiler.get().incrementCounter("getEntities"); ++ //Profiler.get().incrementCounter("getEntities"); // Plazma - Remove Mojang Profiler + + if (entityTypeTest instanceof net.minecraft.world.entity.EntityType byType) { + if (maxCount != Integer.MAX_VALUE) { +diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java +index 8aeeeffae50b3ec68ab972e793bb5edb4530ca78..d213ff065ff798ad856056f306d7849235183ea2 100644 +--- a/net/minecraft/world/level/NaturalSpawner.java ++++ b/net/minecraft/world/level/NaturalSpawner.java +@@ -23,8 +23,8 @@ import net.minecraft.tags.BlockTags; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; ++//import net.minecraft.util.profiling.ProfilerFiller; + import net.minecraft.util.random.WeightedRandomList; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntitySpawnReason; +@@ -158,8 +158,8 @@ public final class NaturalSpawner { + } + + public static void spawnForChunk(ServerLevel level, LevelChunk chunk, NaturalSpawner.SpawnState spawnState, List categories) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("spawner"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("spawner"); // Plazma - Remove Mojang Profiler + + for (MobCategory mobCategory : categories) { + // Paper start - Optional per player mob spawns +@@ -196,7 +196,7 @@ public final class NaturalSpawner { + } + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + // Paper start - Add mobcaps commands +diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java +index 82116937534617ceb9e33ea2717f61b6a8924982..ea668fd4a0d80598df0b4c3ee96cc6dcde0c0edf 100644 +--- a/net/minecraft/world/level/ServerExplosion.java ++++ b/net/minecraft/world/level/ServerExplosion.java +@@ -13,8 +13,8 @@ import net.minecraft.Util; + import net.minecraft.core.BlockPos; + import net.minecraft.server.level.ServerLevel; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityType; +@@ -682,10 +682,10 @@ public class ServerExplosion implements Explosion { + List list = this.calculateExplodedPositions(); + this.hurtEntities(); + if (this.interactsWithBlocks()) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("explosion_blocks"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("explosion_blocks"); // Plazma - Remove Mojang Profiler + this.interactWithBlocks(list); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + if (this.fire) { +diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java +index 9a064bae123b18c097af7f9fef470b5e799c7a56..258b9977239f31b7ce9c53843f1d8eaefbafb763 100644 +--- a/net/minecraft/world/level/chunk/LevelChunk.java ++++ b/net/minecraft/world/level/chunk/LevelChunk.java +@@ -23,8 +23,8 @@ import net.minecraft.network.FriendlyByteBuf; + import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData; + import net.minecraft.server.level.FullChunkStatus; + import net.minecraft.server.level.ServerLevel; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.entity.Entity; + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.Level; +@@ -386,12 +386,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + } + + if (LightEngine.hasDifferentLightProperties(blockState, state)) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("updateSkyLightSources"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("updateSkyLightSources"); // Plazma - Remove Mojang Profiler + // Paper - rewrite chunk system +- profilerFiller.popPush("queueCheckLight"); ++ //profilerFiller.popPush("queueCheckLight"); // Plazma - Remove Mojang Profiler + this.level.getChunkSource().getLightEngine().checkBlock(pos); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + + boolean hasBlockEntity = blockState.hasBlockEntity(); +@@ -911,8 +911,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + BlockPos blockPos = this.blockEntity.getBlockPos(); + if (LevelChunk.this.isTicking(blockPos)) { + try { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push(this::getType); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push(this::getType); // Plazma - Remove Mojang Profiler + BlockState blockState = LevelChunk.this.getBlockState(blockPos); + if (this.blockEntity.getType().isValid(blockState)) { + this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), blockState, this.blockEntity); +@@ -927,7 +927,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + // Paper end - Remove the Block Entity if it's invalid + } + +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } catch (Throwable var5) { + // Paper start - Prevent block entity and entity crashes + final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); +diff --git a/net/minecraft/world/level/pathfinder/PathFinder.java b/net/minecraft/world/level/pathfinder/PathFinder.java +index 81de6c1bbef1cafd3036e736dd305fbedc8368c6..20b7327a97f5ca06ff3d784a38a560f2f1fafadf 100644 +--- a/net/minecraft/world/level/pathfinder/PathFinder.java ++++ b/net/minecraft/world/level/pathfinder/PathFinder.java +@@ -12,9 +12,9 @@ import java.util.function.Function; + import java.util.stream.Collectors; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPos; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; +-import net.minecraft.util.profiling.metrics.MetricCategory; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Remove Mojang Profiler + import net.minecraft.world.entity.Mob; + import net.minecraft.world.level.PathNavigationRegion; + +@@ -57,9 +57,9 @@ public class PathFinder { + + @Nullable + private Path findPath(Node node, List> positions, float maxRange, int accuracy, float searchDepthMultiplier) { // Paper - optimize collection +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("find_path"); +- profilerFiller.markForCharting(MetricCategory.PATH_FINDING); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("find_path"); // Plazma - Remove Mojang Profiler ++ //profilerFiller.markForCharting(MetricCategory.PATH_FINDING); // Plazma - Remove Mojang Profiler + // Set set = targetPositions.keySet(); // Paper + node.g = 0.0F; + node.h = this.getBestH(node, positions); // Paper - optimize collection +@@ -129,7 +129,7 @@ public class PathFinder { + best = path; + } + } +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + return best; + // Paper end - Perf: remove streams and optimize collection + } +diff --git a/net/minecraft/world/ticks/LevelTicks.java b/net/minecraft/world/ticks/LevelTicks.java +index 66abc2e7adee60fa98eed1ba36e018814fd02cad..0e41e851ae756ad4972d93b783f8b7ecb479c83e 100644 +--- a/net/minecraft/world/ticks/LevelTicks.java ++++ b/net/minecraft/world/ticks/LevelTicks.java +@@ -23,8 +23,8 @@ import net.minecraft.Util; + import net.minecraft.core.BlockPos; + import net.minecraft.core.SectionPos; + import net.minecraft.core.Vec3i; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Remove Mojang Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Remove Mojang Profiler + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.levelgen.structure.BoundingBox; + +@@ -80,20 +80,20 @@ public class LevelTicks implements LevelTickAccess { + } + + public void tick(long gameTime, int maxAllowedTicks, BiConsumer ticker) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("collect"); +- this.collectTicks(gameTime, maxAllowedTicks, profilerFiller); +- profilerFiller.popPush("run"); +- profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Remove Mojang Profiler ++ //profilerFiller.push("collect"); // Plazma - Remove Mojang Profiler ++ this.collectTicks(gameTime, maxAllowedTicks); // Plazma - Remove Mojang Profiler ++ //profilerFiller.popPush("run"); // Plazma - Remove Mojang Profiler ++ //profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Plazma - Remove Mojang Profiler + this.runCollectedTicks(ticker); +- profilerFiller.popPush("cleanup"); ++ //profilerFiller.popPush("cleanup"); // Plazma - Remove Mojang Profiler + this.cleanupAfterTick(); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Remove Mojang Profiler + } + +- private void collectTicks(long gameTime, int maxAllowedTicks, ProfilerFiller profiler) { ++ private void collectTicks(long gameTime, int maxAllowedTicks/*, ProfilerFiller profiler*/) { + this.sortContainersToTick(gameTime); +- profiler.incrementCounter("containersToTick", this.containersToTick.size()); ++ //profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Plazma - Remove Mojang Profiler + this.drainContainers(gameTime, maxAllowedTicks); + this.rescheduleLeftoverContainers(); + } diff --git a/plazma-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java.patch b/plazma-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java.patch index d5309e4..f81fed9 100644 --- a/plazma-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java.patch +++ b/plazma-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java.patch @@ -1,14 +1,5 @@ --- a/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java +++ b/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java -@@ -1059,7 +_,7 @@ - public void processUnloads() { - TickThread.ensureTickThread("Cannot unload chunks off-main"); - -- if (BLOCK_TICKET_UPDATES.get() == Boolean.TRUE) { -+ if (BLOCK_TICKET_UPDATES.get() == true) { - throw new IllegalStateException("Cannot unload chunks recursively"); - } - final int sectionShift = this.unloadQueue.coordinateShift; // sectionShift <= lock shift @@ -1306,12 +_,12 @@ } @@ -24,15 +15,6 @@ return ret; } -@@ -1330,7 +_,7 @@ - } - - private boolean processTicketUpdates(final boolean processFullUpdates, List scheduledTasks) { -- if (BLOCK_TICKET_UPDATES.get() == Boolean.TRUE) { -+ if (BLOCK_TICKET_UPDATES.get() == true) { - throw new IllegalStateException("Cannot update ticket level while unloading chunks or updating entity manager"); - } - if (!PlatformHooks.get().allowAsyncTicketUpdates() && !TickThread.isTickThread()) { @@ -1358,7 +_,7 @@ scheduledTasks, changedFullStatus ); diff --git a/plazma-server/minecraft-patches/sources/net/minecraft/network/chat/Style.java.patch b/plazma-server/minecraft-patches/sources/net/minecraft/network/chat/Style.java.patch deleted file mode 100644 index e54e650..0000000 --- a/plazma-server/minecraft-patches/sources/net/minecraft/network/chat/Style.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/net/minecraft/network/chat/Style.java -+++ b/net/minecraft/network/chat/Style.java -@@ -105,23 +_,23 @@ - } - - public boolean isBold() { -- return this.bold == Boolean.TRUE; -+ return this.bold == true; - } - - public boolean isItalic() { -- return this.italic == Boolean.TRUE; -+ return this.italic == true; - } - - public boolean isStrikethrough() { -- return this.strikethrough == Boolean.TRUE; -+ return this.strikethrough == true; - } - - public boolean isUnderlined() { -- return this.underlined == Boolean.TRUE; -+ return this.underlined == true; - } - - public boolean isObfuscated() { -- return this.obfuscated == Boolean.TRUE; -+ return this.obfuscated == true; - } - - public boolean isEmpty() { diff --git a/plazma-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch b/plazma-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch index d3c0c25..8de9455 100644 --- a/plazma-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch +++ b/plazma-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch @@ -39,7 +39,7 @@ - return; + // Plazma start - Branding + System.out.println(""" -+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╗\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m╗\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m \033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m╗\033[38;2;142;54;148m \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m╗\033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m╗ \033[38;2;78;81;161m \033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m╗\033[38;2;56;91;166m\\s ++ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╗\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m╗\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m \033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m╗\033[38;2;142;54;148m \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m╗\033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m╗ \033[38;2;78;81;161m \033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m╗\033[38;2;56;91;166m\s + \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m█\033[38;2;196;31;137m█\033[38;2;193;33;138m╗ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m╗ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m╔\033[38;2;116;65;153m╝ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m█\033[38;2;101;72;157m╗\033[38;2;97;73;157m \033[38;2;94;75;158m█\033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m╗ + \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╔\033[38;2;193;33;138m╝ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m \033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m╔\033[38;2;120;64;153m╝\033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m╔\033[38;2;104;71;156m█\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m█\033[38;2;91;76;159m╔\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║ + \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m═\033[38;2;196;31;137m╝\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m╔\033[38;2;123;62;152m╝\033[38;2;120;64;153m \033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m╚\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m╔\033[38;2;91;76;159m╝\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║ diff --git a/plazma-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch b/plazma-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch index d3ff0f4..29285b8 100644 --- a/plazma-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch +++ b/plazma-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch @@ -81,7 +81,7 @@ + biomeProvider, + env, + (spigotConfig) -> server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), -+ () -> server.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.Configurations.ContextMap.builder().put(io.papermc.paper.configuration.Configurations.WORLD_DIRECTORY, levelStorageAccess.levelDirectory.path()).put(io.papermc.paper.configuration.Configurations.WORLD_NAME, serverLevelData.getLevelName()).put(io.papermc.paper.configuration.Configurations.WORLD_KEY, dimension.location()).build()), ++ () -> server.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.Configurations.ContextMap.builder().put(io.papermc.paper.configuration.Configurations.WORLD_DIRECTORY, levelStorageAccess.levelDirectory.path()).put(io.papermc.paper.configuration.Configurations.WORLD_NAME, serverLevelData.getLevelName()).put(io.papermc.paper.configuration.Configurations.WORLD_KEY, dimension.location()).put(io.papermc.paper.configuration.Configurations.REGISTRY_ACCESS, server.registryAccess()).build()), + dispatcher + ); // Paper - create paper world configs; Async-Anti-Xray: Pass executor + // Plazma end - Configurable Plazma diff --git a/plazma-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java.patch b/plazma-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java.patch index 095ac14..1f0359c 100644 --- a/plazma-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java.patch +++ b/plazma-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java.patch @@ -13,3 +13,8 @@ @Override public int getSeaLevel() { +@@ -812,4 +_,3 @@ + } + // Paper end + } +-