Skip to content

Commit f23c039

Browse files
committed
Fix infinite recursion in spawnCategoryForChunk/Position
1 parent 2ec04e0 commit f23c039

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

patches/server/0364-implement-optional-per-player-mob-spawns.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ index 0000000000000000000000000000000000000000..11de56afaf059b00fa5bec293516bcdc
269269
+ }
270270
+}
271271
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
272-
index 75381712377c1b77289a6b5877a657af8eb39a41..056e35b00bd840d8c62c4dc978cbbe5bb8c37887 100644
272+
index d2755c00a28fa584d506259f33f8da44c2cf4842..6a8d929721f61b5235614496f60473b89a227ee5 100644
273273
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
274274
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
275275
@@ -151,6 +151,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -370,7 +370,7 @@ index f0dac1f596911eb2109192ef16a619f8ae71d1f7..07b616d9d7cde77c001f5c627daef073
370370
this.naturalSpawnChunkCounter.runAllUpdates();
371371
return this.naturalSpawnChunkCounter.chunks.size();
372372
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
373-
index 7b391d6ab84eeaed7bdd27ea70d5e3f9690a0abf..0d380bba07c5c7b6b25fa2ce554418ef8ba9fdb1 100644
373+
index cb57ac51f4acb35710f58ffce2fcc76cc88dd79b..06ddca6290b89ed96b8f9075f5c8b0b5244b9c3f 100644
374374
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
375375
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
376376
@@ -916,7 +916,18 @@ public class ServerChunkCache extends ChunkSource {
@@ -418,7 +418,7 @@ index b193f8dfbe7b61c919ad5eb452d29885982e25e4..01b9edc8aaf472650f171f1b88229807
418418

419419
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
420420
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
421-
index 6f63f471c2c9a3b85c6fc92bdee31a5ff9714ff5..c0fb5d445ed18fbf52df2be754eab0d8fb6e9239 100644
421+
index 6f63f471c2c9a3b85c6fc92bdee31a5ff9714ff5..a9d9c54c7bae0ad681a67106689897a31de49288 100644
422422
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
423423
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
424424
@@ -65,7 +65,13 @@ public final class NaturalSpawner {
@@ -499,7 +499,7 @@ index 6f63f471c2c9a3b85c6fc92bdee31a5ff9714ff5..c0fb5d445ed18fbf52df2be754eab0d8
499499

500500
+ // Paper start - add parameters and int ret type
501501
public static void spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner) {
502-
+ spawnCategoryForChunk(group, world, chunk, checker, runner);
502+
+ spawnCategoryForChunk(group, world, chunk, checker, runner, Integer.MAX_VALUE, null);
503503
+ }
504504
+ public static int spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner, int maxSpawns, Consumer<Entity> trackEntity) {
505505
+ // Paper end - add parameters and int ret type
@@ -519,7 +519,7 @@ index 6f63f471c2c9a3b85c6fc92bdee31a5ff9714ff5..c0fb5d445ed18fbf52df2be754eab0d8
519519

520520
+ // Paper start - add maxSpawns parameter and return spawned mobs
521521
public static void spawnCategoryForPosition(MobCategory group, ServerLevel world, ChunkAccess chunk, BlockPos pos, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner) {
522-
+ spawnCategoryForPosition(group, world,chunk, pos, checker, runner);
522+
+ spawnCategoryForPosition(group, world,chunk, pos, checker, runner, Integer.MAX_VALUE, null);
523523
+ }
524524
+ public static int spawnCategoryForPosition(MobCategory group, ServerLevel world, ChunkAccess chunk, BlockPos pos, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner, int maxSpawns, Consumer<Entity> trackEntity) {
525525
+ // Paper end - add maxSpawns parameter and return spawned mobs

patches/server/0741-Add-paper-mobcaps-and-paper-playermobcaps.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ index f436ab35798c9b6e6cb2eb60d2c02cbf9b742e69..4d7575087947f3b199dd895cd9aa02a7
272272
List<org.bukkit.World> worlds;
273273
if (args.length < 2 || args[1].equals("*")) {
274274
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
275-
index c0fb5d445ed18fbf52df2be754eab0d8fb6e9239..abb57345a97f36d05eab9bc96ffd6396926c219f 100644
275+
index a9d9c54c7bae0ad681a67106689897a31de49288..f0e67e007057c460f4f217fdaa60d3198d18684e 100644
276276
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
277277
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
278278
@@ -148,32 +148,16 @@ public final class NaturalSpawner {
@@ -345,7 +345,7 @@ index c0fb5d445ed18fbf52df2be754eab0d8fb6e9239..abb57345a97f36d05eab9bc96ffd6396
345345
+
346346
// Paper start - add parameters and int ret type
347347
public static void spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner) {
348-
spawnCategoryForChunk(group, world, chunk, checker, runner);
348+
spawnCategoryForChunk(group, world, chunk, checker, runner, Integer.MAX_VALUE, null);
349349
diff --git a/src/test/java/io/papermc/paper/PaperCommandTest.java b/src/test/java/io/papermc/paper/PaperCommandTest.java
350350
new file mode 100644
351351
index 0000000000000000000000000000000000000000..4b5b368ef17bdb90f50e6ccc1f814cf93c7c0590

0 commit comments

Comments
 (0)