945 lines
55 KiB
Diff
945 lines
55 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: AlphaKR93 <dev@alpha93.kr>
|
|
Date: Wed, 27 Sep 2023 17:52:52 +0900
|
|
Subject: [PATCH] Completely remove Mojang Profiler
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index 11de2f237e6dd950b8ddba3d5cfe9066d09f0903..44248dc470d0882b7287debd1993cedf0f238aca 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -113,16 +113,16 @@ import net.minecraft.util.Unit;
|
|
import net.minecraft.util.datafix.DataFixers;
|
|
import net.minecraft.util.profiling.EmptyProfileResults;
|
|
import net.minecraft.util.profiling.ProfileResults;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.util.profiling.ResultField;
|
|
-import net.minecraft.util.profiling.SingleTickProfiler;
|
|
+//import net.minecraft.util.profiling.SingleTickProfiler; // Plazma - Completely remove 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 - Completely remove profiler
|
|
+//import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; // Plazma - Completely remove profiler
|
|
+//import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; // Plazma - Completely remove profiler
|
|
+//import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; // Plazma - Completely remove profiler
|
|
+//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Completely remove profiler
|
|
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
|
|
import net.minecraft.world.Difficulty;
|
|
import net.minecraft.world.RandomSequences;
|
|
@@ -214,11 +214,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
public LevelStorageSource.LevelStorageAccess storageSource;
|
|
public final PlayerDataStorage playerDataStorage;
|
|
private final List<Runnable> tickables = Lists.newArrayList();
|
|
- private MetricsRecorder metricsRecorder;
|
|
- private ProfilerFiller profiler;
|
|
- private Consumer<ProfileResults> onMetricsRecordingStopped;
|
|
- private Consumer<Path> onMetricsRecordingFinished;
|
|
- private boolean willStartRecordingMetrics;
|
|
+ //private MetricsRecorder metricsRecorder; // Plazma - Completely remove profiler
|
|
+ //private ProfilerFiller profiler; // Plazma - Completely remove profiler
|
|
+ //private Consumer<ProfileResults> onMetricsRecordingStopped; // Plazma - Completely remove profiler
|
|
+ //private Consumer<Path> onMetricsRecordingFinished; // Plazma - Completely remove profiler
|
|
+ //private boolean willStartRecordingMetrics; // Plazma - Completely remove profiler
|
|
@Nullable
|
|
private MinecraftServer.TimeProfiler debugCommandProfiler;
|
|
private boolean debugCommandProfilerDelayStart;
|
|
@@ -2309,10 +2309,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
}
|
|
|
|
+ /* // Plazma - Completely remove profiler
|
|
public ProfilerFiller getProfiler() {
|
|
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Purpur
|
|
return this.profiler;
|
|
}
|
|
+ */ // Plazma - Completely remove profiler
|
|
|
|
public abstract boolean isSingleplayerOwner(GameProfile profile);
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
|
index ebcd2bbcf8f25c52de3deaff32a8522dbf662141..0ff246c5f7c6f02c12a55b1d9c7b35ad3fd4c1c0 100644
|
|
--- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
|
+++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
|
@@ -22,7 +22,7 @@ import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.server.packs.resources.ResourceManager;
|
|
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
|
import net.minecraft.util.GsonHelper;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.level.storage.loot.LootDataManager;
|
|
import org.slf4j.Logger;
|
|
|
|
@@ -39,7 +39,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
|
|
this.lootData = conditionManager;
|
|
}
|
|
|
|
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
|
|
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
|
|
Builder<ResourceLocation, AdvancementHolder> builder = ImmutableMap.builder();
|
|
|
|
prepared.forEach((minecraftkey, jsonelement) -> {
|
|
diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
|
index 975422a57b83a31e63a600bb4ff9c4e2baaf6da7..6783dc11a321c244296e84223c51cd1a489a9b96 100644
|
|
--- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
|
+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
|
|
@@ -25,7 +25,7 @@ import net.minecraft.server.packs.resources.PreparableReloadListener;
|
|
import net.minecraft.server.packs.resources.Resource;
|
|
import net.minecraft.server.packs.resources.ResourceManager;
|
|
import net.minecraft.tags.TagLoader;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.phys.Vec2;
|
|
import net.minecraft.world.phys.Vec3;
|
|
@@ -62,7 +62,7 @@ public class ServerFunctionLibrary implements PreparableReloadListener {
|
|
}
|
|
|
|
@Override
|
|
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
|
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
|
CompletableFuture<Map<ResourceLocation, List<TagLoader.EntryWithSource>>> completableFuture = CompletableFuture.supplyAsync(() -> {
|
|
return this.tagsLoader.load(manager);
|
|
}, prepareExecutor);
|
|
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
|
index 097ac55028d66ef9ab430ff5dd103db6e3b99fc7..2993e9f326c43ef3f06d5e332899f9fad1f03718 100644
|
|
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
|
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
|
|
@@ -19,7 +19,7 @@ import net.minecraft.commands.FunctionInstantiationException;
|
|
import net.minecraft.nbt.CompoundTag;
|
|
import net.minecraft.network.chat.Component;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.level.GameRules;
|
|
|
|
public class ServerFunctionManager {
|
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
index 3f4df62773dfe1045914325ce5bc13162192679c..0f27bdc25dc5246d98358a26e1d01e17bc779c2d 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
@@ -68,7 +68,7 @@ import net.minecraft.server.level.progress.ChunkProgressListener;
|
|
import net.minecraft.server.network.ServerPlayerConnection;
|
|
import net.minecraft.util.CsvOutput;
|
|
import net.minecraft.util.Mth;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.util.thread.BlockableEventLoop;
|
|
import net.minecraft.util.thread.ProcessorHandle;
|
|
import net.minecraft.util.thread.ProcessorMailbox;
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
index 6255960ae70e14eb11da5043eb003575e300ddf6..999f57366cad34f92a1f80437bf7bd84b40c0e6b 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
@@ -24,7 +24,7 @@ import net.minecraft.core.SectionPos;
|
|
import net.minecraft.network.protocol.Packet;
|
|
import net.minecraft.server.level.progress.ChunkProgressListener;
|
|
import net.minecraft.util.VisibleForDebug;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.util.thread.BlockableEventLoop;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.ai.village.poi.PoiManager;
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
index e7efdd572716e50ecca217898b8a368e5829f925..72c2af8638d71b92a9762dedb0efec53ce8094f7 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -77,7 +77,7 @@ import net.minecraft.util.Mth;
|
|
import net.minecraft.util.ProgressListener;
|
|
import net.minecraft.util.RandomSource;
|
|
import net.minecraft.util.Unit;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.util.valueproviders.IntProvider;
|
|
import net.minecraft.util.valueproviders.UniformInt;
|
|
import net.minecraft.world.DifficultyInstance;
|
|
@@ -694,15 +694,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
|
|
|
|
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
|
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma
|
|
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type()/*, minecraftserver::getProfiler*/, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma // Plazma - Completely remove profiler
|
|
this.pvpMode = minecraftserver.isPvpAllowed();
|
|
this.convertable = convertable_conversionsession;
|
|
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
|
// CraftBukkit end
|
|
this.players = Lists.newArrayList();
|
|
this.entityTickList = new EntityTickList();
|
|
- this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
|
- this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
|
+ this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded/*, this.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
|
+ this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded/*, this.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
|
this.navigatingMobs = new ObjectOpenHashSet();
|
|
this.blockEvents = new ObjectLinkedOpenHashSet();
|
|
this.blockEventsToReschedule = new ArrayList(64);
|
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
|
index 828196decc89e7e03f88c4a3208ee1ab2bb69242..c0088e0e566abb928c8dcd6f819d82cc1122589b 100644
|
|
--- a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
|
+++ b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
|
|
@@ -2,10 +2,10 @@ package net.minecraft.server.packs.resources;
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.Executor;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
|
|
public interface PreparableReloadListener {
|
|
- CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor);
|
|
+ CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor); // Plazma - Completely remove profiler
|
|
|
|
default String getName() {
|
|
return this.getClass().getSimpleName();
|
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
index 7383c7d3820dce06108eaafd236a7c6c06a10a42..4e1f4e026cd7c566468a58b2ea232d5dee80b86f 100644
|
|
--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
|
|
@@ -3,11 +3,11 @@ 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.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
|
|
public interface ResourceManagerReloadListener extends PreparableReloadListener {
|
|
@Override
|
|
- default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
|
+ default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
|
return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> {
|
|
//applyProfiler.startTick(); // Purpur
|
|
//applyProfiler.push("listener"); // Purpur
|
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
|
index 9cc09f0415a09299102dbcf022326944368ea033..2e9e63f3ee6268cafa3b90666cf31019e7341dbb 100644
|
|
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
|
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
|
|
@@ -11,7 +11,7 @@ import java.util.Map;
|
|
import net.minecraft.resources.FileToIdConverter;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.util.GsonHelper;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import org.slf4j.Logger;
|
|
|
|
public abstract class SimpleJsonResourceReloadListener extends SimplePreparableReloadListener<Map<ResourceLocation, JsonElement>> {
|
|
@@ -25,7 +25,7 @@ public abstract class SimpleJsonResourceReloadListener extends SimplePreparableR
|
|
}
|
|
|
|
@Override
|
|
- protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager, ProfilerFiller profilerFiller) {
|
|
+ protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager/*, ProfilerFiller profilerFiller*/) { // Plazma - Completely remove Profiler
|
|
Map<ResourceLocation, JsonElement> map = new HashMap<>();
|
|
scanDirectory(resourceManager, this.directory, this.gson, map);
|
|
return map;
|
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
|
index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..da21380a84d4dcbeaf965b2202e5209b82a82529 100644
|
|
--- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
|
+++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
|
|
@@ -2,19 +2,19 @@ package net.minecraft.server.packs.resources;
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.Executor;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
|
|
public abstract class SimplePreparableReloadListener<T> implements PreparableReloadListener {
|
|
@Override
|
|
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
|
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) {
|
|
return CompletableFuture.supplyAsync(() -> {
|
|
- return this.prepare(manager, prepareProfiler);
|
|
+ return this.prepare(manager/*, prepareProfiler*/);
|
|
}, prepareExecutor).thenCompose(synchronizer::wait).thenAcceptAsync((prepared) -> {
|
|
- this.apply(prepared, manager, applyProfiler);
|
|
+ this.apply(prepared, manager/*, applyProfiler*/);
|
|
}, applyExecutor);
|
|
}
|
|
|
|
- protected abstract T prepare(ResourceManager manager, ProfilerFiller profiler);
|
|
+ protected abstract T prepare(ResourceManager manager/*, ProfilerFiller profiler*/);
|
|
|
|
- protected abstract void apply(T prepared, ResourceManager manager, ProfilerFiller profiler);
|
|
+ protected abstract void apply(T prepared, ResourceManager manager/*, ProfilerFiller profiler*/);
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
|
index de2ecc7c69fb870f843f60596115866214267ee4..05a731dec4aec1d3cf61a761bda018cc8c46afde 100644
|
|
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
|
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
|
|
@@ -26,7 +26,7 @@ public class SimpleReloadInstance<S> implements ReloadInstance {
|
|
|
|
public static SimpleReloadInstance<Void> of(ResourceManager manager, List<PreparableReloadListener> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) {
|
|
return new SimpleReloadInstance<>(prepareExecutor, applyExecutor, manager, reloaders, (synchronizer, resourceManager, reloader, prepare, apply) -> {
|
|
- return reloader.reload(synchronizer, resourceManager, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE, prepareExecutor, apply);
|
|
+ return reloader.reload(synchronizer, resourceManager/*, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE*/, prepareExecutor, apply); // Plazma - Completely remove Profiler
|
|
}, initialStage);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/tags/TagManager.java b/src/main/java/net/minecraft/tags/TagManager.java
|
|
index 60ed9413c32d91ce33583cc24998d08869d07a23..67c0d8f7294e18c7b2107b82219bc106608a21f0 100644
|
|
--- a/src/main/java/net/minecraft/tags/TagManager.java
|
|
+++ b/src/main/java/net/minecraft/tags/TagManager.java
|
|
@@ -14,7 +14,7 @@ import net.minecraft.resources.ResourceKey;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
|
import net.minecraft.server.packs.resources.ResourceManager;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
|
|
public class TagManager implements PreparableReloadListener {
|
|
private static final Map<ResourceKey<? extends Registry<?>>, String> CUSTOM_REGISTRY_DIRECTORIES = Map.of(Registries.BLOCK, "tags/blocks", Registries.ENTITY_TYPE, "tags/entity_types", Registries.FLUID, "tags/fluids", Registries.GAME_EVENT, "tags/game_events", Registries.ITEM, "tags/items");
|
|
@@ -35,7 +35,7 @@ public class TagManager implements PreparableReloadListener {
|
|
}
|
|
|
|
@Override
|
|
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
|
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
|
List<? extends CompletableFuture<? extends TagManager.LoadResult<?>>> list = this.registryAccess.registries().map((registry) -> {
|
|
return this.createLoader(manager, prepareExecutor, registry);
|
|
}).toList();
|
|
diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
|
deleted file mode 100644
|
|
index c6c30d99399c5cde2b0ec2f320d81d952b422d78..0000000000000000000000000000000000000000
|
|
--- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
|
|
+++ /dev/null
|
|
@@ -1,208 +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<String> paths = Lists.newArrayList();
|
|
- private final LongList startTimes = new LongArrayList();
|
|
- private final Map<String, ActiveProfiler.PathEntry> 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<Pair<String, MetricCategory>> chartedPaths = new ObjectArraySet<>();
|
|
-
|
|
- public ActiveProfiler(LongSupplier timeGetter, IntSupplier tickGetter, boolean checkTimeout) {
|
|
- this.startTimeNano = timeGetter.getAsLong();
|
|
- this.getRealTime = timeGetter;
|
|
- this.startTimeTicks = tickGetter.getAsInt();
|
|
- this.getTickTime = tickGetter;
|
|
- this.warn = checkTimeout;
|
|
- }
|
|
-
|
|
- @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"); // Purpur
|
|
- }
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void endTick() {
|
|
- if (!this.started) {
|
|
- LOGGER.error("Profiler tick already ended - missing startTick()?");
|
|
- } else {
|
|
- //this.pop(); // Purpur
|
|
- this.started = false;
|
|
- if (!this.path.isEmpty()) {
|
|
- LOGGER.error("Profiler tick ended before path was fully popped (remainder: '{}'). Mismatched push/pop?", LogUtils.defer(() -> {
|
|
- return ProfileResults.demanglePath(this.path);
|
|
- }));
|
|
- }
|
|
-
|
|
- }
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void push(String location) {
|
|
- if (!this.started) {
|
|
- LOGGER.error("Cannot push '{}' to profiler if profiler tick hasn't started - missing startTick()?", (Object)location);
|
|
- } else {
|
|
- if (!this.path.isEmpty()) {
|
|
- this.path = this.path + "\u001e";
|
|
- }
|
|
-
|
|
- this.path = this.path + location;
|
|
- this.paths.add(this.path);
|
|
- this.startTimes.add(Util.getNanos());
|
|
- this.currentEntry = null;
|
|
- }
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void push(Supplier<String> locationGetter) {
|
|
- //this.push(locationGetter.get()); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void markForCharting(MetricCategory type) {
|
|
- this.chartedPaths.add(Pair.of(this.path, type));
|
|
- }
|
|
-
|
|
- @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 l = Util.getNanos();
|
|
- long m = this.startTimes.removeLong(this.startTimes.size() - 1);
|
|
- this.paths.remove(this.paths.size() - 1);
|
|
- long n = l - m;
|
|
- ActiveProfiler.PathEntry pathEntry = this.getCurrentEntry();
|
|
- pathEntry.accumulatedDuration += n;
|
|
- ++pathEntry.count;
|
|
- pathEntry.maxDuration = Math.max(pathEntry.maxDuration, n);
|
|
- pathEntry.minDuration = Math.min(pathEntry.minDuration, n);
|
|
- if (this.warn && n > WARNING_TIME_NANOS) {
|
|
- LOGGER.warn("Something's taking too long! '{}' took aprox {} ms", LogUtils.defer(() -> {
|
|
- return ProfileResults.demanglePath(this.path);
|
|
- }), LogUtils.defer(() -> {
|
|
- return (double)n / 1000000.0D;
|
|
- }));
|
|
- }
|
|
-
|
|
- this.path = this.paths.isEmpty() ? "" : this.paths.get(this.paths.size() - 1);
|
|
- this.currentEntry = null;
|
|
- }
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void popPush(String location) {
|
|
- //this.pop(); // Purpur
|
|
- //this.push(location); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void popPush(Supplier<String> locationGetter) {
|
|
- //this.pop(); // Purpur
|
|
- //this.push(locationGetter); // Purpur
|
|
- }
|
|
-
|
|
- private ActiveProfiler.PathEntry getCurrentEntry() {
|
|
- if (this.currentEntry == null) {
|
|
- this.currentEntry = this.entries.computeIfAbsent(this.path, (k) -> {
|
|
- return new ActiveProfiler.PathEntry();
|
|
- });
|
|
- }
|
|
-
|
|
- return this.currentEntry;
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void incrementCounter(String marker, int num) {
|
|
- this.getCurrentEntry().counters.addTo(marker, (long)num);
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void incrementCounter(Supplier<String> markerGetter, int num) {
|
|
- this.getCurrentEntry().counters.addTo(markerGetter.get(), (long)num);
|
|
- }
|
|
-
|
|
- @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 name) {
|
|
- return this.entries.get(name);
|
|
- }
|
|
-
|
|
- @Override
|
|
- public Set<Pair<String, MetricCategory>> 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<String> 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<String> getCounters() {
|
|
- return Object2LongMaps.unmodifiable(this.counters);
|
|
- }
|
|
- }
|
|
-}
|
|
diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
|
deleted file mode 100644
|
|
index 863343a87fe34d72f04af89d75268b477b2adc7a..0000000000000000000000000000000000000000
|
|
--- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
|
|
+++ /dev/null
|
|
@@ -1,116 +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";
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void startTick();
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void endTick();
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void push(String location);
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void push(Supplier<String> locationGetter);
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void pop();
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void popPush(String location);
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void popPush(Supplier<String> locationGetter);
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void markForCharting(MetricCategory type);
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- default void incrementCounter(String marker) {
|
|
- //this.incrementCounter(marker, 1); // Purpur
|
|
- }
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void incrementCounter(String marker, int num);
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- default void incrementCounter(Supplier<String> markerGetter) {
|
|
- //this.incrementCounter(markerGetter, 1); // Purpur
|
|
- }
|
|
-
|
|
- @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void incrementCounter(Supplier<String> markerGetter, int num);
|
|
-
|
|
- static ProfilerFiller tee(final ProfilerFiller a, final ProfilerFiller b) {
|
|
- if (a == InactiveProfiler.INSTANCE) {
|
|
- return b;
|
|
- } else {
|
|
- return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() {
|
|
- @Override
|
|
- public void startTick() {
|
|
- //a.startTick(); // Purpur
|
|
- //b.startTick(); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void endTick() {
|
|
- //a.endTick(); // Purpur
|
|
- //b.endTick(); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void push(String location) {
|
|
- //a.push(location); // Purpur
|
|
- //b.push(location); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void push(Supplier<String> locationGetter) {
|
|
- //a.push(locationGetter); // Purpur
|
|
- //b.push(locationGetter); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void markForCharting(MetricCategory type) {
|
|
- //a.markForCharting(type); // Purpur
|
|
- //b.markForCharting(type); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void pop() {
|
|
- //a.pop(); // Purpur
|
|
- //b.pop(); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void popPush(String location) {
|
|
- //a.popPush(location); // Purpur
|
|
- //b.popPush(location); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void popPush(Supplier<String> locationGetter) {
|
|
- //a.popPush(locationGetter); // Purpur
|
|
- //b.popPush(locationGetter); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void incrementCounter(String marker, int num) {
|
|
- //a.incrementCounter(marker, num); // Purpur
|
|
- //b.incrementCounter(marker, num); // Purpur
|
|
- }
|
|
-
|
|
- @Override
|
|
- public void incrementCounter(Supplier<String> markerGetter, int num) {
|
|
- //a.incrementCounter(markerGetter, num); // Purpur
|
|
- //b.incrementCounter(markerGetter, num); // Purpur
|
|
- }
|
|
- };
|
|
- }
|
|
- }
|
|
-}
|
|
diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java
|
|
deleted file mode 100644
|
|
index 729ebd1b2433327de243d0168289e180a841f47c..0000000000000000000000000000000000000000
|
|
--- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java
|
|
+++ /dev/null
|
|
@@ -1,24 +0,0 @@
|
|
-package net.minecraft.util.profiling.metrics.profiling;
|
|
-
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
-
|
|
-@Deprecated(forRemoval = true)
|
|
-public interface MetricsRecorder {
|
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void end();
|
|
-
|
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void cancel();
|
|
-
|
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void startTick();
|
|
-
|
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- boolean isRecording();
|
|
-
|
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- ProfilerFiller getProfiler();
|
|
-
|
|
- @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur
|
|
- void endTick();
|
|
-}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
index d35afa8f8648bbcbfc044323bcda1b1182d7dce4..fb5c21ba15995d00da87ee6ef9e4ab8f6678d67f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -147,8 +147,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
this.pathfindingMalus = Maps.newEnumMap(BlockPathTypes.class);
|
|
this.restrictCenter = BlockPos.ZERO;
|
|
this.restrictRadius = -1.0F;
|
|
- this.goalSelector = new GoalSelector(world.getProfilerSupplier());
|
|
- this.targetSelector = new GoalSelector(world.getProfilerSupplier());
|
|
+ this.goalSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
|
+ this.targetSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove profiler
|
|
this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this); // Purpur
|
|
this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this); // Purpur
|
|
this.jumpControl = new JumpControl(this);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
|
index 02978315bc2b828cc603ce7478408f3f82c249c2..4f9b19c45afd6b26833ba892a90d3a9559d5d859 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
|
@@ -11,7 +11,7 @@ import java.util.Set;
|
|
import java.util.function.Predicate;
|
|
import java.util.function.Supplier;
|
|
import java.util.stream.Stream;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import org.slf4j.Logger;
|
|
|
|
public class GoalSelector {
|
|
@@ -29,7 +29,7 @@ public class GoalSelector {
|
|
};
|
|
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
|
|
private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
|
|
- private final Supplier<ProfilerFiller> profiler;
|
|
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
|
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
|
|
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
|
|
private int tickCount;
|
|
@@ -37,9 +37,11 @@ public class GoalSelector {
|
|
private int curRate;
|
|
private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector
|
|
|
|
+ /* // Plazma - Completely remove profiler
|
|
public GoalSelector(Supplier<ProfilerFiller> profiler) {
|
|
this.profiler = profiler;
|
|
}
|
|
+ */ // Plazma - Completely remove profiler
|
|
|
|
public void addGoal(int priority, Goal goal) {
|
|
this.availableGoals.add(new WrappedGoal(priority, goal));
|
|
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
index 666fc85bc2079cb367b340f2605f29fe002f4d22..36c60716c6aaa446ff7123a3babafb2edd2266ac 100644
|
|
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
@@ -31,7 +31,7 @@ import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.server.packs.resources.ResourceManager;
|
|
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
|
import net.minecraft.util.GsonHelper;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.Container;
|
|
import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.level.Level;
|
|
@@ -51,7 +51,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
|
super(RecipeManager.GSON, "recipes");
|
|
}
|
|
|
|
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
|
|
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Profiler
|
|
this.hasErrors = false;
|
|
// CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable
|
|
Map<RecipeType<?>, Object2ObjectLinkedOpenHashMap<ResourceLocation, RecipeHolder<?>>> map1 = Maps.newHashMap();
|
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
index e45a5282dc0ea3a35da24c7c3a0c7cda9a773f0c..1a5880ae3c3b17d49f0b083dff66e5619c08ec20 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -39,7 +39,7 @@ import net.minecraft.sounds.SoundSource;
|
|
import net.minecraft.util.AbortableIterationConsumer;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.util.RandomSource;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.DifficultyInstance;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
import net.minecraft.world.damagesource.DamageSources;
|
|
@@ -137,7 +137,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
private final ResourceKey<DimensionType> dimensionTypeId;
|
|
private final Holder<DimensionType> dimensionTypeRegistration;
|
|
public final WritableLevelData levelData;
|
|
- private final Supplier<ProfilerFiller> profiler;
|
|
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
|
public final boolean isClientSide;
|
|
private final WorldBorder worldBorder;
|
|
private final BiomeManager biomeManager;
|
|
@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
|
|
|
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma
|
|
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder/*, Supplier<ProfilerFiller> supplier*/, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.LevelConfigurations> plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma // Plazma - Completely remove profiler
|
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
|
this.plazmaLevelConfiguration = plazmaLevelConfigurationCreator.apply(this.spigotConfig); // Plazma
|
|
@@ -276,7 +276,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
}
|
|
|
|
// CraftBukkit end
|
|
- this.profiler = supplier;
|
|
+ //this.profiler = supplier; // Plazma - Completely remove profiler
|
|
this.levelData = worlddatamutable;
|
|
this.dimensionTypeRegistration = holder;
|
|
this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> {
|
|
@@ -1830,6 +1830,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
return false;
|
|
}
|
|
|
|
+ /* // Plazma - Completely remove profiler
|
|
public ProfilerFiller getProfiler() {
|
|
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
|
|
return (ProfilerFiller) this.profiler.get();
|
|
@@ -1838,6 +1839,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
public Supplier<ProfilerFiller> getProfilerSupplier() {
|
|
return this.profiler;
|
|
}
|
|
+ */ // Plazma - Completely remove profiler
|
|
|
|
@Override
|
|
public BiomeManager getBiomeManager() {
|
|
diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
|
index 0f1025495237aebe30132ace0832aa5718d6f9bb..0226280bbdb9d63831d93f980ee117da1eac08aa 100644
|
|
--- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
|
|
@@ -8,7 +8,7 @@ import net.minecraft.core.BlockPos;
|
|
import net.minecraft.core.Holder;
|
|
import net.minecraft.core.SectionPos;
|
|
import net.minecraft.core.registries.Registries;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.level.biome.Biome;
|
|
@@ -155,7 +155,9 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
|
|
return this.level.getHeight();
|
|
}
|
|
|
|
+ /* // Plazma - Completely remove profiler
|
|
public ProfilerFiller getProfiler() {
|
|
return this.level.getProfiler();
|
|
}
|
|
+ */ // Plazma - Completely remove profiler
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
index 8d385708df97d47881929d4352f1b90286aad1a2..a25b93f98b2c525b146c979df2a95a9a749300a8 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -25,7 +25,7 @@ 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.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.level.ChunkPos;
|
|
import net.minecraft.world.level.Level;
|
|
@@ -445,7 +445,7 @@ public class LevelChunk extends ChunkAccess {
|
|
}
|
|
|
|
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
|
|
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
|
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Plazma - Completely remove profiler
|
|
|
|
//gameprofilerfiller.push("updateSkyLightSources"); // Purpur
|
|
this.skyLightSources.update(this, j, i, l);
|
|
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..b9689131a7a46b46c0b75b86f2bb163d7de74921 100644
|
|
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
|
@@ -12,7 +12,7 @@ import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import javax.annotation.Nullable;
|
|
import net.minecraft.core.BlockPos;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.util.profiling.metrics.MetricCategory;
|
|
import net.minecraft.world.entity.Mob;
|
|
import net.minecraft.world.level.PathNavigationRegion;
|
|
@@ -44,7 +44,7 @@ public class PathFinder {
|
|
map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos));
|
|
}
|
|
// Paper end
|
|
- Path path = this.findPath(world.getProfiler(), node, map, followRange, distance, rangeMultiplier);
|
|
+ Path path = this.findPath(/*world.getProfiler(), */node, map, followRange, distance, rangeMultiplier); // Plazma - Completely remove profiler
|
|
this.nodeEvaluator.done();
|
|
return path;
|
|
}
|
|
@@ -52,7 +52,7 @@ public class PathFinder {
|
|
|
|
@Nullable
|
|
// Paper start - optimize collection
|
|
- private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
|
|
+ private Path findPath(/*ProfilerFiller profiler, */Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) { // Plazma - Completely remove profiler
|
|
//profiler.push("find_path"); // Purpur
|
|
//profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur
|
|
// Set<Target> set = positions.keySet();
|
|
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
|
index dd375fffa727db76fa989248b9b836960974c372..45161f960a29395538c67461ebf864e595f6737f 100644
|
|
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
|
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
|
|
@@ -19,7 +19,7 @@ import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
|
import net.minecraft.server.packs.resources.ResourceManager;
|
|
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
|
import org.slf4j.Logger;
|
|
|
|
@@ -35,7 +35,7 @@ public class LootDataManager implements PreparableReloadListener, LootDataResolv
|
|
public LootDataManager() {}
|
|
|
|
@Override
|
|
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
|
|
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
|
|
Map<LootDataType<?>, Map<ResourceLocation, ?>> map = new HashMap();
|
|
CompletableFuture<?>[] acompletablefuture = (CompletableFuture[]) LootDataType.values().map((lootdatatype) -> {
|
|
return LootDataManager.scheduleElementParse(lootdatatype, manager, prepareExecutor, map);
|
|
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
|
index 0043c0087896a6df6910b0500da37d84b287c901..a7b4d38bf7d2f8c1ba42d64b7ffd577d6fca5378 100644
|
|
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
|
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
|
@@ -23,7 +23,7 @@ import net.minecraft.Util;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.core.SectionPos;
|
|
import net.minecraft.core.Vec3i;
|
|
-import net.minecraft.util.profiling.ProfilerFiller;
|
|
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
|
|
import net.minecraft.world.level.ChunkPos;
|
|
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
|
|
|
@@ -32,7 +32,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
|
return ScheduledTick.INTRA_TICK_DRAIN_ORDER.compare(a.peek(), b.peek());
|
|
};
|
|
private final LongPredicate tickCheck;
|
|
- private final Supplier<ProfilerFiller> profiler;
|
|
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
|
|
private final Long2ObjectMap<LevelChunkTicks<T>> allContainers = new Long2ObjectOpenHashMap<>();
|
|
private final Long2LongMap nextTickForContainer = Util.make(new Long2LongOpenHashMap(), (map) -> {
|
|
map.defaultReturnValue(Long.MAX_VALUE);
|
|
@@ -48,9 +48,9 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
|
|
|
};
|
|
|
|
- public LevelTicks(LongPredicate tickingFutureReadyPredicate, Supplier<ProfilerFiller> profilerGetter) {
|
|
+ public LevelTicks(LongPredicate tickingFutureReadyPredicate/*, Supplier<ProfilerFiller> profilerGetter*/) {
|
|
this.tickCheck = tickingFutureReadyPredicate;
|
|
- this.profiler = profilerGetter;
|
|
+ //this.profiler = profilerGetter; // Plazma - Completely remove profiler
|
|
}
|
|
|
|
public void addContainer(ChunkPos pos, LevelChunkTicks<T> scheduler) {
|
|
@@ -88,7 +88,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
|
public void tick(long time, int maxTicks, BiConsumer<BlockPos, T> ticker) {
|
|
//ProfilerFiller profilerFiller = this.profiler.get(); // Purpur
|
|
//profilerFiller.push("collect"); // Purpur
|
|
- this.collectTicks(time, maxTicks, null); // Purpur
|
|
+ this.collectTicks(time, maxTicks); // Purpur // Plazma - Completely remove profiler
|
|
//profilerFiller.popPush("run"); // Purpur
|
|
//profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur
|
|
this.runCollectedTicks(ticker);
|
|
@@ -97,7 +97,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
|
|
//profilerFiller.pop(); // Purpur
|
|
}
|
|
|
|
- private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) {
|
|
+ private void collectTicks(long time, int maxTicks/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
|
|
this.sortContainersToTick(time);
|
|
//profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur
|
|
this.drainContainers(time, maxTicks);
|