mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 04:31:58 +01:00
df984898ac
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes:7554e08e
Add UUID support to CraftProfileBanList3fe37460
SPIGOT-5378: Fix TileEntity fixer deadlock12386dd4
SPIGOT-5375: Add spaces to coordinates from tile fixer606c19e2
SPIGOT-5373: Simultaneous left+right click in creative mode does not work13caf848
SPIGOT-5370: Fix Block#rayTrace considering other blocks.
60 lines
2.7 KiB
Diff
60 lines
2.7 KiB
Diff
From 7b2b782e1ca503f84d3fbc1df497fcaa2381f7b3 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sun, 24 Mar 2019 01:01:32 -0400
|
|
Subject: [PATCH] Only count Natural Spawned mobs towards natural spawn mob
|
|
limit
|
|
|
|
This resolves the super common complaint about mobs not spawning.
|
|
|
|
This was ultimately a flaw in the vanilla count algorithim that allows
|
|
spawners and other misc mobs to count against the mob limit, which are
|
|
not bounded, and can prevent the entire world from spawning new.
|
|
|
|
I believe Bukkits changes around persistence may of actually made it
|
|
worse than vanilla.
|
|
|
|
This should fully solve all of the issues around it so that only natural
|
|
influences natural spawns.
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index 929f5c3031..ff520d9e86 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -509,6 +509,16 @@ public class PaperWorldConfig {
|
|
maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24);
|
|
}
|
|
|
|
+ public boolean countAllMobsForSpawning = false;
|
|
+ private void countAllMobsForSpawning() {
|
|
+ countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false);
|
|
+ if (countAllMobsForSpawning) {
|
|
+ log("Counting all mobs for spawning. Mob farms may reduce natural spawns elsewhere in world.");
|
|
+ } else {
|
|
+ log("Using improved mob spawn limits (Only Natural Spawns impact spawn limits for more natural spawns)");
|
|
+ }
|
|
+ }
|
|
+
|
|
public boolean antiXray;
|
|
public boolean asynchronous;
|
|
public EngineMode engineMode;
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
|
index 7c5349b172..0761f705be 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -934,6 +934,13 @@ public class WorldServer extends World {
|
|
EnumCreatureType enumcreaturetype = entity.getEntityType().e();
|
|
|
|
if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().b(entity)) {
|
|
+ // Paper start - Only count natural spawns
|
|
+ if (!this.paperConfig.countAllMobsForSpawning &&
|
|
+ !(entity.spawnReason == CreatureSpawnEvent.SpawnReason.NATURAL ||
|
|
+ entity.spawnReason == CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
|
|
+ continue;
|
|
+ }
|
|
+ // Paper end
|
|
object2intmap.mergeInt(enumcreaturetype, 1, Integer::sum);
|
|
}
|
|
}
|
|
--
|
|
2.22.1
|
|
|