Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,30 @@
} else {
filteredSpawningCategories = List.of();
}
@@ -430,6 +_,23 @@
this.level.tickThunder(chunk);
}

+ // Paper start - disable mob spawning within configured radius around spawn chunk
+ int mobSpawningDisableRadiusAroundSpawnChunk = level.paperConfig().chunks.mobSpawningDisableRadiusAroundSpawnChunk;
+
+ if (mobSpawningDisableRadiusAroundSpawnChunk >= 0)
+ {
+ ChunkPos spawnChunk = new net.minecraft.world.level.ChunkPos(level.getSharedSpawnPos());
+
+ if (pos.x <= spawnChunk.x + mobSpawningDisableRadiusAroundSpawnChunk &&
+ pos.x >= spawnChunk.x - mobSpawningDisableRadiusAroundSpawnChunk &&
+ pos.z <= spawnChunk.z + mobSpawningDisableRadiusAroundSpawnChunk &&
+ pos.z >= spawnChunk.z - mobSpawningDisableRadiusAroundSpawnChunk)
+ {
+ return;
+ }
+ }
+ // Paper end - disable mob spawning within configured radius around spawn chunk
+
if (!spawnCategories.isEmpty()) {
if (this.level.canSpawnEntitiesInChunk(pos)) {
NaturalSpawner.spawnForChunk(this.level, chunk, spawnState, spawnCategories);
@@ -547,8 +_,13 @@

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ public class Chunks extends ConfigurationPart {
map.put(EntityType.SMALL_FIREBALL, -1);
});
public boolean flushRegionsOnSave = false;
public int mobSpawningDisableRadiusAroundSpawnChunk = -1;

@PostProcess
private void postProcess() {
Expand Down