mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
bc127ea819
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: eec4aab0 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent 205213c6 SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron CraftBukkit Changes: b8c522d5 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent f04a77dc SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron d1dbcebc SPIGOT-6653: Canceling snow bucket placement removes snow from bucket 4f34a67b #891: Fix scheduler task ID overflow and duplication issues Spigot Changes: d03d7f12 BUILDTOOLS-604: Rebuild patches
57 lines
2.9 KiB
Diff
57 lines
2.9 KiB
Diff
From 0000000000000000000000000000000000000000 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 090958a30ce20ff01ae77d4cd821a167474f0214..baf33659b021c89cbd02560cbfd9b0ddf205f0e2 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -401,4 +401,15 @@ public class PaperWorldConfig {
|
|
private void preventMovingIntoUnloadedChunks() {
|
|
preventMovingIntoUnloadedChunks = getBoolean("prevent-moving-into-unloaded-chunks", false);
|
|
}
|
|
+
|
|
+ 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)");
|
|
+ }
|
|
+ }
|
|
}
|
|
+
|
|
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
index c3fa1e8077f0f6a1f533c644dda9cb29265129a6..95e5660e6cb1afb5ebdb3dbbe59a07c879bddb4b 100644
|
|
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
@@ -85,6 +85,13 @@ public final class NaturalSpawner {
|
|
MobCategory enumcreaturetype = entity.getType().getCategory();
|
|
|
|
if (enumcreaturetype != MobCategory.MISC) {
|
|
+ // Paper start - Only count natural spawns
|
|
+ if (!entity.level.paperConfig.countAllMobsForSpawning &&
|
|
+ !(entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL ||
|
|
+ entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
|
|
+ continue;
|
|
+ }
|
|
+ // Paper end
|
|
BlockPos blockposition = entity.blockPosition();
|
|
long j = ChunkPos.asLong(SectionPos.blockToSectionCoord(blockposition.getX()), SectionPos.blockToSectionCoord(blockposition.getZ()));
|
|
|