Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 04:20:04 +01:00
Timings v2 updates for more chunk related timings (generations)
Dieser Commit ist enthalten in:
Ursprung
323c18dd65
Commit
173d0fa33f
@ -1,4 +1,4 @@
|
||||
From c6be559822362b3a7bab23e04ff580be2fef0192 Mon Sep 17 00:00:00 2001
|
||||
From d1e7f412be2eb89f538516a4aad9605d3aedd7d4 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Mar 2016 04:00:11 -0600
|
||||
Subject: [PATCH] Timings v2
|
||||
@ -23,10 +23,10 @@ index 4ae34c8..63aaa7a 100644
|
||||
<version>3.0.3</version>
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
new file mode 100644
|
||||
index 0000000..0f8315c
|
||||
index 0000000..2dff5e3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
@@ -0,0 +1,110 @@
|
||||
@@ -0,0 +1,114 @@
|
||||
+package co.aikar.timings;
|
||||
+
|
||||
+import net.minecraft.server.*;
|
||||
@ -136,13 +136,149 @@ index 0000000..0f8315c
|
||||
+ public static Timing getBlockTiming(Block block) {
|
||||
+ return Timings.ofSafe("## Scheduled Block: " + block.getName());
|
||||
+ }
|
||||
+
|
||||
+ public static Timing getStructureTiming(StructureGenerator structureGenerator) {
|
||||
+ return Timings.ofSafe("Structure Generator - " + structureGenerator.getName());
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/TimedChunkGenerator.java b/src/main/java/co/aikar/timings/TimedChunkGenerator.java
|
||||
new file mode 100644
|
||||
index 0000000..2bf5b66
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/TimedChunkGenerator.java
|
||||
@@ -0,0 +1,126 @@
|
||||
+/*
|
||||
+ * This file is licensed under the MIT License (MIT).
|
||||
+ *
|
||||
+ * Copyright (c) 2014-2016 Daniel Ennis <http://aikar.co>
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
+ * of this software and associated documentation files (the "Software"), to deal
|
||||
+ * in the Software without restriction, including without limitation the rights
|
||||
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
+ * copies of the Software, and to permit persons to whom the Software is
|
||||
+ * furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be included in
|
||||
+ * all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
+ * THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+package co.aikar.timings;
|
||||
+
|
||||
+import net.minecraft.server.BiomeBase.BiomeMeta;
|
||||
+import net.minecraft.server.BlockPosition;
|
||||
+import net.minecraft.server.Chunk;
|
||||
+import net.minecraft.server.EnumCreatureType;
|
||||
+import net.minecraft.server.World;
|
||||
+import net.minecraft.server.WorldServer;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.generator.InternalChunkGenerator;
|
||||
+import org.bukkit.generator.BlockPopulator;
|
||||
+
|
||||
+import javax.annotation.Nullable;
|
||||
+import java.util.List;
|
||||
+import java.util.Random;
|
||||
+
|
||||
+public class TimedChunkGenerator extends InternalChunkGenerator {
|
||||
+ private final WorldServer world;
|
||||
+ private final InternalChunkGenerator timedGenerator;
|
||||
+
|
||||
+ public TimedChunkGenerator(WorldServer worldServer, InternalChunkGenerator gen) {
|
||||
+ world = worldServer;
|
||||
+ timedGenerator = gen;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @Deprecated
|
||||
+ public byte[] generate(org.bukkit.World world, Random random, int x, int z) {
|
||||
+ return timedGenerator.generate(world, random, x, z);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @Deprecated
|
||||
+ public short[][] generateExtBlockSections(org.bukkit.World world, Random random, int x, int z,
|
||||
+ BiomeGrid biomes) {
|
||||
+ return timedGenerator.generateExtBlockSections(world, random, x, z, biomes);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @Deprecated
|
||||
+ public byte[][] generateBlockSections(org.bukkit.World world, Random random, int x, int z,
|
||||
+ BiomeGrid biomes) {
|
||||
+ return timedGenerator.generateBlockSections(world, random, x, z, biomes);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ChunkData generateChunkData(org.bukkit.World world, Random random, int x, int z, BiomeGrid biome) {
|
||||
+ return timedGenerator.generateChunkData(world, random, x, z, biome);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSpawn(org.bukkit.World world, int x, int z) {
|
||||
+ return timedGenerator.canSpawn(world, x, z);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<BlockPopulator> getDefaultPopulators(org.bukkit.World world) {
|
||||
+ return timedGenerator.getDefaultPopulators(world);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Location getFixedSpawnLocation(org.bukkit.World world, Random random) {
|
||||
+ return timedGenerator.getFixedSpawnLocation(world, random);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Chunk getOrCreateChunk(int i, int j) {
|
||||
+ try (Timing ignored = world.timings.chunkGeneration.startTiming()) {
|
||||
+ return timedGenerator.getOrCreateChunk(i, j);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void recreateStructures(int i, int j) {
|
||||
+ try (Timing ignored = world.timings.syncChunkLoadStructuresTimer.startTiming()) {
|
||||
+ timedGenerator.recreateStructures(i, j);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean a(Chunk chunk, int i, int j) {
|
||||
+ return timedGenerator.a(chunk, i, j);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<BiomeMeta> getMobsFor(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
|
||||
+ return timedGenerator.getMobsFor(enumcreaturetype, blockposition);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @Nullable
|
||||
+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition) {
|
||||
+ return timedGenerator.findNearestMapFeature(world, s, blockposition);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void recreateStructures(Chunk chunk, int i, int j) {
|
||||
+ try (Timing ignored = world.timings.syncChunkLoadStructuresTimer.startTiming()) {
|
||||
+ timedGenerator.recreateStructures(chunk, i, j);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
new file mode 100644
|
||||
index 0000000..741da72
|
||||
index 0000000..36aafb2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
@@ -0,0 +1,85 @@
|
||||
@@ -0,0 +1,91 @@
|
||||
+package co.aikar.timings;
|
||||
+
|
||||
+import net.minecraft.server.World;
|
||||
@ -158,6 +294,7 @@ index 0000000..741da72
|
||||
+ public final Timing scheduledBlocksCleanup;
|
||||
+ public final Timing scheduledBlocksTicking;
|
||||
+ public final Timing chunkTicks;
|
||||
+ public final Timing lightChunk;
|
||||
+ public final Timing chunkTicksBlocks;
|
||||
+ public final Timing doVillages;
|
||||
+ public final Timing doChunkMap;
|
||||
@ -182,10 +319,12 @@ index 0000000..741da72
|
||||
+ public final Timing syncChunkLoadTimer;
|
||||
+ public final Timing syncChunkLoadDataTimer;
|
||||
+ public final Timing syncChunkLoadStructuresTimer;
|
||||
+ public final Timing syncChunkLoadEntitiesTimer;
|
||||
+ public final Timing syncChunkLoadTileEntitiesTimer;
|
||||
+ public final Timing syncChunkLoadTileTicksTimer;
|
||||
+ public final Timing syncChunkLoadPostTimer;
|
||||
+ public final Timing syncChunkLoadNBTTimer;
|
||||
+ public final Timing syncChunkLoadPopulateNeighbors;
|
||||
+ public final Timing chunkGeneration;
|
||||
+ public final Timing chunkIOStage1;
|
||||
+ public final Timing chunkIOStage2;
|
||||
+
|
||||
+ public WorldTimingsHandler(World server) {
|
||||
+ String name = server.worldData.getName() +" - ";
|
||||
@ -196,6 +335,7 @@ index 0000000..741da72
|
||||
+ scheduledBlocksCleanup = Timings.ofSafe(name + "Scheduled Blocks - Cleanup");
|
||||
+ scheduledBlocksTicking = Timings.ofSafe(name + "Scheduled Blocks - Ticking");
|
||||
+ chunkTicks = Timings.ofSafe(name + "Chunk Ticks");
|
||||
+ lightChunk = Timings.ofSafe(name + "Light Chunk");
|
||||
+ chunkTicksBlocks = Timings.ofSafe(name + "Chunk Ticks - Blocks");
|
||||
+ doVillages = Timings.ofSafe(name + "doVillages");
|
||||
+ doChunkMap = Timings.ofSafe(name + "doChunkMap");
|
||||
@ -216,11 +356,13 @@ index 0000000..741da72
|
||||
+
|
||||
+ syncChunkLoadTimer = Timings.ofSafe(name + "syncChunkLoad");
|
||||
+ syncChunkLoadDataTimer = Timings.ofSafe(name + "syncChunkLoad - Data");
|
||||
+ syncChunkLoadStructuresTimer = Timings.ofSafe(name + "chunkLoad - Structures");
|
||||
+ syncChunkLoadEntitiesTimer = Timings.ofSafe(name + "chunkLoad - Entities");
|
||||
+ syncChunkLoadTileEntitiesTimer = Timings.ofSafe(name + "chunkLoad - TileEntities");
|
||||
+ syncChunkLoadTileTicksTimer = Timings.ofSafe(name + "chunkLoad - TileTicks");
|
||||
+ syncChunkLoadStructuresTimer = Timings.ofSafe(name + "chunkLoad - recreateStructures");
|
||||
+ syncChunkLoadPostTimer = Timings.ofSafe(name + "chunkLoad - Post");
|
||||
+ syncChunkLoadNBTTimer = Timings.ofSafe(name + "chunkLoad - NBT");
|
||||
+ syncChunkLoadPopulateNeighbors = Timings.ofSafe(name + "chunkLoad - Populate Neighbors");
|
||||
+ chunkGeneration = Timings.ofSafe(name + "chunkGeneration");
|
||||
+ chunkIOStage1 = Timings.ofSafe(name + "ChunkIO Stage 1 - DiskIO");
|
||||
+ chunkIOStage2 = Timings.ofSafe(name + "ChunkIO Stage 2 - Post Load");
|
||||
+
|
||||
+ tracker1 = Timings.ofSafe(name + "tracker stage 1");
|
||||
+ tracker2 = Timings.ofSafe(name + "tracker stage 2");
|
||||
@ -292,6 +434,94 @@ index a106e44..d17160a 100644
|
||||
|
||||
public static int getId(Block block) {
|
||||
return Block.REGISTRY.a(block); // CraftBukkit - decompile error
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index b651edc..5807bb8 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -900,7 +900,7 @@ public class Chunk {
|
||||
|
||||
// CraftBukkit start
|
||||
public void loadNearby(IChunkProvider ichunkprovider, ChunkGenerator chunkgenerator, boolean newChunk) {
|
||||
- world.timings.syncChunkLoadPostTimer.startTiming(); // Spigot
|
||||
+ world.timings.syncChunkLoadPostTimer.startTiming(); // Paper
|
||||
Server server = world.getServer();
|
||||
if (server != null) {
|
||||
/*
|
||||
@@ -926,7 +926,8 @@ public class Chunk {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
-
|
||||
+ world.timings.syncChunkLoadPostTimer.stopTiming(); // Paper
|
||||
+ world.timings.syncChunkLoadPopulateNeighbors.startTiming(); // Paper
|
||||
Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1);
|
||||
Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ);
|
||||
Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1);
|
||||
@@ -951,7 +952,7 @@ public class Chunk {
|
||||
chunk4.a(chunkgenerator);
|
||||
}
|
||||
}
|
||||
- world.timings.syncChunkLoadPostTimer.stopTiming(); // Spigot
|
||||
+ world.timings.syncChunkLoadPopulateNeighbors.stopTiming(); // Paper
|
||||
|
||||
}
|
||||
|
||||
@@ -1164,6 +1165,7 @@ public class Chunk {
|
||||
}
|
||||
|
||||
public void o() {
|
||||
+ world.timings.lightChunk.startTiming(); // Paper
|
||||
this.done = true;
|
||||
this.lit = true;
|
||||
BlockPosition blockposition = new BlockPosition(this.locX << 4, 0, this.locZ << 4);
|
||||
@@ -1197,6 +1199,7 @@ public class Chunk {
|
||||
}
|
||||
}
|
||||
|
||||
+ world.timings.lightChunk.stopTiming(); // Paper
|
||||
}
|
||||
|
||||
private void z() {
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 3de34be..31eb342 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -387,7 +387,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
||||
public void loadEntities(Chunk chunk, NBTTagCompound nbttagcompound, World world) {
|
||||
// CraftBukkit end
|
||||
- world.timings.syncChunkLoadEntitiesTimer.startTiming(); // Spigot
|
||||
+ world.timings.syncChunkLoadNBTTimer.startTiming(); // Spigot
|
||||
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
|
||||
|
||||
if (nbttaglist1 != null) {
|
||||
@@ -398,8 +398,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
chunk.g(true);
|
||||
}
|
||||
}
|
||||
- world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot
|
||||
- world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot
|
||||
NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10);
|
||||
|
||||
if (nbttaglist2 != null) {
|
||||
@@ -412,8 +410,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
}
|
||||
}
|
||||
}
|
||||
- world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot
|
||||
- world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("TileTicks", 9)) {
|
||||
NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10);
|
||||
@@ -433,7 +429,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
}
|
||||
}
|
||||
}
|
||||
- world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot
|
||||
+ world.timings.syncChunkLoadNBTTimer.stopTiming(); // Spigot
|
||||
|
||||
// return chunk; // CraftBukkit
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 11a49a3..e70d5c5 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@ -756,6 +986,48 @@ index d5dd29b..13a6cfe 100644
|
||||
// this.minecraftServer.getCommandHandler().a(this.player, s);
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
index 8dd434c..c965af1 100644
|
||||
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+import co.aikar.timings.MinecraftTimings;
|
||||
+import co.aikar.timings.Timing;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -8,11 +10,13 @@ import java.util.Random;
|
||||
|
||||
public abstract class StructureGenerator extends WorldGenBase {
|
||||
|
||||
+ private final Timing timing = MinecraftTimings.getStructureTiming(this); // Paper
|
||||
private PersistentStructure a;
|
||||
protected Long2ObjectMap<StructureStart> c = new Long2ObjectOpenHashMap(1024);
|
||||
|
||||
public StructureGenerator() {}
|
||||
|
||||
+ public String getName() { return a(); } // Paper // OBF HELPER
|
||||
public abstract String a();
|
||||
|
||||
protected final synchronized void a(World world, final int i, final int j, int k, int l, ChunkSnapshot chunksnapshot) {
|
||||
@@ -68,6 +72,7 @@ public abstract class StructureGenerator extends WorldGenBase {
|
||||
}
|
||||
|
||||
public synchronized boolean a(World world, Random random, ChunkCoordIntPair chunkcoordintpair) {
|
||||
+ timing.startTiming(); // Paper
|
||||
this.a(world);
|
||||
int i = (chunkcoordintpair.x << 4) + 8;
|
||||
int j = (chunkcoordintpair.z << 4) + 8;
|
||||
@@ -84,6 +89,7 @@ public abstract class StructureGenerator extends WorldGenBase {
|
||||
this.a(structurestart.e(), structurestart.f(), structurestart);
|
||||
}
|
||||
}
|
||||
+ timing.stopTiming(); // Paper
|
||||
|
||||
return flag;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 42f37df..2b82312 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@ -883,7 +1155,7 @@ index e649435..b73f64e 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 0668887..e0f448d 100644
|
||||
index 0668887..94d07eb 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -245,13 +245,13 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
@ -963,6 +1235,15 @@ index 0668887..e0f448d 100644
|
||||
|
||||
this.methodProfiler.b();
|
||||
this.U.clear();
|
||||
@@ -842,7 +850,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
gen = new org.bukkit.craftbukkit.generator.NormalChunkGenerator(this, this.getSeed());
|
||||
}
|
||||
|
||||
- return new ChunkProviderServer(this, ichunkloader, gen);
|
||||
+ return new ChunkProviderServer(this, ichunkloader, new co.aikar.timings.TimedChunkGenerator(this, gen)); // Paper
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 03169db..a519b71 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@ -1179,8 +1460,52 @@ index 41d2d87..0000000
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
||||
index 3a95b44..b5efb9c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.bukkit.craftbukkit.chunkio;
|
||||
|
||||
import java.io.IOException;
|
||||
+
|
||||
+import co.aikar.timings.Timing;
|
||||
import net.minecraft.server.Chunk;
|
||||
import net.minecraft.server.ChunkCoordIntPair;
|
||||
import net.minecraft.server.ChunkRegionLoader;
|
||||
@@ -16,7 +18,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
||||
|
||||
// async stuff
|
||||
public Chunk callStage1(QueuedChunk queuedChunk) throws RuntimeException {
|
||||
- try {
|
||||
+ try (Timing ignored = queuedChunk.provider.world.timings.chunkIOStage1.startTimingIfSync()) { // Paper
|
||||
ChunkRegionLoader loader = queuedChunk.loader;
|
||||
Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z);
|
||||
|
||||
@@ -38,6 +40,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
||||
queuedChunk.provider.originalGetChunkAt(queuedChunk.x, queuedChunk.z);
|
||||
return;
|
||||
}
|
||||
+ try (Timing ignored = queuedChunk.provider.world.timings.chunkIOStage2.startTimingIfSync()) { // Paper
|
||||
|
||||
queuedChunk.loader.loadEntities(chunk, queuedChunk.compound.getCompound("Level"), queuedChunk.world);
|
||||
chunk.setLastSaved(queuedChunk.provider.world.getTime());
|
||||
@@ -45,12 +48,11 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
||||
chunk.addEntities();
|
||||
|
||||
if (queuedChunk.provider.chunkGenerator != null) {
|
||||
- queuedChunk.provider.world.timings.syncChunkLoadStructuresTimer.startTiming(); // Spigot
|
||||
queuedChunk.provider.chunkGenerator.recreateStructures(chunk, queuedChunk.x, queuedChunk.z);
|
||||
- queuedChunk.provider.world.timings.syncChunkLoadStructuresTimer.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
chunk.loadNearby(queuedChunk.provider, queuedChunk.provider.chunkGenerator, false);
|
||||
+ } // Paper
|
||||
}
|
||||
|
||||
public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index d61065c..d6cf997 100644
|
||||
index 3c75538..5874554 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -37,15 +37,9 @@ import org.bukkit.configuration.serialization.DelegateDeserialization;
|
||||
@ -1411,5 +1736,5 @@ index 30efc99..eb30abe 100644
|
||||
}
|
||||
}
|
||||
--
|
||||
2.9.2.windows.1
|
||||
2.9.3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From bde4b00ccecf0fa1db80077b0aed4099978c6208 Mon Sep 17 00:00:00 2001
|
||||
From f8a9a1de88d6073309d39ae803d9627284d2657d Mon Sep 17 00:00:00 2001
|
||||
From: Byteflux <byte@byteflux.net>
|
||||
Date: Wed, 2 Mar 2016 00:52:31 -0600
|
||||
Subject: [PATCH] Lighting Queue
|
||||
@ -6,19 +6,19 @@ Subject: [PATCH] Lighting Queue
|
||||
This provides option to queue lighting updates to ensure they do not cause the server lag
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
index 741da72..8b3aa17 100644
|
||||
index 36aafb2..90bdbf0 100644
|
||||
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
@@ -42,6 +42,8 @@ public class WorldTimingsHandler {
|
||||
public final Timing syncChunkLoadTileTicksTimer;
|
||||
public final Timing syncChunkLoadPostTimer;
|
||||
@@ -45,6 +45,8 @@ public class WorldTimingsHandler {
|
||||
public final Timing chunkIOStage1;
|
||||
public final Timing chunkIOStage2;
|
||||
|
||||
+ public final Timing lightingQueueTimer;
|
||||
+
|
||||
public WorldTimingsHandler(World server) {
|
||||
String name = server.worldData.getName() +" - ";
|
||||
|
||||
@@ -81,5 +83,7 @@ public class WorldTimingsHandler {
|
||||
@@ -87,5 +89,7 @@ public class WorldTimingsHandler {
|
||||
tracker2 = Timings.ofSafe(name + "tracker stage 2");
|
||||
doTick = Timings.ofSafe(name + "doTick");
|
||||
tickEntities = Timings.ofSafe(name + "tickEntities");
|
||||
@ -42,7 +42,7 @@ index d78b688..158db3a 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 015a223..0fae95d 100644
|
||||
index 445419f..76130c9 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -33,6 +33,7 @@ public class Chunk {
|
||||
@ -235,5 +235,5 @@ index 8fb8176..672167a 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.9.0.windows.1
|
||||
2.9.3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 9ce6203dee54a1bdca4a16b5bf8feb683d917fce Mon Sep 17 00:00:00 2001
|
||||
From 1a7f83a720833355b7b0afa6b14d1f4a47a106c6 Mon Sep 17 00:00:00 2001
|
||||
From: Byteflux <byte@byteflux.net>
|
||||
Date: Wed, 2 Mar 2016 02:17:54 -0600
|
||||
Subject: [PATCH] Generator Settings
|
||||
@ -245,10 +245,10 @@ index 6e6ecd8..e95175e 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
index 8dd434c..4248a36 100644
|
||||
index c965af1..3ce4449 100644
|
||||
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
|
||||
@@ -89,6 +89,7 @@ public abstract class StructureGenerator extends WorldGenBase {
|
||||
@@ -95,6 +95,7 @@ public abstract class StructureGenerator extends WorldGenBase {
|
||||
}
|
||||
|
||||
public boolean b(BlockPosition blockposition) {
|
||||
@ -256,7 +256,7 @@ index 8dd434c..4248a36 100644
|
||||
this.a(this.g);
|
||||
return this.c(blockposition) != null;
|
||||
}
|
||||
@@ -116,6 +117,7 @@ public abstract class StructureGenerator extends WorldGenBase {
|
||||
@@ -122,6 +123,7 @@ public abstract class StructureGenerator extends WorldGenBase {
|
||||
}
|
||||
|
||||
public synchronized boolean b(World world, BlockPosition blockposition) { // CraftBukkit - synchronized
|
||||
@ -265,5 +265,5 @@ index 8dd434c..4248a36 100644
|
||||
Iterator iterator = this.c.values().iterator();
|
||||
|
||||
--
|
||||
2.8.3
|
||||
2.9.3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From fc2343fede3ec2a7b8e0beab74332e3a7c07c41e Mon Sep 17 00:00:00 2001
|
||||
From 4a5adb304339d69522e2f49cbea50203ec692b3e Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 4 Mar 2016 18:18:37 -0600
|
||||
Subject: [PATCH] Chunk save queue improvements
|
||||
@ -41,7 +41,7 @@ index 9ab6445..d01bca1 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 8e4076d..73b8b8b 100644
|
||||
index 11ee148..e6e7626 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -12,14 +12,17 @@ import java.util.Map;
|
||||
@ -128,7 +128,7 @@ index 8e4076d..73b8b8b 100644
|
||||
}
|
||||
|
||||
return flag;
|
||||
@@ -551,4 +559,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -547,4 +555,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
@ -170,5 +170,5 @@ index acfdd52..fdbaf5f 100644
|
||||
|
||||
if (this.b.isEmpty()) {
|
||||
--
|
||||
2.9.0
|
||||
2.9.3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 774fce04aeeca98f4f982041abfcb23d95e3cffd Mon Sep 17 00:00:00 2001
|
||||
From 69126a742a8bea124915824db8694e880a6126ca Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 28 Mar 2016 20:46:14 -0400
|
||||
Subject: [PATCH] Configurable Chunk Inhabited Timer
|
||||
@ -23,10 +23,10 @@ index ca0673e..7d60d5e 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index c7452d9..e36525a 100644
|
||||
index 63e11aa..74ffa66 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -1402,7 +1402,7 @@ public class Chunk {
|
||||
@@ -1405,7 +1405,7 @@ public class Chunk {
|
||||
}
|
||||
|
||||
public long x() {
|
||||
@ -36,5 +36,5 @@ index c7452d9..e36525a 100644
|
||||
|
||||
public void c(long i) {
|
||||
--
|
||||
2.9.0
|
||||
2.9.3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 0e65ff66c8c94dc9c00b79e0a2135f9339d33f5a Mon Sep 17 00:00:00 2001
|
||||
From 41ecf77426898ac0f0759a0bf62f60e6fb9785cf Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 12 May 2016 01:55:17 -0400
|
||||
Subject: [PATCH] Do not mark chunks as active for neighbor updates
|
||||
@ -6,13 +6,13 @@ Subject: [PATCH] Do not mark chunks as active for neighbor updates
|
||||
Fixes chunk unload issues
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 3419d0f..a2d9f62 100644
|
||||
index 0ee8a13..1ec820f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -1003,25 +1003,25 @@ public class Chunk {
|
||||
}
|
||||
@@ -1004,25 +1004,25 @@ public class Chunk {
|
||||
// CraftBukkit end
|
||||
|
||||
world.timings.syncChunkLoadPostTimer.stopTiming(); // Paper
|
||||
world.timings.syncChunkLoadPopulateNeighbors.startTiming(); // Paper
|
||||
- Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1);
|
||||
- Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ);
|
||||
- Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1);
|
||||
@ -44,5 +44,5 @@ index 3419d0f..a2d9f62 100644
|
||||
if (chunk4 != null) {
|
||||
chunk4.a(chunkgenerator);
|
||||
--
|
||||
2.9.0
|
||||
2.9.3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 92803c14313b5cfc5233b87681224509507ef209 Mon Sep 17 00:00:00 2001
|
||||
From 4ab0fddd4f096a726e5cfd9768b92fd3421444ea Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 27 May 2016 21:41:26 -0400
|
||||
Subject: [PATCH] Ensure Chunks never ever load async
|
||||
@ -27,10 +27,10 @@ index 7b7a3d0..9aaca21 100644
|
||||
|
||||
public static void queueChunkLoad(World world, ChunkRegionLoader loader, ChunkProviderServer provider, int x, int z, Runnable runnable) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
||||
index 3a95b44..229fa6c 100644
|
||||
index b5efb9c..ef9529a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
||||
@@ -33,8 +33,8 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
||||
@@ -35,8 +35,8 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
||||
|
||||
// sync stuff
|
||||
public void callStage2(QueuedChunk queuedChunk, Chunk chunk) throws RuntimeException {
|
||||
@ -42,5 +42,5 @@ index 3a95b44..229fa6c 100644
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.9.0
|
||||
2.9.3
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 708ec78c486d50b760a68c5c6428386594eb726c Mon Sep 17 00:00:00 2001
|
||||
From 868935271be588c270debdf08d33762562ea57fa Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 21 Jun 2016 22:54:34 -0400
|
||||
Subject: [PATCH] Fix Double World Add issues
|
||||
@ -8,10 +8,10 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added.
|
||||
Also add debug if something else tries to, and abort before world gets bad state
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index d68bd28..978e7ab 100644
|
||||
index eb36e1f..3a46a0a 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -527,7 +527,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -523,7 +523,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
}
|
||||
|
||||
public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
|
||||
@ -33,5 +33,5 @@ index 1d47a117..f7d9a7c 100644
|
||||
int i = MathHelper.floor(entity.locX / 16.0D);
|
||||
int j = MathHelper.floor(entity.locZ / 16.0D);
|
||||
--
|
||||
2.9.0
|
||||
2.9.3
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren