mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
update setSeed
This commit is contained in:
@@ -1208,7 +1208,7 @@ index e957ddea7c6cd9685e362a4b1adc09fdd3bfd359..188a62f00bd541f27adaaa4250b56276
|
||||
|
||||
public boolean hasWork() {
|
||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 488fc6088d69148f60a913b42ffb964c48eb0324..94851554c2c3e0f5a2d72606fda166adb586bbca 100644
|
||||
index d4858fe6a195acd17aea098401a5ee7baa5ad4d1..3aa09ea7498fb0d790cc47c66a8e89df981671e2 100644
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -27,8 +27,6 @@ import net.minecraft.network.protocol.Packet;
|
||||
@@ -1297,7 +1297,7 @@ index 488fc6088d69148f60a913b42ffb964c48eb0324..94851554c2c3e0f5a2d72606fda166ad
|
||||
int naturalSpawnChunkCount = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
// Paper start - Optional per player mob spawns
|
||||
NaturalSpawner.SpawnState spawnState;
|
||||
@@ -580,14 +560,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -580,16 +560,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
List<LevelChunk> list = this.spawningChunks;
|
||||
|
||||
try {
|
||||
@@ -1305,14 +1305,16 @@ index 488fc6088d69148f60a913b42ffb964c48eb0324..94851554c2c3e0f5a2d72606fda166ad
|
||||
this.chunkMap.collectSpawningChunks(list);
|
||||
- profiler.popPush("shuffleSpawningChunks");
|
||||
// Paper start - chunk tick iteration optimisation
|
||||
if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) {
|
||||
this.shuffleRandom.setSeed(this.level.random.nextLong());
|
||||
if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled
|
||||
Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled
|
||||
}
|
||||
// Paper end - chunk tick iteration optimisation
|
||||
- profiler.popPush("tickSpawningChunks");
|
||||
|
||||
for (LevelChunk levelChunk : list) {
|
||||
this.tickSpawningChunk(levelChunk, timeInhabited, filteredSpawningCategories, spawnState);
|
||||
@@ -596,14 +573,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -598,14 +575,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
list.clear();
|
||||
}
|
||||
|
||||
@@ -1327,7 +1329,7 @@ index 488fc6088d69148f60a913b42ffb964c48eb0324..94851554c2c3e0f5a2d72606fda166ad
|
||||
}
|
||||
|
||||
private void tickSpawningChunk(LevelChunk chunk, long timeInhabited, List<MobCategory> spawnCategories, NaturalSpawner.SpawnState spawnState) {
|
||||
@@ -824,7 +797,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -826,7 +799,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
|
||||
@Override
|
||||
protected void doRunTask(Runnable task) {
|
||||
|
||||
@@ -52,10 +52,10 @@ index a9cd61f0a7bde931e59f1496191f1f8d465aec5e..7711cc269b97811836f1b1dafd0f38ea
|
||||
this.get("generator-settings", property -> GsonHelper.parse(!property.isEmpty() ? property : "{}"), new JsonObject()),
|
||||
this.get("level-type", property -> property.toLowerCase(Locale.ROOT), WorldPresets.NORMAL.location().toString())
|
||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 94851554c2c3e0f5a2d72606fda166adb586bbca..ca0c38974d75e95d258978ff9c8a2749ad741aa5 100644
|
||||
index 3aa09ea7498fb0d790cc47c66a8e89df981671e2..d36ec0581e541dea9fffe2c4b9a0ea4da5e5ac0f 100644
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -614,6 +614,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -616,6 +616,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
}
|
||||
|
||||
public ChunkGenerator getGenerator() {
|
||||
|
||||
@@ -34,7 +34,7 @@ index d2ac3057cd6d27c9f0ec043421cbb72b57853b97..c37851095cfe637a2768de0aa179efe6
|
||||
return true;
|
||||
}
|
||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||
index ca0c38974d75e95d258978ff9c8a2749ad741aa5..d8f0bd8173836796ecdd9771b637d24c7a807a79 100644
|
||||
index d36ec0581e541dea9fffe2c4b9a0ea4da5e5ac0f..c5b95557dc148cfc91c031bf0789001868a60cbd 100644
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -183,6 +183,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -151,7 +151,7 @@ index ca0c38974d75e95d258978ff9c8a2749ad741aa5..d8f0bd8173836796ecdd9771b637d24c
|
||||
} else {
|
||||
filteredSpawningCategories = List.of();
|
||||
}
|
||||
@@ -567,7 +616,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -569,7 +618,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
// Paper end - chunk tick iteration optimisation
|
||||
|
||||
for (LevelChunk levelChunk : list) {
|
||||
@@ -160,7 +160,7 @@ index ca0c38974d75e95d258978ff9c8a2749ad741aa5..d8f0bd8173836796ecdd9771b637d24c
|
||||
}
|
||||
} finally {
|
||||
list.clear();
|
||||
@@ -586,11 +635,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -588,11 +637,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
this.level.tickThunder(chunk);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ index 04dd1bec1aff470e67a21fb0b25932685992ec82..72a0a80f1fffa43e143c80c689db5302
|
||||
|
||||
Objects.checkFromToIndex(0, size, raw.length);
|
||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||
index e23f2004705fc299934a8b30e736ddf0a8eb2147..e8efa7b12746423de11b6970efe1651db2509511 100644
|
||||
index 6ea62fbffda38e477ef8e119608fc93793db95c3..dda53860397ee52f64209a8d08a7707cfa2f7592 100644
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -57,7 +57,7 @@ import org.slf4j.Logger;
|
||||
@@ -196,7 +196,7 @@ index e23f2004705fc299934a8b30e736ddf0a8eb2147..e8efa7b12746423de11b6970efe1651d
|
||||
List<LevelChunk> list = this.spawningChunks;
|
||||
|
||||
try {
|
||||
@@ -625,12 +668,12 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -627,12 +670,12 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
} finally {
|
||||
list.clear();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -584,8 +_,10 @@
|
||||
this.chunkMap.collectSpawningChunks(list);
|
||||
profiler.popPush("shuffleSpawningChunks");
|
||||
// Paper start - chunk tick iteration optimisation
|
||||
- this.shuffleRandom.setSeed(this.level.random.nextLong());
|
||||
- if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled
|
||||
+ if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) {
|
||||
+ this.shuffleRandom.setSeed(this.level.random.nextLong());
|
||||
+ Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled
|
||||
+ }
|
||||
// Paper end - chunk tick iteration optimisation
|
||||
profiler.popPush("tickSpawningChunks");
|
||||
|
||||
Reference in New Issue
Block a user