Current progress - Leaf, tag your it
This commit is contained in:
@@ -717,10 +717,10 @@ diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/m
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -0,0 +0,0 @@ public class Block implements IMaterial {
|
||||
protected final boolean q;
|
||||
protected final SoundEffectType stepSound;
|
||||
protected final Material material;
|
||||
@@ -0,0 +0,0 @@ public class Block extends BlockBase implements IMaterial {
|
||||
private static final VoxelShape c = a(7.0D, 0.0D, 7.0D, 9.0D, 10.0D, 9.0D);
|
||||
protected final BlockStateList<Block, IBlockData> blockStateList;
|
||||
private IBlockData blockData;
|
||||
+ // Paper start
|
||||
+ public co.aikar.timings.Timing timing;
|
||||
+ public co.aikar.timings.Timing getTiming() {
|
||||
@@ -730,9 +730,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return timing;
|
||||
+ }
|
||||
+ // Paper end
|
||||
protected final MaterialMapColor t;
|
||||
private final float frictionFactor;
|
||||
private final float f;
|
||||
@Nullable
|
||||
private String name;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -794,49 +794,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.world.getMethodProfiler().exitEnter("unload");
|
||||
this.playerChunkMap.unloadChunks(booleansupplier);
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
// CraftBukkit end
|
||||
boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit
|
||||
|
||||
this.world.getMethodProfiler().enter("naturalSpawnCount");
|
||||
+ this.world.timings.countNaturalMobs.startTiming(); // Paper - timings
|
||||
int l = this.chunkMapDistance.b();
|
||||
EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
|
||||
Object2IntMap<EnumCreatureType> object2intmap = this.world.l();
|
||||
|
||||
SpawnerCreature.d spawnercreature_d = SpawnerCreature.a(l, this.world.z(), this::a);
|
||||
+ this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
||||
this.world.getMethodProfiler().exit();
|
||||
this.playerChunkMap.f().forEach((playerchunk) -> {
|
||||
Optional<Chunk> optional = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
Chunk chunk = (Chunk) optional.get();
|
||||
|
||||
this.p = spawnercreature_d;
|
||||
this.world.getMethodProfiler().exit();
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
|
||||
if (optional.isPresent()) {
|
||||
this.world.getMethodProfiler().enter("broadcast");
|
||||
+ this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
|
||||
playerchunk.a(chunk);
|
||||
playerchunk.a((Chunk) optional.get());
|
||||
+ this.world.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings
|
||||
this.world.getMethodProfiler().exit();
|
||||
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
||||
Optional<Chunk> optional1 = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
||||
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");
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
SpawnerCreature.a(this.world, chunk, spawnercreature_d, this.allowAnimals, this.allowMonsters, flag2);
|
||||
}
|
||||
|
||||
- this.world.timings.doTickTiles.startTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
this.world.a(chunk, k);
|
||||
- this.world.timings.doTickTiles.stopTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
- this.world.timings.doTickTiles.startTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
this.world.a(chunk, k);
|
||||
- this.world.timings.doTickTiles.stopTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.world.getMethodProfiler().enter("customSpawners");
|
||||
if (flag1) {
|
||||
+ try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
|
||||
this.chunkGenerator.doMobSpawning(this.world, this.allowMonsters, this.allowAnimals);
|
||||
this.world.doMobSpawning(this.allowMonsters, this.allowAnimals);
|
||||
+ } // Paper - timings
|
||||
}
|
||||
|
||||
@@ -849,7 +843,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- this.world.timings.tracker.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
@Override
|
||||
private void a(long i, Consumer<Chunk> consumer) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -886,7 +880,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
-
|
||||
}
|
||||
|
||||
private static NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair, Map<String, StructureStart> map, Map<String, LongSet> map1) {
|
||||
private static NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair, Map<StructureGenerator<?>, StructureStart<?>> map, Map<StructureGenerator<?>, LongSet> map1) {
|
||||
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/CustomFunction.java
|
||||
@@ -918,28 +912,19 @@ diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/ma
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
|
||||
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
|
||||
@@ -0,0 +0,0 @@ public class CustomFunctionData implements IResourcePackListener {
|
||||
@@ -0,0 +0,0 @@ public class CustomFunctionData {
|
||||
} else {
|
||||
int j;
|
||||
|
||||
- try {
|
||||
+ try (co.aikar.timings.Timing timing = customfunction.getTiming().startTiming()) { // Paper
|
||||
this.h = true;
|
||||
this.d = true;
|
||||
int k = 0;
|
||||
CustomFunction.c[] acustomfunction_c = customfunction.b();
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -0,0 +0,0 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
+import java.util.concurrent.CompletableFuture;
|
||||
+import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -1044,7 +1029,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
|
||||
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
|
||||
if (this.noclip) {
|
||||
this.a(this.getBoundingBox().b(vec3d));
|
||||
this.a(this.getBoundingBox().c(vec3d));
|
||||
this.recalcPosition();
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
||||
@@ -1053,7 +1038,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
protected BlockPosition ag() {
|
||||
protected BlockPosition ak() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1073,8 +1058,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public void tick() {
|
||||
- SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
|
||||
super.tick();
|
||||
this.o();
|
||||
this.r();
|
||||
this.u();
|
||||
this.x();
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
@@ -1093,7 +1078,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
protected float f(float f, float f1) {
|
||||
private void q() {
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.setMot(d4, d5, d6);
|
||||
@@ -1101,7 +1086,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- SpigotTimings.timerEntityAI.startTiming(); // Spigot
|
||||
if (this.isFrozen()) {
|
||||
this.jumping = false;
|
||||
this.aZ = 0.0F;
|
||||
this.aY = 0.0F;
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.doTick();
|
||||
this.world.getMethodProfiler().exit();
|
||||
@@ -1111,15 +1096,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.world.getMethodProfiler().exit();
|
||||
this.world.getMethodProfiler().enter("jump");
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.n();
|
||||
this.t();
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox();
|
||||
|
||||
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
|
||||
this.e(new Vec3D((double) this.aZ, (double) this.ba, (double) this.bb));
|
||||
this.f(new Vec3D((double) this.aY, (double) this.aZ, (double) this.ba));
|
||||
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
|
||||
this.world.getMethodProfiler().exit();
|
||||
this.world.getMethodProfiler().enter("push");
|
||||
if (this.bn > 0) {
|
||||
if (this.bm > 0) {
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
this.a(axisalignedbb, this.getBoundingBox());
|
||||
}
|
||||
@@ -1128,8 +1113,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.collideNearby();
|
||||
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide && this.dN() && this.aC()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1142,17 +1127,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import co.aikar.timings.MinecraftTimings; // Paper
|
||||
import org.spigotmc.SlackActivityAccountant; // Spigot
|
||||
|
||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable, Runnable {
|
||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
});
|
||||
});
|
||||
private long nextTick = SystemUtils.getMonotonicMillis();
|
||||
- private long ab;
|
||||
- private boolean ac;
|
||||
+ private long ab; final long getTickOversleepMaxTime() { return this.ab; } // Paper - OBFHELPER
|
||||
+ private boolean ac; final boolean hasExecutedTask() { return this.ac; } // Paper - OBFHELPER
|
||||
private final IReloadableResourceManager ae;
|
||||
private long T;
|
||||
public final Thread serverThread;
|
||||
private long nextTick;
|
||||
- private long W;
|
||||
- private boolean X;
|
||||
+ private long W;final long getTickOversleepMaxTime() { return this.W; } // Paper - OBFHELPER
|
||||
+ private boolean X; final boolean hasExecutedTask() { return this.X; } // Paper - OBFHELPER
|
||||
private final ResourcePackRepository<ResourcePackLoader> resourcePackRepository;
|
||||
private final ScoreboardServer scoreboardServer;
|
||||
@Nullable
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
@@ -1167,7 +1152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
private boolean canSleepForTick() {
|
||||
// CraftBukkit start
|
||||
+ if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
|
||||
return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.ac ? this.ab : this.nextTick);
|
||||
return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.X ? this.W : this.nextTick);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
@@ -1215,7 +1200,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
++this.ticks;
|
||||
this.b(booleansupplier);
|
||||
if (i - this.Z >= 5000000000L) {
|
||||
if (i - this.T >= 5000000000L) {
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
@@ -1243,7 +1228,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper end
|
||||
+
|
||||
this.methodProfiler.enter("tallying");
|
||||
long l = this.f[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i;
|
||||
long l = this.h[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i;
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.methodProfiler.exit();
|
||||
@@ -1308,7 +1293,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.playerList.tick();
|
||||
- SpigotTimings.playerListTimer.stopTiming(); // Spigot
|
||||
+ MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
|
||||
if (SharedConstants.b) {
|
||||
if (SharedConstants.d) {
|
||||
GameTestHarnessTicker.a.b();
|
||||
}
|
||||
|
||||
@@ -1441,7 +1426,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.player.lastY = this.player.locY();
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
||||
}
|
||||
- org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.stopTiming(); // Spigot
|
||||
|
||||
@@ -1530,16 +1515,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/TickListServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/TickListServer.java
|
||||
@@ -0,0 +0,0 @@ public class TickListServer<T> implements TickList<T> {
|
||||
private final List<NextTickListEntry<T>> h = Lists.newArrayList();
|
||||
private final Consumer<NextTickListEntry<T>> i;
|
||||
private final List<NextTickListEntry<T>> g = Lists.newArrayList();
|
||||
private final Consumer<NextTickListEntry<T>> h;
|
||||
|
||||
- public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Function<MinecraftKey, T> function1, Consumer<NextTickListEntry<T>> consumer) {
|
||||
+ public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Function<MinecraftKey, T> function1, Consumer<NextTickListEntry<T>> consumer, String timingsType) { // Paper
|
||||
- public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Consumer<NextTickListEntry<T>> consumer) {
|
||||
+ public TickListServer(WorldServer worldserver, Predicate<T> predicate, Function<T, MinecraftKey> function, Consumer<NextTickListEntry<T>> consumer, String timingsType) { // Paper
|
||||
this.a = predicate;
|
||||
this.b = function;
|
||||
this.c = function1;
|
||||
this.f = worldserver;
|
||||
this.i = consumer;
|
||||
this.e = worldserver;
|
||||
this.h = consumer;
|
||||
+ this.timingCleanup = co.aikar.timings.WorldTimingsHandler.getTickList(worldserver, timingsType + " - Cleanup");
|
||||
+ this.timingTicking = co.aikar.timings.WorldTimingsHandler.getTickList(worldserver, timingsType + " - Ticking");
|
||||
}
|
||||
@@ -1551,7 +1535,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
int i = this.nextTickList.size();
|
||||
@@ -0,0 +0,0 @@ public class TickListServer<T> implements TickList<T> {
|
||||
|
||||
this.f.getMethodProfiler().enter("cleaning");
|
||||
this.e.getMethodProfiler().enter("cleaning");
|
||||
|
||||
+ this.timingCleanup.startTiming(); // Paper
|
||||
NextTickListEntry nextticklistentry;
|
||||
@@ -1564,17 +1548,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.timingCleanup.stopTiming(); // Paper
|
||||
|
||||
+ this.timingTicking.startTiming(); // Paper
|
||||
this.f.getMethodProfiler().exitEnter("ticking");
|
||||
this.e.getMethodProfiler().exitEnter("ticking");
|
||||
|
||||
while ((nextticklistentry = (NextTickListEntry) this.g.poll()) != null) {
|
||||
while ((nextticklistentry = (NextTickListEntry) this.f.poll()) != null) {
|
||||
@@ -0,0 +0,0 @@ public class TickListServer<T> implements TickList<T> {
|
||||
}
|
||||
}
|
||||
|
||||
this.f.getMethodProfiler().exit();
|
||||
+ this.timingTicking.stopTiming(); // Paper
|
||||
this.h.clear();
|
||||
this.e.getMethodProfiler().exit();
|
||||
this.g.clear();
|
||||
}
|
||||
this.f.clear();
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -1598,20 +1582,11 @@ diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/m
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+import co.aikar.timings.Timing;
|
||||
+import co.aikar.timings.Timings;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.util.Supplier;
|
||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||
+import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.block.CapturedBlockState;
|
||||
@@ -1654,10 +1629,10 @@ diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
+import co.aikar.timings.TimingHistory; // Paper
|
||||
+import co.aikar.timings.Timings; // Paper
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -1669,69 +1644,54 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
import org.bukkit.WeatherType;
|
||||
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.util.WorldUUID;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.server.MapInitializeEvent;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
// CraftBukkit end
|
||||
this.nextTickListBlock = new TickListServer<>(this, (block) -> {
|
||||
return block == null || block.getBlockData().isAir();
|
||||
- }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b);
|
||||
+ }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings
|
||||
- }, IRegistry.BLOCK::getKey, this::b);
|
||||
+ }, IRegistry.BLOCK::getKey, this::b, "Blocks"); // Paper - Timings
|
||||
this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> {
|
||||
return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
- }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a);
|
||||
+ }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings
|
||||
- }, IRegistry.FLUID::getKey, this::a);
|
||||
+ }, IRegistry.FLUID::getKey, this::a, "Fluids"); // Paper - Timings
|
||||
this.navigators = Sets.newHashSet();
|
||||
this.I = new ObjectLinkedOpenHashSet();
|
||||
this.dataManager = worldnbtstorage;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
this.L = new ObjectLinkedOpenHashSet();
|
||||
this.Q = flag1;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
this.N();
|
||||
this.a();
|
||||
this.b();
|
||||
gameprofilerfiller.exitEnter("chunkSource");
|
||||
+ this.timings.chunkProviderTick.startTiming(); // Paper - timings
|
||||
this.getChunkProvider().tick(booleansupplier);
|
||||
+ this.timings.chunkProviderTick.stopTiming(); // Paper - timings
|
||||
gameprofilerfiller.exitEnter("tickPending");
|
||||
- timings.doTickPending.startTiming(); // Spigot
|
||||
+ timings.scheduledBlocks.startTiming(); // Spigot
|
||||
if (this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
+ timings.scheduledBlocks.startTiming(); // Paper
|
||||
if (!this.isDebugWorld()) {
|
||||
this.nextTickListBlock.b();
|
||||
this.nextTickListFluid.b();
|
||||
}
|
||||
- timings.doTickPending.stopTiming(); // Spigot
|
||||
+ timings.scheduledBlocks.stopTiming(); // Spigot
|
||||
+ timings.scheduledBlocks.stopTiming(); // Paper
|
||||
|
||||
gameprofilerfiller.exitEnter("raid");
|
||||
+ this.timings.raids.startTiming(); // Paper - timings
|
||||
this.persistentRaid.a();
|
||||
if (this.mobSpawnerTrader != null) {
|
||||
this.mobSpawnerTrader.a();
|
||||
}
|
||||
+ this.timings.raids.stopTiming(); // Paper - timings
|
||||
|
||||
gameprofilerfiller.exitEnter("blockEvents");
|
||||
timings.doSounds.startTiming(); // Spigot
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
this.ah();
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
timings.entityTick.startTiming(); // Spigot
|
||||
+ TimingHistory.entityTicks += this.globalEntityList.size(); // Paper
|
||||
while (objectiterator.hasNext()) {
|
||||
Entry<Entity> entry = (Entry) objectiterator.next();
|
||||
Entity entity1 = (Entity) entry.getValue();
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
||||
this.tickingEntities = false;
|
||||
|
||||
+ try (co.aikar.timings.Timing ignored = this.timings.newEntities.startTiming()) { // Paper - timings
|
||||
while ((entity = (Entity) this.entitiesToAdd.poll()) != null) {
|
||||
this.registerEntity(entity);
|
||||
}
|
||||
+ } // Paper - timings
|
||||
|
||||
gameprofilerfiller.exit();
|
||||
timings.tickEntities.stopTiming(); // Spigot
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
Entity entity = (Entity) entry.getValue();
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
|
||||
gameprofilerfiller.exitEnter("tickBlocks");
|
||||
@@ -1739,7 +1699,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (i > 0) {
|
||||
ChunkSection[] achunksection = chunk.getSections();
|
||||
int l = achunksection.length;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1748,25 +1708,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
gameprofilerfiller.exit();
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
||||
public void entityJoinedWorld(Entity entity) {
|
||||
if (entity instanceof EntityHuman || this.getChunkProvider().a(entity)) {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
if (!(entity instanceof EntityHuman) && !this.getChunkProvider().a(entity)) {
|
||||
this.chunkCheck(entity);
|
||||
} else {
|
||||
+ ++TimingHistory.entityTicks; // Paper - timings
|
||||
// Spigot start
|
||||
if (!org.spigotmc.ActivationRange.checkIfActive(entity)) {
|
||||
entity.ticksLived++;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
return;
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
+ TimingHistory.activatedEntityTicks++; // Paper - timings
|
||||
entity.tickTimer.startTiming(); // Spigot
|
||||
+ try { // Paper - timings
|
||||
entity.f(entity.locX(), entity.locY(), entity.locZ());
|
||||
entity.lastYaw = entity.yaw;
|
||||
entity.lastPitch = entity.pitch;
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
this.a(entity, entity1);
|
||||
}
|
||||
}
|
||||
@@ -1776,16 +1736,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
if (!flag1) {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
|
||||
+ try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
|
||||
if (iprogressupdate != null) {
|
||||
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
|
||||
iprogressupdate.a(new ChatMessage("menu.savingLevel"));
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
iprogressupdate.c(new ChatMessage("menu.savingChunks", new Object[0]));
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
iprogressupdate.c(new ChatMessage("menu.savingChunks"));
|
||||
}
|
||||
|
||||
+ timings.worldSaveChunks.startTiming(); // Paper
|
||||
@@ -1843,6 +1803,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
-import net.minecraft.server.Entity;
|
||||
-import net.minecraft.server.TileEntity;
|
||||
-import net.minecraft.server.World;
|
||||
-import net.minecraft.server.WorldDataServer;
|
||||
-import org.bukkit.craftbukkit.scheduler.CraftTask;
|
||||
-import org.bukkit.plugin.java.JavaPluginLoader;
|
||||
-import org.bukkit.scheduler.BukkitTask;
|
||||
@@ -1973,7 +1934,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- public final CustomTimingsHandler syncChunkLoadPostTimer;
|
||||
-
|
||||
- public WorldTimingsHandler(World server) {
|
||||
- String name = server.worldData.getName() +" - ";
|
||||
- String name = ((WorldDataServer) server.worldData).getName() + " - ";
|
||||
-
|
||||
- mobSpawn = new CustomTimingsHandler("** " + name + "mobSpawn");
|
||||
- doChunkUnload = new CustomTimingsHandler("** " + name + "doChunkUnload");
|
||||
@@ -2137,11 +2098,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- CraftTask(final Plugin plugin, final Object task, final int id, final long period) {
|
||||
+ CraftTask(final Plugin plugin, final Object task, final int id, final long period) { // Paper
|
||||
this.plugin = plugin;
|
||||
if (task instanceof Runnable) {
|
||||
this.rTask = (Runnable) task;
|
||||
@@ -0,0 +0,0 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
||||
}
|
||||
this.id = id;
|
||||
|
||||
Reference in New Issue
Block a user