Files
AkarinMC/patches/server/0011-Remove-vanilla-profiler-callers.patch
ㄗㄠˋ ㄑㄧˊ 6f26a671b5 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
26fb7cc35 Fix Chunk Post Processing deadlock risk
ffecc4e26 Revert "Optimize entity list iteration requiring entities be in"
0a4286cc4 Prevent Fire from loading chunks
07915ea18 Add Player Client Options API (#2883)
bc48a3172 Optimize entity list iteration requiring entities be in  loaded chunks
88092fef1 Optimize ChunkProviderServer's chunk level checking helper methods
01e8ce8d2 Forced Watchdog Crash support and Improve Async Shutdown
fdb8fe780 Be less strict with vanilla teleport command limits
0f06d3806 Restrict vanilla teleport command to within worldborder
24d93aafa Fix Optional null issue - Fixes #3155
eb71c5fa3 Fix incorect timing of mspt
1ca804342 Optimise entity hard collision checking
b67a42376 Don't run entity collision code if not needed
bd9aa547d Optimise ArraySetSorted#removeIf
2020-04-18 18:05:03 +08:00

1366 lines
71 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sotr <i@omc.hk>
Date: Wed, 15 Apr 2020 22:18:01 +0700
Subject: [PATCH] Remove vanilla profiler callers
diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java
index ce653f6b4be3ab6c6d35cb3e9222e7f8c8759e25..21e28b98b4efc792dc187d77cde262ea3077f14c 100644
--- a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java
+++ b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java
@@ -271,7 +271,7 @@ public final class PaperTickList<T> extends TickListServer<T> { // extend to avo
public void tick() {
final ChunkProviderServer chunkProvider = this.world.getChunkProvider();
- this.world.getMethodProfiler().enter("cleaning");
+ // this.world.getMethodProfiler().enter("cleaning"); // Akarin - remove caller
this.timingCleanup.startTiming();
this.prepare();
@@ -282,7 +282,7 @@ public final class PaperTickList<T> extends TickListServer<T> { // extend to avo
this.nextTick = this.world.getTime() + 1;
this.timingCleanup.stopTiming();
- this.world.getMethodProfiler().exitEnter("ticking");
+ // this.world.getMethodProfiler().exitEnter("ticking"); // Akarin - remove caller
this.timingTicking.startTiming();
for (final NextTickListEntry<T> toTick : this.toTickThisTick) {
@@ -314,7 +314,7 @@ public final class PaperTickList<T> extends TickListServer<T> { // extend to avo
}
this.timingTicking.stopTiming();
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
this.timingFinished.startTiming();
// finished ticking, actual cleanup time
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index ba6bdc40a73e4d3221cc08e947a6d629a126c5ee..bf6bf7d8c6c7e2d8572a33ed16767d8ba34156e7 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -368,9 +368,9 @@ public class ChunkProviderServer extends IChunkProvider {
return ifLoaded;
}
// Paper end
- GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
+ // GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); // Akarin - remove caller
- gameprofilerfiller.c("getChunk");
+ // gameprofilerfiller.c("getChunk"); // Akarin - remove caller
long k = ChunkCoordIntPair.pair(i, j);
IChunkAccess ichunkaccess;
@@ -384,7 +384,7 @@ public class ChunkProviderServer extends IChunkProvider {
}
}
- gameprofilerfiller.c("getChunkCacheMiss");
+ // gameprofilerfiller.c("getChunkCacheMiss"); // Akarin - remove caller
// Paper start - Chunk Load/Gen Priority
boolean prevBlocking = IS_CHUNK_LOAD_BLOCKING_MAIN;
IS_CHUNK_LOAD_BLOCKING_MAIN = true;
@@ -458,12 +458,16 @@ public class ChunkProviderServer extends IChunkProvider {
// CraftBukkit end
this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
if (this.a(playerchunk, l)) {
+ // Akarin start - remove caller
+ /*
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
gameprofilerfiller.enter("chunkLoad");
+ */
+ // Akarin end
this.tickDistanceManager();
playerchunk = this.getChunk(k);
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
if (this.a(playerchunk, l)) {
throw (IllegalStateException) SystemUtils.c(new IllegalStateException("No chunk holder after ticket has been added"));
}
@@ -612,33 +616,33 @@ public class ChunkProviderServer extends IChunkProvider {
// CraftBukkit start - modelled on below
public void purgeUnload() {
- this.world.getMethodProfiler().enter("purge");
+ // this.world.getMethodProfiler().enter("purge"); // Akarin - remove caller
this.chunkMapDistance.purgeTickets();
this.tickDistanceManager();
- this.world.getMethodProfiler().exitEnter("unload");
+ // this.world.getMethodProfiler().exitEnter("unload"); // Akarin - remove caller
this.playerChunkMap.unloadChunks(() -> true);
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
this.clearCache();
}
// CraftBukkit end
public void tick(BooleanSupplier booleansupplier) {
- this.world.getMethodProfiler().enter("purge");
+ // this.world.getMethodProfiler().enter("purge"); // Akarin - remove caller
this.world.timings.doChunkMap.startTiming(); // Spigot
this.chunkMapDistance.purgeTickets();
this.world.getMinecraftServer().midTickLoadChunks(); // Paper
this.tickDistanceManager();
this.world.timings.doChunkMap.stopTiming(); // Spigot
- this.world.getMethodProfiler().exitEnter("chunks");
+ // this.world.getMethodProfiler().exitEnter("chunks"); // Akarin - remove caller
this.world.timings.chunks.startTiming(); // Paper - timings
this.tickChunks();
this.world.timings.chunks.stopTiming(); // Paper - timings
this.world.timings.doChunkUnload.startTiming(); // Spigot
- this.world.getMethodProfiler().exitEnter("unload");
+ // this.world.getMethodProfiler().exitEnter("unload"); // Akarin - remove caller
this.playerChunkMap.unloadChunks(booleansupplier);
this.world.getMinecraftServer().midTickLoadChunks(); // Paper
this.world.timings.doChunkUnload.stopTiming(); // Spigot
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
this.clearCache();
}
@@ -652,7 +656,7 @@ public class ChunkProviderServer extends IChunkProvider {
boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && !world.getPlayers().isEmpty(); // CraftBukkit
if (!flag) {
- this.world.getMethodProfiler().enter("pollingChunks");
+ // this.world.getMethodProfiler().enter("pollingChunks"); // Akarin - remove caller
int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED);
BlockPosition blockposition = this.world.getSpawn();
// CraftBukkit start - Other mob type spawn tick rate
@@ -663,7 +667,7 @@ public class ChunkProviderServer extends IChunkProvider {
boolean flag2 = spawnAnimalThisTick;
// CraftBukkit end
- this.world.getMethodProfiler().enter("naturalSpawnCount");
+ // this.world.getMethodProfiler().enter("naturalSpawnCount"); // Akarin - remove caller
this.world.timings.countNaturalMobs.startTiming(); // Paper - timings
int l = this.chunkMapDistance.b();
EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
@@ -685,7 +689,7 @@ public class ChunkProviderServer extends IChunkProvider {
// Paper end
this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
//Paper start - call player naturally spawn event
int chunkRange = world.spigotConfig.mobSpawnRange;
chunkRange = (chunkRange > world.spigotConfig.viewDistance) ? (byte) world.spigotConfig.viewDistance : chunkRange;
@@ -701,18 +705,18 @@ public class ChunkProviderServer extends IChunkProvider {
if (optional.isPresent()) {
Chunk chunk = (Chunk) optional.get();
- this.world.getMethodProfiler().enter("broadcast");
+ // this.world.getMethodProfiler().enter("broadcast"); // Akarin - remove caller
this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
playerchunk.a(chunk);
this.world.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
if (!this.playerChunkMap.isOutsideOfRange(chunkcoordintpair)) {
// Paper end
chunk.setInhabitedTime(chunk.getInhabitedTime() + j);
if (flag1 && (this.allowMonsters || this.allowAnimals) && this.world.getWorldBorder().isInBounds(chunk.getPos()) && !this.playerChunkMap.isOutsideOfRange(chunkcoordintpair, true)) { // Spigot
- this.world.getMethodProfiler().enter("spawner");
+ // this.world.getMethodProfiler().enter("spawner"); // Akarin - remove caller
this.world.timings.mobSpawn.startTiming(); // Spigot
EnumCreatureType[] aenumcreaturetype1 = aenumcreaturetype;
int i1 = aenumcreaturetype.length;
@@ -772,7 +776,7 @@ public class ChunkProviderServer extends IChunkProvider {
}
this.world.timings.mobSpawn.stopTiming(); // Spigot
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
@@ -782,15 +786,15 @@ public class ChunkProviderServer extends IChunkProvider {
}
}
});
- this.world.getMethodProfiler().enter("customSpawners");
+ // this.world.getMethodProfiler().enter("customSpawners"); // Akarin - remove caller
if (flag1) {
try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
this.chunkGenerator.doMobSpawning(this.world, this.allowMonsters, this.allowAnimals);
} // Paper - timings
}
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
this.playerChunkMap.g();
@@ -916,7 +920,7 @@ public class ChunkProviderServer extends IChunkProvider {
@Override
protected void executeTask(Runnable runnable) {
- ChunkProviderServer.this.world.getMethodProfiler().c("runTask");
+ // ChunkProviderServer.this.world.getMethodProfiler().c("runTask"); // Akarin - remove caller
super.executeTask(runnable);
}
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
index 2414b0a552e5d6fb449bca163add7a9bac39e943..1b0a878d2a186bceba11b08ef28c1c040d4d78ce 100644
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
@@ -168,7 +168,7 @@ public class CommandDispatcher {
stringreader.skip();
}
- commandlistenerwrapper.getServer().getMethodProfiler().enter(s);
+ // commandlistenerwrapper.getServer().getMethodProfiler().enter(s); // Akarin - remove caller
byte b0;
@@ -231,7 +231,7 @@ public class CommandDispatcher {
b0 = 0;
}
} finally {
- commandlistenerwrapper.getServer().getMethodProfiler().exit();
+ // commandlistenerwrapper.getServer().getMethodProfiler().exit(); // Akarin - remove caller
}
return b0;
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
index ee42e1dfa493c3d7f5af8cc7b8e17e80fcb32b71..68dc7cdfbca341234245d0b8c1643f56a1beac06 100644
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
@@ -58,10 +58,10 @@ public class CustomFunctionData implements IResourcePackListener {
}
public void tick() {
- GameProfiler gameprofiler = this.server.getMethodProfiler();
+ // GameProfiler gameprofiler = this.server.getMethodProfiler(); // Akarin - remove caller
MinecraftKey minecraftkey = CustomFunctionData.d;
- gameprofiler.a(minecraftkey::toString);
+ // gameprofiler.a(minecraftkey::toString); // Akarin - remove caller
Iterator iterator = this.l.iterator();
while (iterator.hasNext()) {
@@ -70,14 +70,14 @@ public class CustomFunctionData implements IResourcePackListener {
this.a(customfunction, this.f());
}
- this.server.getMethodProfiler().exit();
+ // this.server.getMethodProfiler().exit(); // Akarin - remove caller
if (this.m) {
this.m = false;
Collection<CustomFunction> collection = this.h().b(CustomFunctionData.e).a();
- gameprofiler = this.server.getMethodProfiler();
+ // gameprofiler = this.server.getMethodProfiler(); // Akarin - remove caller
minecraftkey = CustomFunctionData.e;
- gameprofiler.a(minecraftkey::toString);
+ // gameprofiler.a(minecraftkey::toString); // Akarin - remove caller
Iterator iterator1 = collection.iterator();
while (iterator1.hasNext()) {
@@ -86,7 +86,7 @@ public class CustomFunctionData implements IResourcePackListener {
this.a(customfunction1, this.f());
}
- this.server.getMethodProfiler().exit();
+ // this.server.getMethodProfiler().exit(); // Akarin - remove caller
}
}
@@ -121,7 +121,7 @@ public class CustomFunctionData implements IResourcePackListener {
try {
CustomFunctionData.a customfunctiondata_a = (CustomFunctionData.a) this.i.removeFirst();
- this.server.getMethodProfiler().a(customfunctiondata_a::toString);
+ // this.server.getMethodProfiler().a(customfunctiondata_a::toString); // Akarin - remove caller
customfunctiondata_a.a(this.i, i);
if (!this.j.isEmpty()) {
List list = Lists.reverse(this.j);
@@ -132,7 +132,7 @@ public class CustomFunctionData implements IResourcePackListener {
this.j.clear();
}
} finally {
- this.server.getMethodProfiler().exit();
+ // this.server.getMethodProfiler().exit(); // Akarin - remove caller
}
++k;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 96a47dd1c2d3c89b4061fe96210e768c12b73ca0..98eeb2a4a09e7653a8d050df5b1c8a1d457b1e94 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -429,7 +429,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
// CraftBukkit end
public void entityBaseTick() {
- this.world.getMethodProfiler().enter("entityBaseTick");
+ // this.world.getMethodProfiler().enter("entityBaseTick"); // Akarin - remove caller
if (this.isPassenger() && this.getVehicle().dead) {
this.stopRiding();
}
@@ -482,7 +482,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
this.justCreated = false;
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
// Paper start
@@ -597,7 +597,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
}
- this.world.getMethodProfiler().enter("move");
+ // this.world.getMethodProfiler().enter("move"); // Akarin - remove caller
if (this.y.g() > 1.0E-7D) {
vec3d = vec3d.h(this.y);
this.y = Vec3D.a;
@@ -606,7 +606,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
// Paper start - ignore movement changes while inactive.
if (isTemporarilyActive && !(this instanceof EntityItem) && vec3d == getMot() && enummovetype == EnumMoveType.SELF) {
setMot(Vec3D.a);
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
return;
}
// Paper end
@@ -619,8 +619,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.recalcPosition();
}
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("rest");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("rest"); // Akarin - remove caller
this.positionChanged = !MathHelper.b(vec3d.x, vec3d1.x) || !MathHelper.b(vec3d.z, vec3d1.z);
this.v = vec3d.y != vec3d1.y;
this.onGround = this.v && vec3d.y < 0.0D;
@@ -742,7 +742,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.fireTicks = -this.getMaxFireTicks();
}
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
}
@@ -2243,7 +2243,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
if (this.af) {
if ((true || this.world.getMinecraftServer().getAllowNether()) && !this.isPassenger() && this.ag++ >= i) { // CraftBukkit
- this.world.getMethodProfiler().enter("portal");
+ // this.world.getMethodProfiler().enter("portal"); // Akarin - remove caller
this.ag = i;
this.portalCooldown = this.ba();
// CraftBukkit start
@@ -2253,7 +2253,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.a(this.world.worldProvider.getDimensionManager().getType() == DimensionManager.NETHER ? DimensionManager.OVERWORLD : DimensionManager.NETHER);
}
// CraftBukkit end
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
this.af = false;
@@ -2631,7 +2631,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public Entity teleportTo(DimensionManager dimensionmanager, BlockPosition location) {
// CraftBukkit end
if (!this.world.isClientSide && !this.dead) {
- this.world.getMethodProfiler().enter("changeDimension");
+ // this.world.getMethodProfiler().enter("changeDimension"); // Akarin - remove caller
MinecraftServer minecraftserver = this.getMinecraftServer();
DimensionManager dimensionmanager1 = this.dimension;
WorldServer worldserver = minecraftserver.getWorldServer(dimensionmanager1);
@@ -2644,7 +2644,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
// this.dimension = dimensionmanager;
// this.decouple();
// CraftBukkit end
- this.world.getMethodProfiler().enter("reposition");
+ // this.world.getMethodProfiler().enter("reposition"); // Akarin - remove caller
Vec3D vec3d = this.getMot();
float f = 0.0F;
BlockPosition blockposition = location; // CraftBukkit
@@ -2723,7 +2723,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.decouple();
// CraftBukkit end
- this.world.getMethodProfiler().exitEnter("reloading");
+ // this.world.getMethodProfiler().exitEnter("reloading"); // Akarin - remove caller
Entity entity = this.getEntityType().a((World) worldserver1);
if (entity != null) {
@@ -2742,10 +2742,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
this.dead = true;
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
worldserver.resetEmptyTime();
worldserver1.resetEmptyTime();
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
return entity;
} else {
return null;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 1991cee43d429574f2c0889f807e7cd090f7d7dd..bb20398abc65d3f7e54867bdf930480af0941ada 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -223,13 +223,13 @@ public abstract class EntityInsentient extends EntityLiving {
@Override
public void entityBaseTick() {
super.entityBaseTick();
- this.world.getMethodProfiler().enter("mobBaseTick");
+ // this.world.getMethodProfiler().enter("mobBaseTick"); // Akarin - remove caller
if (this.isAlive() && this.random.nextInt(1000) < this.e++) {
this.l();
this.B();
}
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
@Override
@@ -523,7 +523,7 @@ public abstract class EntityInsentient extends EntityLiving {
@Override
public void movementTick() {
super.movementTick();
- this.world.getMethodProfiler().enter("looting");
+ // this.world.getMethodProfiler().enter("looting"); // Akarin - remove caller
if (!this.world.isClientSide && this.canPickupLoot() && this.isAlive() && !this.killed && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
List<EntityItem> list = this.world.a(EntityItem.class, this.getBoundingBox().grow(1.0D, 0.0D, 1.0D));
Iterator iterator = list.iterator();
@@ -542,7 +542,7 @@ public abstract class EntityInsentient extends EntityLiving {
}
}
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
protected void a(EntityItem entityitem) {
@@ -676,30 +676,30 @@ public abstract class EntityInsentient extends EntityLiving {
return;
}
// Paper end
- this.world.getMethodProfiler().enter("sensing");
+ // this.world.getMethodProfiler().enter("sensing"); // Akarin - remove caller
this.bw.a();
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("targetSelector");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("targetSelector"); // Akarin - remove caller
this.targetSelector.doTick();
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("goalSelector");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("goalSelector"); // Akarin - remove caller
this.goalSelector.doTick();
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("navigation");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("navigation"); // Akarin - remove caller
this.navigation.c();
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("mob tick");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("mob tick"); // Akarin - remove caller
this.mobTick();
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("controls");
- this.world.getMethodProfiler().enter("move");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("controls"); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("move"); // Akarin - remove caller
this.moveController.a();
- this.world.getMethodProfiler().exitEnter("look");
+ // this.world.getMethodProfiler().exitEnter("look"); // Akarin - remove caller
this.lookController.a();
- this.world.getMethodProfiler().exitEnter("jump");
+ // this.world.getMethodProfiler().exitEnter("jump"); // Akarin - remove caller
this.bq.b();
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
this.K();
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index dfb9421a15ba1ca7b86146cb795a3ac5e9b8e15e..68504f798efe6e4e5ff2a0a7748b67b9d32601d4 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -242,7 +242,7 @@ public abstract class EntityLiving extends Entity {
}
super.entityBaseTick();
- this.world.getMethodProfiler().enter("livingEntityBaseTick");
+ // this.world.getMethodProfiler().enter("livingEntityBaseTick"); // Akarin - remove caller
boolean flag = this instanceof EntityHuman;
if (this.isAlive()) {
@@ -344,7 +344,7 @@ public abstract class EntityLiving extends Entity {
this.aL = this.aK;
this.lastYaw = this.yaw;
this.lastPitch = this.pitch;
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
protected void b(BlockPosition blockposition) {
@@ -2412,10 +2412,10 @@ public abstract class EntityLiving extends Entity {
}
this.aS += (f3 - this.aS) * 0.3F;
- this.world.getMethodProfiler().enter("headTurn");
+ // this.world.getMethodProfiler().enter("headTurn"); // Akarin - remove caller
f2 = this.f(f1, f2);
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("rangeChecks");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("rangeChecks"); // Akarin - remove caller
while (this.yaw - this.lastYaw < -180.0F) {
this.lastYaw -= 360.0F;
@@ -2449,7 +2449,7 @@ public abstract class EntityLiving extends Entity {
this.aL += 360.0F;
}
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
this.aT += f2;
if (this.isGliding()) {
++this.bm;
@@ -2586,19 +2586,19 @@ public abstract class EntityLiving extends Entity {
}
this.setMot(d4, d5, d6);
- this.world.getMethodProfiler().enter("ai");
+ // this.world.getMethodProfiler().enter("ai"); // Akarin - remove caller
if (this.isFrozen()) {
this.jumping = false;
this.aZ = 0.0F;
this.bb = 0.0F;
} else if (this.doAITick()) {
- this.world.getMethodProfiler().enter("newAi");
+ // this.world.getMethodProfiler().enter("newAi"); // Akarin - remove caller
this.doTick();
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("jump");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("jump"); // Akarin - remove caller
if (this.jumping) {
if (this.N > 0.0D && (!this.onGround || this.N > 0.4D)) {
this.c(TagsFluid.WATER);
@@ -2614,23 +2614,23 @@ public abstract class EntityLiving extends Entity {
this.jumpTicks = 0;
}
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("travel");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("travel"); // Akarin - remove caller
this.aZ *= 0.98F;
this.bb *= 0.98F;
this.n();
AxisAlignedBB axisalignedbb = this.getBoundingBox();
this.e(new Vec3D((double) this.aZ, (double) this.ba, (double) this.bb));
- this.world.getMethodProfiler().exit();
- this.world.getMethodProfiler().enter("push");
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
+ // this.world.getMethodProfiler().enter("push"); // Akarin - remove caller
if (this.bn > 0) {
--this.bn;
this.a(axisalignedbb, this.getBoundingBox());
}
this.collideNearby();
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
private void n() {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 202068314eca435abecc25b2870350c530e0fac5..b4c3dffaff5ea64d9189304c5e84c515bf40ed65 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -826,7 +826,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
double d3 = 8.0D;
float f2 = f1;
- worldserver.getMethodProfiler().enter("moving");
+ // worldserver.getMethodProfiler().enter("moving"); // Akarin - remove caller
if (worldserver1 == null) { } else // CraftBukkit - empty to fall through to null to event
if (dimensionmanager1 == DimensionManager.OVERWORLD && dimensionmanager == DimensionManager.NETHER) {
this.cr = this.getPositionVector();
@@ -867,8 +867,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
// CraftBukkit end
// this.setPositionRotation(d0, d1, d2, f1, f); // CraftBukkit - PlayerTeleportEvent handles position changes
- worldserver.getMethodProfiler().exit();
- worldserver.getMethodProfiler().enter("placing");
+ // worldserver.getMethodProfiler().exit(); // Akarin - remove caller
+ // worldserver.getMethodProfiler().enter("placing"); // Akarin - remove caller
double d4 = Math.min(-2.9999872E7D, worldserver1.getWorldBorder().c() + 16.0D);
double d5 = Math.min(-2.9999872E7D, worldserver1.getWorldBorder().d() + 16.0D);
double d6 = Math.min(2.9999872E7D, worldserver1.getWorldBorder().e() - 16.0D);
@@ -939,7 +939,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
// CraftBukkit end
}
- worldserver.getMethodProfiler().exit();
+ // worldserver.getMethodProfiler().exit(); // Akarin - remove caller
// CraftBukkit start - PlayerTeleportEvent
PlayerTeleportEvent tpEvent = new PlayerTeleportEvent(this.getBukkitEntity(), enter, exit, cause);
Bukkit.getServer().getPluginManager().callEvent(tpEvent);
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 6e0020ae0b4d2f2597843129b83fff0d194de337..a7a07ffc43d4e95af59da1194ae90394580bb242 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -144,9 +144,9 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
@Override
protected void mobTick() {
- this.world.getMethodProfiler().enter("brain");
+ // this.world.getMethodProfiler().enter("brain"); // Akarin - remove caller
this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
if (!this.et() && this.bB > 0) {
--this.bB;
if (this.bB <= 0) {
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index a353f3d5fa5a5f54335f73584589de3f5cb20d3e..5f976a17c7aa36286ee1132597e480f591749a45 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -285,7 +285,7 @@ public class Explosion {
if (!iblockdata.isAir()) {
BlockPosition blockposition1 = blockposition.immutableCopy();
- this.world.getMethodProfiler().enter("explosion_blocks");
+ // this.world.getMethodProfiler().enter("explosion_blocks"); // Akarin - remove caller
if (block.a(this) && this.world instanceof WorldServer) {
TileEntity tileentity = block.isTileEntity() ? this.world.getTileEntity(blockposition) : null;
LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).a(this.world.random).set(LootContextParameters.POSITION, blockposition).set(LootContextParameters.TOOL, ItemStack.a).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity).setOptional(LootContextParameters.THIS_ENTITY, this.source);
@@ -301,7 +301,7 @@ public class Explosion {
this.world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
block.wasExploded(this.world, blockposition, this);
- this.world.getMethodProfiler().exit();
+ // this.world.getMethodProfiler().exit(); // Akarin - remove caller
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index df35fb8065bd0a367e2dbad75e0adca611cad6f1..fba422d39d0e4dc8a1f2fe309a4aea506d68ca1e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -950,18 +950,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.nextTick += 50L;
if (this.T) {
this.T = false;
- this.methodProfiler.d().d();
+ // this.methodProfiler.d().d(); // Akarin - remove caller
}
- this.methodProfiler.a();
- this.methodProfiler.enter("tick");
+ // this.methodProfiler.a(); // Akarin - remove caller
+ // this.methodProfiler.enter("tick"); // Akarin - remove caller
this.a(this::canSleepForTick);
- this.methodProfiler.exitEnter("nextTickWait");
+ // this.methodProfiler.exitEnter("nextTickWait"); // Akarin - remove caller
this.ac = true;
this.ab = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
this.sleepForTick();
- this.methodProfiler.exit();
- this.methodProfiler.b();
+ // this.methodProfiler.exit(); // Akarin - remove caller
+ // this.methodProfiler.b(); // Akarin - remove caller
this.hasTicked = true;
}
} else {
@@ -1106,7 +1106,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
protected void c(TickTask ticktask) {
- this.getMethodProfiler().c("runTask");
+ // this.getMethodProfiler().c("runTask"); // Akarin - remove caller
super.executeTask(ticktask);
}
@@ -1179,7 +1179,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
//if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit // Paper - move down
//MinecraftServer.LOGGER.debug("Autosave started"); // Paper
serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper
- this.methodProfiler.enter("save");
+ // this.methodProfiler.enter("save"); // Akarin - remove caller
if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // Paper
this.playerList.savePlayers();
}// Paper
@@ -1195,11 +1195,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
// Paper end
- this.methodProfiler.exit();
+ //this.methodProfiler.exit(); // Akarin - remove caller
//MinecraftServer.LOGGER.debug("Autosave finished"); // Paper
//} // Paper
- this.methodProfiler.enter("snooper");
+ // this.methodProfiler.enter("snooper"); // Akarin - remove caller
// Akarin - Disable Snooper
/*
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot
@@ -1211,7 +1211,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
*/
- this.methodProfiler.exit();
+ // this.methodProfiler.exit(); // Akarin - remove caller
// Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
@@ -1225,7 +1225,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.ticks, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
// Paper end
- this.methodProfiler.enter("tallying");
+ // this.methodProfiler.enter("tallying"); // Akarin - remove caller
long l = this.f[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i;
this.av = this.av * 0.8F + (float) l / 1000000.0F * 0.19999999F;
@@ -1238,7 +1238,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Paper end
this.circularTimer.a(i1 - i);
- this.methodProfiler.exit();
+ //this.methodProfiler.exit(); // Akarin - remove caller
org.spigotmc.WatchdogThread.tick(); // Spigot
this.slackActivityAccountant.tickEnded(l); // Spigot
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
@@ -1248,11 +1248,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper
this.server.getScheduler().mainThreadHeartbeat(this.ticks); // CraftBukkit
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
- this.methodProfiler.enter("commandFunctions");
+ // this.methodProfiler.enter("commandFunctions"); // Akarin - remove caller
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
this.getFunctionData().tick();
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
- this.methodProfiler.exitEnter("levels");
+ // this.methodProfiler.exitEnter("levels"); // Akarin - remove caller
Iterator iterator = this.getWorlds().iterator();
// CraftBukkit start
@@ -1291,9 +1291,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
+ // Akarin start - remove caller
+ /*
this.methodProfiler.a(() -> {
return worldserver.getWorldData().getName() + " " + IRegistry.DIMENSION_TYPE.getKey(worldserver.worldProvider.getDimensionManager());
});
+ */
+ // Akarin end
/* Drop global time updates
if (this.ticks % 20 == 0) {
this.methodProfiler.enter("timeSync");
@@ -1302,7 +1306,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
// CraftBukkit end */
- this.methodProfiler.enter("tick");
+ // this.methodProfiler.enter("tick"); // Akarin - remove caller
try {
worldserver.timings.doTick.startTiming(); // Spigot
@@ -1322,17 +1326,17 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
throw new ReportedException(crashreport);
}
- this.methodProfiler.exit();
- this.methodProfiler.exit();
+ // this.methodProfiler.exit(); // Akarin - remove caller
+ // this.methodProfiler.exit(); // Akarin - remove caller
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
}
- this.methodProfiler.exitEnter("connection");
+ // this.methodProfiler.exitEnter("connection"); // Akarin - remove caller
MinecraftTimings.connectionTimer.startTiming(); // Spigot
this.getServerConnection().c();
MinecraftTimings.connectionTimer.stopTiming(); // Spigot
- this.methodProfiler.exitEnter("players");
+ // this.methodProfiler.exitEnter("players"); // Akarin - remove caller
MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper
this.playerList.tick();
MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
@@ -1340,7 +1344,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
GameTestHarnessTicker.a.b();
}
- this.methodProfiler.exitEnter("server gui refresh");
+ // this.methodProfiler.exitEnter("server gui refresh"); // Akarin - remove caller
MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
for (int i = 0; i < this.tickables.size(); ++i) {
@@ -1348,7 +1352,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper
- this.methodProfiler.exit();
+ // this.methodProfiler.exit(); // Akarin - remove caller
}
public boolean getAllowNether() {
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index dc32107ec320fa54487f24c9d68ff8e5a6dea1bb..cd8a631d7d3c6fbdd2470635173659f0eddddae2 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -137,14 +137,14 @@ public abstract class NavigationAbstract {
}
}
// Paper end
- this.b.getMethodProfiler().enter("pathfind");
+ // this.b.getMethodProfiler().enter("pathfind"); // Akarin - remove caller
float f = (float) this.p.getValue();
BlockPosition blockposition = flag ? (new BlockPosition(this.a)).up() : new BlockPosition(this.a);
int k = (int) (f + (float) i);
ChunkCache chunkcache = new ChunkCache(this.b, blockposition.b(-k, -k, -k), blockposition.b(k, k, k));
PathEntity pathentity = this.t.a(chunkcache, this.a, set, f, j, this.s);
- this.b.getMethodProfiler().exit();
+ // this.b.getMethodProfiler().exit(); // Akarin - remove caller
if (pathentity != null && pathentity.k() != null) {
this.q = pathentity.k();
this.r = j;
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
index 90319909e55e70dab3999534d836b64c7b5d3df8..c09c5440b3b7ddccf93b131c8b8fc625240c5ba7 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
@@ -77,7 +77,7 @@ public class PathfinderGoalSelector {
private static final PathfinderGoal.Type[] PATHFINDER_GOAL_TYPES = PathfinderGoal.Type.values(); // Paper - remove streams from pathfindergoalselector
public void doTick() {
- this.e.enter("goalCleanup");
+ // this.e.enter("goalCleanup"); // Akarin - remove caller
// Paper start - remove streams from pathfindergoalselector
for (Iterator<PathfinderGoalWrapped> iterator = this.d.iterator(); iterator.hasNext();) {
PathfinderGoalWrapped wrappedGoal = iterator.next();
@@ -96,8 +96,8 @@ public class PathfinderGoalSelector {
}
});
- this.e.exit();
- this.e.enter("goalUpdate");
+ // this.e.exit(); // Akarin - remove caller
+ // this.e.enter("goalUpdate"); // Akarin - remove caller
// Paper start - remove streams from pathfindergoalselector
goal_update_loop: for (Iterator<PathfinderGoalWrapped> iterator = this.d.iterator(); iterator.hasNext();) {
PathfinderGoalWrapped wrappedGoal = iterator.next();
@@ -140,8 +140,8 @@ public class PathfinderGoalSelector {
wrappedGoal.c();
}
// Paper end - remove streams from pathfindergoalselector
- this.e.exit();
- this.e.enter("goalTick");
+ // this.e.exit(); // Akarin - remove caller
+ // this.e.enter("goalTick"); // Akarin - remove caller
// Paper start - remove streams from pathfindergoalselector
for (Iterator<PathfinderGoalWrapped> iterator = this.d.iterator(); iterator.hasNext();) {
PathfinderGoalWrapped wrappedGoal = iterator.next();
@@ -150,7 +150,7 @@ public class PathfinderGoalSelector {
}
}
// Paper end - remove streams from pathfindergoalselector
- this.e.exit();
+ // this.e.exit(); // Akarin - remove caller
}
public Stream<PathfinderGoalWrapped> c() {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 12639dfb94599233e24a0a8b77bc88de81b65e9b..f8ad08cccf25ef26759231c3d26b71d33d010eb8 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -537,20 +537,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private static final double UNLOAD_QUEUE_RESIZE_FACTOR = 0.96; // Spigot
protected void unloadChunks(BooleanSupplier booleansupplier) {
- GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
+ // GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); // Akarin - remove caller
try (Timing ignored = this.world.timings.poiUnload.startTiming()) { // Paper
- gameprofilerfiller.enter("poi");
+ // gameprofilerfiller.enter("poi"); // Akarin - remove caller
this.m.a(booleansupplier);
} // Paper
- gameprofilerfiller.exitEnter("chunk_unload");
+ // gameprofilerfiller.exitEnter("chunk_unload"); // Akarin - remove caller
if (!this.world.isSavingDisabled()) {
try (Timing ignored = this.world.timings.chunkUnload.startTiming()) { // Paper
this.b(booleansupplier);
}// Paper
}
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
}
private void b(BooleanSupplier booleansupplier) {
@@ -761,7 +761,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - Async chunk io
final java.util.function.BiFunction<ChunkRegionLoader.InProgressChunkHolder, Throwable, Either<IChunkAccess, PlayerChunk.Failure>> syncLoadComplete = (chunkHolder, ioThrowable) -> {
try (Timing ignored = this.world.timings.syncChunkLoadTimer.startTimingIfSync()) { // Paper
- this.world.getMethodProfiler().c("chunkLoad");
+ // this.world.getMethodProfiler().c("chunkLoad"); // Akarin - remove caller
if (ioThrowable != null) {
com.destroystokyo.paper.io.IOUtil.rethrow(ioThrowable);
}
@@ -824,9 +824,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
});
this.requestingNeighbor = prevNeighbor; // Paper
+ // Akarin start - remove caller
+ /*
this.world.getMethodProfiler().c(() -> {
return "chunkGenerate " + chunkstatus.d();
});
+ */
+ // Akarin end
return completablefuture.thenComposeAsync((either) -> {
return either.map((list) -> { // Paper - Shut up.
try {
@@ -1100,7 +1104,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
- this.world.getMethodProfiler().c("chunkSave");
+ // this.world.getMethodProfiler().c("chunkSave"); // Akarin - remove caller
} // Paper
try (co.aikar.timings.Timing ignored1 = this.world.timings.chunkSaveDataSerialization.startTiming()) { // Paper
nbttagcompound = ChunkRegionLoader.saveChunk(this.world, ichunkaccess);
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 7929fcc800064fa23b260c3ecbed75f846bb375a..6dfbbc67dd9cc60355dcf5ef751cd1a5b259be6b 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -185,7 +185,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.E = 0;
}
- this.minecraftServer.getMethodProfiler().enter("keepAlive");
+ // this.minecraftServer.getMethodProfiler().enter("keepAlive"); // Akarin - remove caller
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
long currentTime = SystemUtils.getMonotonicMillis();
@@ -207,7 +207,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
// Paper end
- this.minecraftServer.getMethodProfiler().exit();
+ // this.minecraftServer.getMethodProfiler().exit(); // Akarin - remove caller
// CraftBukkit start
for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ;
if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
index 3f1aa5ced697490b5481ba992cf5af5dc98b8166..a7f2dee2c424b5da66a7c86319f6fa3a6a619087 100644
--- a/src/main/java/net/minecraft/server/TickListServer.java
+++ b/src/main/java/net/minecraft/server/TickListServer.java
@@ -65,7 +65,7 @@ public class TickListServer<T> implements TickList<T> {
ChunkProviderServer chunkproviderserver = this.f.getChunkProvider();
Iterator<NextTickListEntry<T>> iterator = this.nextTickList.iterator();
- this.f.getMethodProfiler().enter("cleaning");
+ // this.f.getMethodProfiler().enter("cleaning"); // Akarin - remove caller
this.timingCleanup.startTiming(); // Paper
NextTickListEntry nextticklistentry;
@@ -86,7 +86,7 @@ public class TickListServer<T> implements TickList<T> {
this.timingCleanup.stopTiming(); // Paper
this.timingTicking.startTiming(); // Paper
- this.f.getMethodProfiler().exitEnter("ticking");
+ // this.f.getMethodProfiler().exitEnter("ticking"); // Akarin - remove caller
while ((nextticklistentry = (NextTickListEntry) this.g.poll()) != null) {
if (chunkproviderserver.a(nextticklistentry.a)) {
@@ -105,7 +105,7 @@ public class TickListServer<T> implements TickList<T> {
}
}
- this.f.getMethodProfiler().exit();
+ // this.f.getMethodProfiler().exit(); // Akarin - remove caller
this.timingTicking.stopTiming(); // Paper
this.h.clear();
this.g.clear();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8d043de794d8ce13ed7efef88cfa93e3bc9b57f8..75605d44bc4c051a7afa327a8749a0a67790b165 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -378,9 +378,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
IBlockData iblockdata2 = this.getType(blockposition);
if (iblockdata2 != iblockdata1 && (iblockdata2.b((IBlockAccess) this, blockposition) != iblockdata1.b((IBlockAccess) this, blockposition) || iblockdata2.h() != iblockdata1.h() || iblockdata2.g() || iblockdata1.g())) {
- this.methodProfiler.enter("queueCheckLight");
+ // this.methodProfiler.enter("queueCheckLight"); // Akarin - remove caller
this.getChunkProvider().getLightEngine().a(blockposition);
- this.methodProfiler.exit();
+ // this.methodProfiler.exit(); // Akarin - remove caller
}
/*
@@ -742,9 +742,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
public void tickBlockEntities() {
- GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
+ // GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); // Akarin - remove caller
- gameprofilerfiller.enter("blockEntities");
+ // gameprofilerfiller.enter("blockEntities"); // Akarin - remove caller
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {
// Paper start - Use alternate implementation with faster contains
@@ -777,9 +777,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
if (this.chunkProvider.a(blockposition) && this.getWorldBorder().a(blockposition)) {
try {
+ // Akarin start - remove caller
+ /*
gameprofilerfiller.a(() -> {
return String.valueOf(TileEntityTypes.a(tileentity.getTileType()));
});
+ */
+ // Akarin end
tileentity.tickTimer.startTiming(); // Spigot
if (tileentity.getTileType().isValidBlock(this.getType(blockposition).getBlock())) {
((ITickable) tileentity).tick();
@@ -787,7 +791,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
tileentity.v();
}
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
} catch (Throwable throwable) {
if (throwable instanceof ThreadDeath) throw throwable; // Paper
// Paper start - Prevent tile entity and entity crashes
@@ -824,7 +828,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
timings.tileEntityTick.stopTiming(); // Spigot
timings.tileEntityPending.startTiming(); // Spigot
this.tickingTileEntities = false;
- gameprofilerfiller.exitEnter("pendingBlockEntities");
+ // gameprofilerfiller.exitEnter("pendingBlockEntities"); // Akarin - remove caller
if (!this.tileEntityListPending.isEmpty()) {
for (int i = 0; i < this.tileEntityListPending.size(); ++i) {
TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i);
@@ -857,7 +861,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
timings.tileEntityPending.stopTiming(); // Spigot
co.aikar.timings.TimingHistory.tileEntityTicks += this.tileEntityListTick.size(); // Paper
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
spigotConfig.currentPrimedTnt = 0; // Spigot
}
@@ -1203,7 +1207,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@Override
public List<Entity> getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate<? super Entity> predicate) {
- this.getMethodProfiler().c("getEntities");
+ // this.getMethodProfiler().c("getEntities"); // Akarin - remove caller
List<Entity> list = Lists.newArrayList();
int i = MathHelper.floor((axisalignedbb.minX - 2.0D) / 16.0D);
int j = MathHelper.floor((axisalignedbb.maxX + 2.0D) / 16.0D);
@@ -1224,7 +1228,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
public <T extends Entity> List<T> a(@Nullable EntityTypes<T> entitytypes, AxisAlignedBB axisalignedbb, Predicate<? super T> predicate) {
- this.getMethodProfiler().c("getEntities");
+ // this.getMethodProfiler().c("getEntities"); // Akarin - remove caller
int i = MathHelper.floor((axisalignedbb.minX - 2.0D) / 16.0D);
int j = MathHelper.f((axisalignedbb.maxX + 2.0D) / 16.0D);
int k = MathHelper.floor((axisalignedbb.minZ - 2.0D) / 16.0D);
@@ -1246,7 +1250,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@Override
public <T extends Entity> List<T> a(Class<? extends T> oclass, AxisAlignedBB axisalignedbb, @Nullable Predicate<? super T> predicate) {
- this.getMethodProfiler().c("getEntities");
+ // this.getMethodProfiler().c("getEntities"); // Akarin - remove caller
int i = MathHelper.floor((axisalignedbb.minX - 2.0D) / 16.0D);
int j = MathHelper.f((axisalignedbb.maxX + 2.0D) / 16.0D);
int k = MathHelper.floor((axisalignedbb.minZ - 2.0D) / 16.0D);
@@ -1269,7 +1273,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@Override
public <T extends Entity> List<T> b(Class<? extends T> oclass, AxisAlignedBB axisalignedbb, @Nullable Predicate<? super T> predicate) {
- this.getMethodProfiler().c("getLoadedEntities");
+ // this.getMethodProfiler().c("getLoadedEntities"); // Akarin - remove caller
int i = MathHelper.floor((axisalignedbb.minX - 2.0D) / 16.0D);
int j = MathHelper.f((axisalignedbb.maxX + 2.0D) / 16.0D);
int k = MathHelper.floor((axisalignedbb.minZ - 2.0D) / 16.0D);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a0db38b5880c849514b89f8b47648de0e5b1273f..78fdacdaf119b9c3fab477ee98089bbad5da2d73 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -274,12 +274,12 @@ public class WorldServer extends World {
}
public void doTick(BooleanSupplier booleansupplier) {
- GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
+ // GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); // Akarin - remove caller
this.ticking = true;
- gameprofilerfiller.enter("world border");
+ // gameprofilerfiller.enter("world border"); // Akarin - remove caller
this.getWorldBorder().s();
- gameprofilerfiller.exitEnter("weather");
+ // gameprofilerfiller.exitEnter("weather"); // Akarin - remove caller
boolean flag = this.isRaining();
int i;
@@ -418,11 +418,11 @@ public class WorldServer extends World {
this.N();
this.a();
- gameprofilerfiller.exitEnter("chunkSource");
+ // gameprofilerfiller.exitEnter("chunkSource"); // Akarin - remove caller
this.timings.chunkProviderTick.startTiming(); // Paper - timings
this.getChunkProvider().tick(booleansupplier);
this.timings.chunkProviderTick.stopTiming(); // Paper - timings
- gameprofilerfiller.exitEnter("tickPending");
+ // gameprofilerfiller.exitEnter("tickPending"); // Akarin - remove caller
timings.scheduledBlocks.startTiming(); // Spigot
if (this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES) {
this.nextTickListBlock.b();
@@ -431,7 +431,7 @@ public class WorldServer extends World {
timings.scheduledBlocks.stopTiming(); // Spigot
this.getMinecraftServer().midTickLoadChunks(); // Paper
- gameprofilerfiller.exitEnter("raid");
+ // gameprofilerfiller.exitEnter("raid"); // Akarin - remove caller
this.timings.raids.startTiming(); // Paper - timings
this.persistentRaid.a();
if (this.mobSpawnerTrader != null) {
@@ -439,13 +439,13 @@ public class WorldServer extends World {
}
this.timings.raids.stopTiming(); // Paper - timings
- gameprofilerfiller.exitEnter("blockEvents");
+ // gameprofilerfiller.exitEnter("blockEvents"); // Akarin - remove caller
timings.doSounds.startTiming(); // Spigot
this.ad();
timings.doSounds.stopTiming(); // Spigot
this.getMinecraftServer().midTickLoadChunks(); // Paper
this.ticking = false;
- gameprofilerfiller.exitEnter("entities");
+ // gameprofilerfiller.exitEnter("entities"); // Akarin - remove caller
boolean flag3 = true || !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
if (flag3) {
@@ -455,7 +455,7 @@ public class WorldServer extends World {
if (flag3 || this.emptyTime++ < 300) {
timings.tickEntities.startTiming(); // Spigot
this.worldProvider.j();
- gameprofilerfiller.enter("global");
+ // gameprofilerfiller.enter("global"); // Akarin - remove caller
Entity entity;
@@ -475,7 +475,7 @@ public class WorldServer extends World {
}
}
- gameprofilerfiller.exitEnter("regular");
+ // gameprofilerfiller.exitEnter("regular"); // Akarin - remove caller
this.tickingEntities = true;
ObjectIterator objectiterator = this.entitiesById.int2ObjectEntrySet().iterator();
@@ -497,12 +497,12 @@ public class WorldServer extends World {
}
// CraftBukkit end */
- gameprofilerfiller.enter("checkDespawn");
+ // gameprofilerfiller.enter("checkDespawn"); // Akarin - remove caller
if (!entity1.dead) {
entity1.checkDespawn();
}
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
if (entity2 != null) {
if (!entity2.dead && entity2.w(entity1)) {
continue;
@@ -511,20 +511,24 @@ public class WorldServer extends World {
entity1.stopRiding();
}
- gameprofilerfiller.enter("tick");
+ // gameprofilerfiller.enter("tick"); // Akarin - remove caller
if (!entity1.dead && !(entity1 instanceof EntityComplexPart)) {
this.a(this::entityJoinedWorld, entity1);
}
+ // Akarin start - remove caller
+ /*
gameprofilerfiller.exit();
gameprofilerfiller.enter("remove");
+ */
+ // Akarin end
if (entity1.dead) {
this.removeEntityFromChunk(entity1);
objectiterator.remove();
this.unregisterEntity(entity1);
}
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
}
timings.entityTick.stopTiming(); // Spigot
@@ -548,14 +552,14 @@ public class WorldServer extends World {
}
} // Paper - timings
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
timings.tickEntities.stopTiming(); // Spigot
this.getMinecraftServer().midTickLoadChunks(); // Paper
this.tickBlockEntities();
this.getMinecraftServer().midTickLoadChunks(); // Paper
}
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
}
private void wakeupPlayers() {
@@ -574,9 +578,9 @@ public class WorldServer extends World {
boolean flag = this.isRaining();
int j = chunkcoordintpair.d();
int k = chunkcoordintpair.e();
- GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
+ // GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
- gameprofilerfiller.enter("thunder");
+ // gameprofilerfiller.enter("thunder"); // Akarin - remove caller
final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
if (!this.paperConfig.disableThunder && flag && this.U() && this.randomTickRandom.nextInt(100000) == 0) { // Paper - Disable thunder // Paper - optimise random ticking
@@ -598,7 +602,7 @@ public class WorldServer extends World {
}
}
- gameprofilerfiller.exitEnter("iceandsnow");
+ // gameprofilerfiller.exitEnter("iceandsnow"); // Akarin - remove caller
if (!this.paperConfig.disableIceAndSnow && this.randomTickRandom.nextInt(16) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking
// Paper start - optimise chunk ticking
this.getRandomBlockPosition(j, 0, k, 15, blockposition);
@@ -629,7 +633,7 @@ public class WorldServer extends World {
}
// Paper start - optimise random block ticking
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
int blocks = chunk.tickingList.size();
if (i > 0 && blocks > 0) {
if ((this.randomTickRandom.nextInt() & (16 * 16 * 256 - 1)) > blocks) {
@@ -639,12 +643,12 @@ public class WorldServer extends World {
// Note: The number of blocks that get ticked per tick still REMAIN the same.
return;
}
- gameprofilerfiller.enter("tickBlocks");
+ // gameprofilerfiller.enter("tickBlocks"); // Akarin - remove caller
timings.chunkTicksBlocks.startTiming(); // Paper
int toTick = i << 4; // i * 16
- gameprofilerfiller.enter("randomTick");
+ // gameprofilerfiller.enter("randomTick"); // Akarin - remove caller
for (int tick = 0; tick < toTick; ++tick) {
int tickingSize = chunk.tickingList.size();
if (tickingSize == 0) {
@@ -669,9 +673,9 @@ public class WorldServer extends World {
// TODO CHECK ON UPDATE
}
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
timings.chunkTicksBlocks.stopTiming(); // Paper
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
// Paper end
}
}
@@ -785,15 +789,19 @@ public class WorldServer extends World {
entity.lastPitch = entity.pitch;
if (entity.inChunk) {
++entity.ticksLived;
+ // Akarin start - remove caller
+ /*
GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
gameprofilerfiller.a(() -> {
return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString();
});
gameprofilerfiller.c("tickNonPassenger");
+ */
+ // Akarin end
entity.tick();
entity.postTick(); // CraftBukkit
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
}
this.chunkCheck(entity);
@@ -821,14 +829,18 @@ public class WorldServer extends World {
entity1.lastPitch = entity1.pitch;
if (entity1.inChunk) {
++entity1.ticksLived;
+ // Akarin start - remove caller
+ /*
GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
gameprofilerfiller.a(() -> {
return IRegistry.ENTITY_TYPE.getKey(entity1.getEntityType()).toString();
});
gameprofilerfiller.c("tickPassenger");
+ */
+ // Akarin end
entity1.passengerTick();
- gameprofilerfiller.exit();
+ // gameprofilerfiller.exit(); // Akarin - remove caller
}
this.chunkCheck(entity1);
@@ -849,7 +861,7 @@ public class WorldServer extends World {
}
public void chunkCheck(Entity entity) {
- this.getMethodProfiler().enter("chunkCheck");
+ // this.getMethodProfiler().enter("chunkCheck"); // Akarin - remove caller
int i = MathHelper.floor(entity.locX() / 16.0D);
int j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY() / 16.0D))); // Paper - stay consistent with chunk add/remove behavior;
int k = MathHelper.floor(entity.locZ() / 16.0D);
@@ -866,7 +878,7 @@ public class WorldServer extends World {
}
}
- this.getMethodProfiler().exit();
+ // this.getMethodProfiler().exit(); // Akarin - remove caller
}
@Override