CavePVP-Stuff/cSpigot-master/spigot-server-Patches/0009-Configurable-squid-spawn-ranges.patch

41 lines
1.8 KiB
Diff
Raw Normal View History

2023-05-01 20:59:40 +02:00
From 7a259751821ab9f9934bd6639054e71b2225ead1 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 5 Aug 2014 16:17:15 -0500
Subject: [PATCH] Configurable squid spawn ranges
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
index 6e6d612b5..bf95300da 100644
--- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
@@ -146,6 +146,7 @@ public class EntitySquid extends EntityWaterAnimal {
}
public boolean canSpawn() {
- return this.locY > 45.0D && this.locY < 63.0D && super.canSpawn();
+ // PaperSpigot - Configurable squid spawn height range
+ return this.locY > this.world.paperSpigotConfig.squidMinSpawnHeight && this.locY < this.world.paperSpigotConfig.squidMaxSpawnHeight && super.canSpawn();
}
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index b9d1afec9..f6b03499f 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -81,4 +81,13 @@ public class PaperSpigotWorldConfig
allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );
log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
}
+
+ public double squidMinSpawnHeight;
+ public double squidMaxSpawnHeight;
+ private void squidSpawnHeight()
+ {
+ squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D );
+ squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D );
+ log( "Squids will spawn between Y: " + squidMinSpawnHeight + " and Y: " + squidMaxSpawnHeight);
+ }
}
--
2.13.3