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

41 lines
1.8 KiB
Diff
Raw Normal View History

2016-06-09 05:57:14 +02:00
From d28a7aa05ce6180aeb5248aeb987ba08a6ab42b7 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
index dae60dc..c74c8a7 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
@@ -69,4 +69,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
2016-06-09 05:57:14 +02:00
index c5ac670..85aebc0 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
2016-06-09 05:57:14 +02:00
@@ -145,7 +145,8 @@ public class EntitySquid extends EntityWaterAnimal {
2016-03-01 00:09:49 +01:00
}
2016-06-09 05:57:14 +02:00
public boolean cK() {
- return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cK();
2016-03-01 00:09:49 +01:00
+ // Paper - Configurable squid spawn height range
2016-06-09 05:57:14 +02:00
+ return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cK();
2016-03-01 00:09:49 +01:00
}
public void b(float f, float f1, float f2) {
--
2016-06-09 05:57:14 +02:00
2.8.3
2016-03-01 00:09:49 +01:00