mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-06 10:49:40 +01:00
0728696e06
Base our vanish changes on top of that event.
40 lines
1.8 KiB
Diff
40 lines
1.8 KiB
Diff
From ba20e837e38f468c105978d3289fe3c5b31fdea8 Mon Sep 17 00:00:00 2001
|
|
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
|
|
--- 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 {
|
|
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 9f88e44..56f7ca8 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySquid.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
|
|
@@ -141,7 +141,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
}
|
|
|
|
public boolean cM() {
|
|
- return this.locY > 45.0D && this.locY < (double) this.world.K() && super.cM();
|
|
+ return this.locY > world.paperConfig.squidMinSpawnHeight && this.locY < world.paperConfig.squidMaxSpawnHeight && super.cM(); // Paper - Configurable squid spawn height range
|
|
}
|
|
|
|
public void b(float f, float f1, float f2) {
|
|
--
|
|
2.9.3
|
|
|