Remove Spigot timings

This commit is contained in:
Aikar
2016-03-03 04:00:11 -06:00
parent a371d5fefe
commit 770ee3eebd
19 changed files with 475 additions and 926 deletions

View File

@@ -238,14 +238,10 @@
if (tileentity != null) {
Level world = this.level;
@@ -549,9 +611,68 @@
if (this.postLoad != null) {
this.postLoad.run(this);
this.postLoad = null;
+ }
+
+ }
+
@@ -553,6 +615,65 @@
}
+ // CraftBukkit start
+ public void loadCallback() {
+ // Paper start
@@ -283,9 +279,9 @@
+ }
+ server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
+ }
}
+ }
+ }
+
+ public void unloadCallback() {
+ org.bukkit.Server server = this.level.getCraftServer();
+ org.bukkit.Chunk bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
@@ -302,11 +298,12 @@
+ @Override
+ public boolean isUnsaved() {
+ return super.isUnsaved() && !this.mustNotSave;
}
+ }
+ // CraftBukkit end
+
public boolean isEmpty() {
return false;
}
@@ -750,7 +871,7 @@
private <T extends BlockEntity> void updateBlockEntityTicker(T blockEntity) {
@@ -325,22 +322,11 @@
this.ticker = blockentityticker;
}
@@ -855,6 +976,7 @@
ProfilerFiller gameprofilerfiller = Profiler.get();
gameprofilerfiller.push(this::getType);
+ this.blockEntity.tickTimer.startTiming(); // Spigot
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -872,6 +994,10 @@
@@ -872,6 +993,7 @@
this.blockEntity.fillCrashReportCategory(crashreportsystemdetails);
throw new ReportedException(crashreport);
+ // Spigot start
+ } finally {
+ this.blockEntity.tickTimer.stopTiming();
+ // Spigot end
}
}
}

View File

@@ -132,31 +132,7 @@
return nbttagcompound;
}
@@ -550,12 +576,15 @@
@Nullable
private static LevelChunk.PostLoadProcessor postLoadChunk(ServerLevel world, List<CompoundTag> entities, List<CompoundTag> blockEntities) {
return entities.isEmpty() && blockEntities.isEmpty() ? null : (chunk) -> {
+ world.timings.syncChunkLoadEntitiesTimer.startTiming(); // Spigot
if (!entities.isEmpty()) {
world.addLegacyChunkEntities(EntityType.loadEntitiesRecursive(entities, world, EntitySpawnReason.LOAD));
}
+ world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot
Iterator iterator = blockEntities.iterator();
+ world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot
while (iterator.hasNext()) {
CompoundTag nbttagcompound = (CompoundTag) iterator.next();
boolean flag = nbttagcompound.getBoolean("keepPacked");
@@ -571,6 +600,7 @@
}
}
}
+ world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot
};
}
@@ -623,6 +653,12 @@
@@ -623,6 +649,12 @@
StructureStart structurestart = StructureStart.loadStaticStart(context, nbttagcompound1.getCompound(s), worldSeed);
if (structurestart != null) {