PaperMC/Spigot-Server-Patches/0006-Configurable-squid-spawn-ranges.patch

41 lines
1.8 KiB
Diff
Raw Normal View History

2016-03-25 05:59:37 +01:00
From 825f03c5427faf4c8e0275347dacacb47ab28179 Mon Sep 17 00:00:00 2001
2016-03-01 00:09:49 +01:00
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 12:45:11 -0600
Subject: [PATCH] Configurable squid spawn ranges
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2016-03-18 22:41:26 +01:00
index 2d50237..fe9502c 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2016-03-18 22:41:26 +01:00
@@ -66,4 +66,12 @@ public class PaperWorldConfig {
2016-03-01 00:09:49 +01:00
config.addDefault("world-settings.default." + path, def);
return config.getString("world-settings." + worldName + "." + path, config.getString("world-settings.default." + path));
}
+
+ public double squidMinSpawnHeight;
+ public double squidMaxSpawnHeight;
+ private void squidSpawnHeights() {
+ 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);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
index b94444d..9f1a50e 100644
--- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
@@ -138,7 +138,8 @@ public class EntitySquid extends EntityWaterAnimal {
}
public boolean cF() {
- return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cF();
+ // Paper - Configurable squid spawn height range
+ return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cF();
}
public void b(float f, float f1, float f2) {
--
2016-03-25 05:59:37 +01:00
2.7.1.windows.2
2016-03-01 00:09:49 +01:00