NOT FINISHED! She compiles, and she... suffers the wrath of chunkgen...
This commit is contained in:
@@ -137,7 +137,7 @@ index 000000000..4f624e39c
|
||||
+}
|
||||
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 000000000..089154f62
|
||||
index 000000000..0bb63600f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/TimedChunkGenerator.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -167,11 +167,20 @@ index 000000000..089154f62
|
||||
+
|
||||
+package co.aikar.timings;
|
||||
+
|
||||
+import net.minecraft.server.BiomeBase;
|
||||
+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.GeneratorSettings;
|
||||
+import net.minecraft.server.IChunkAccess;
|
||||
+import net.minecraft.server.RegionLimitedWorldAccess;
|
||||
+import net.minecraft.server.StructureGenerator;
|
||||
+import net.minecraft.server.StructureStart;
|
||||
+import net.minecraft.server.World;
|
||||
+import net.minecraft.server.WorldChunkManager;
|
||||
+import net.minecraft.server.WorldGenFeatureConfiguration;
|
||||
+import net.minecraft.server.WorldGenStage;
|
||||
+import net.minecraft.server.WorldServer;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.generator.InternalChunkGenerator;
|
||||
@@ -181,6 +190,10 @@ index 000000000..089154f62
|
||||
+import java.util.List;
|
||||
+import java.util.Random;
|
||||
+
|
||||
+import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||
+import it.unimi.dsi.fastutil.longs.LongSet;
|
||||
+
|
||||
+// TODO: timing handlers
|
||||
+public class TimedChunkGenerator extends InternalChunkGenerator {
|
||||
+ private final WorldServer world;
|
||||
+ private final InternalChunkGenerator timedGenerator;
|
||||
@@ -190,25 +203,6 @@ index 000000000..089154f62
|
||||
+ 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) {
|
||||
@@ -229,47 +223,102 @@ index 000000000..089154f62
|
||||
+ 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);
|
||||
+ public void createChunk(IChunkAccess ichunkaccess) {
|
||||
+ try (Timing ignored = world.timings.chunkGeneration.startTiming()) {
|
||||
+ timedGenerator.createChunk(ichunkaccess);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean a(Chunk chunk, int i, int j) {
|
||||
+ return timedGenerator.a(chunk, i, j);
|
||||
+ public void addFeatures(RegionLimitedWorldAccess regionlimitedworldaccess, WorldGenStage.Features worldgenstage_features) {
|
||||
+ timedGenerator.addFeatures(regionlimitedworldaccess, worldgenstage_features);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<BiomeMeta> getMobsFor(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
|
||||
+ public void addDecorations(RegionLimitedWorldAccess regionlimitedworldaccess) {
|
||||
+ timedGenerator.addDecorations(regionlimitedworldaccess);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void addMobs(RegionLimitedWorldAccess regionlimitedworldaccess) {
|
||||
+ timedGenerator.addMobs(regionlimitedworldaccess);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<BiomeBase.BiomeMeta> getMobsFor(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
|
||||
+ return timedGenerator.getMobsFor(enumcreaturetype, blockposition);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @Nullable
|
||||
+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, boolean flag) {
|
||||
+ return timedGenerator.findNearestMapFeature(world, s, blockposition, flag);
|
||||
+ @Override
|
||||
+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, int i) {
|
||||
+ return timedGenerator.findNearestMapFeature(world, s, blockposition, i);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void recreateStructures(Chunk chunk, int i, int j) {
|
||||
+ try (Timing ignored = world.timings.syncChunkLoadStructuresTimer.startTiming()) {
|
||||
+ timedGenerator.recreateStructures(chunk, i, j);
|
||||
+ }
|
||||
+ public GeneratorSettings getSettings() {
|
||||
+ return timedGenerator.getSettings();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean a(World world, String s, BlockPosition blockPosition) {
|
||||
+ return timedGenerator.a(world, s, blockPosition);
|
||||
+ public int a(World world, boolean flag, boolean flag1) {
|
||||
+ return timedGenerator.a(world, flag, flag1);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public WorldChunkManager getWorldChunkManager() {
|
||||
+ return timedGenerator.getWorldChunkManager();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public long getSeed() {
|
||||
+ return timedGenerator.getSeed();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getSpawnHeight() {
|
||||
+ return timedGenerator.getSpawnHeight();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int e() {
|
||||
+ return timedGenerator.e();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public World getWorld() {
|
||||
+ return timedGenerator.getWorld();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Long2ObjectMap<LongSet> getStructureCache(StructureGenerator structuregenerator) {
|
||||
+ return timedGenerator.getStructureCache(structuregenerator);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Long2ObjectMap<StructureStart> getStructureStartCache(StructureGenerator structuregenerator) {
|
||||
+ return timedGenerator.getStructureStartCache(structuregenerator);
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public WorldGenFeatureConfiguration getFeatureConfiguration(BiomeBase biomebase, StructureGenerator structuregenerator) {
|
||||
+ return timedGenerator.getFeatureConfiguration(biomebase, structuregenerator);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSpawnStructure(BiomeBase biomebase, StructureGenerator structuregenerator) {
|
||||
+ return timedGenerator.canSpawnStructure(biomebase, structuregenerator);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
@@ -495,7 +544,7 @@ index 0296d3ef0..badfe86b2 100644
|
||||
this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot
|
||||
} catch (IOException ioexception) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 42050f06d..e26860516 100644
|
||||
index 90d857105..3a0e52d88 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -989,7 +1038,7 @@ index ac6d8cc6e..d975c2ccf 100644
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 749be86fe..c2eb3a58d 100644
|
||||
index 6f21b01a8..359aa3997 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.inventory.CraftingInventory;
|
||||
|
||||
Reference in New Issue
Block a user