Chunk System and Starlight WIP
Chunk system patch was refactored to take advantage of newer ConcurrentUtil's concurrent long hash table (which fixes hash collisions caused by chaining fastutil's long hash and CHM's hash) plus some other minor improvements. The chunk system was also merged with Starlight, which mostly provides a small improvement to ThreadedLevelLightEngine#checkBlock as the scheduling was rewritten.
This commit is contained in:
@@ -22,7 +22,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
|
||||
RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
|
||||
@@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
if (nbt == null) {
|
||||
regionfile.clear(pos);
|
||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||
dataoutputstream.close();
|
||||
}
|
||||
}
|
||||
|
||||
28736
patches/server/Chunk-System-Starlight-from-Moonrise.patch
Normal file
28736
patches/server/Chunk-System-Starlight-from-Moonrise.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -47,7 +47,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
try {
|
||||
NbtIo.write(nbt, (DataOutput) dataoutputstream);
|
||||
@@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
} catch (Throwable throwable1) {
|
||||
throwable.addSuppressed(throwable1);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
throw throwable;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
// Paper start - Chunk save reattempt
|
||||
return;
|
||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||
public RegionStorageInfo info() {
|
||||
return this.info;
|
||||
}
|
||||
|
||||
@@ -29210,6 +29210,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return correct.equals(value) ? null : correct;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystemConverters.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystemConverters.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystemConverters.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystemConverters.java
|
||||
@@ -0,0 +0,0 @@ public final class ChunkSystemConverters {
|
||||
public static CompoundTag convertPoiCompoundTag(final CompoundTag data, final ServerLevel world) {
|
||||
final int dataVersion = getDataVersion(data, DEFAULT_POI_DATA_VERSION);
|
||||
|
||||
- return DataFixTypes.POI_CHUNK.update(world.getServer().getFixerUpper(), data, dataVersion, getCurrentVersion());
|
||||
+ // Paper start - dataconverter
|
||||
+ return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(
|
||||
+ ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.POI_CHUNK, data, dataVersion, getCurrentVersion()
|
||||
+ );
|
||||
+ // Paper end - dataconverter
|
||||
}
|
||||
|
||||
public static CompoundTag convertEntityChunkCompoundTag(final CompoundTag data, final ServerLevel world) {
|
||||
final int dataVersion = getDataVersion(data, DEFAULT_ENTITY_CHUNK_DATA_VERSION);
|
||||
|
||||
- return DataFixTypes.ENTITY_CHUNK.update(world.getServer().getFixerUpper(), data, dataVersion, getCurrentVersion());
|
||||
+ // Paper start - dataconverter
|
||||
+ return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(
|
||||
+ ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, data, dataVersion, getCurrentVersion()
|
||||
+ );
|
||||
+ // Paper end - dataconverter
|
||||
}
|
||||
|
||||
private ChunkSystemConverters() {}
|
||||
diff --git a/src/main/java/net/minecraft/data/structures/StructureUpdater.java b/src/main/java/net/minecraft/data/structures/StructureUpdater.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/data/structures/StructureUpdater.java
|
||||
@@ -29227,7 +29255,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable, ca.spottedleaf.moonrise.patc
|
||||
} else {
|
||||
try {
|
||||
// CraftBukkit start
|
||||
@@ -29236,7 +29264,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
CompoundTag level = nbttagcompound.getCompound("Level");
|
||||
if (level.getBoolean("TerrainPopulated") && !level.getBoolean("LightPopulated")) {
|
||||
ServerChunkCache cps = (generatoraccess == null) ? null : ((ServerLevel) generatoraccess).getChunkSource();
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable, ca.spottedleaf.moonrise.patc
|
||||
// CraftBukkit end
|
||||
|
||||
if (i < 1493) {
|
||||
@@ -29245,7 +29273,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) {
|
||||
LegacyStructureDataHandler persistentstructurelegacy = this.getLegacyStructureHandler(resourcekey, supplier);
|
||||
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable, ca.spottedleaf.moonrise.patc
|
||||
// Spigot end
|
||||
|
||||
ChunkStorage.injectDatafixingContext(nbttagcompound, resourcekey, optional);
|
||||
|
||||
@@ -14,7 +14,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
|
||||
if (regionfile != null) {
|
||||
return regionfile;
|
||||
} else {
|
||||
|
||||
@@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
this.handlingTick = false;
|
||||
gameprofilerfiller.pop();
|
||||
|
||||
Reference in New Issue
Block a user