mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-27 22:29:21 +02:00
Add a config for mob spawn change, really shouldn't use it
turning this to true allows 1 player to deny other players the ability to have mobs spawn. It really is a bad idea and reverts back to iffy mob spawn limits where mob farms in the world stops natural spawns from occuring. Really recommend resorting to different solutions than ever using this config.
This commit is contained in:
parent
6e81645df1
commit
5b0b2630b1
1 changed files with 21 additions and 2 deletions
|
@ -16,8 +16,27 @@ 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 f259c4e514..fa1d88aa84 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
log("Using vanilla redstone algorithm.");
|
||||
}
|
||||
}
|
||||
+
|
||||
+ 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/com/destroystokyo/paper/PaperWorldEntityList.java b/src/main/java/com/destroystokyo/paper/PaperWorldEntityList.java
|
||||
index a10a5bc138..8ad00c7d11 100644
|
||||
index a10a5bc138..346176cf98 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldEntityList.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldEntityList.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.server.IAnimal;
|
||||
|
@ -34,7 +53,7 @@ index a10a5bc138..8ad00c7d11 100644
|
|||
public void updateEntityCount(Entity entity, int amt) {
|
||||
- if (!(entity instanceof IAnimal)) return;
|
||||
+ // Only count natural spawns so that mob
|
||||
+ if (!(entity instanceof IAnimal) || entity.spawnReason != SpawnReason.NATURAL) return;
|
||||
+ if (!(entity instanceof IAnimal) || (entity.spawnReason != SpawnReason.NATURAL && !world.paperConfig.countAllMobsForSpawning)) return;
|
||||
|
||||
if (entity instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
|
|
Loading…
Add table
Reference in a new issue