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

39 lines
2 KiB
Diff
Raw Normal View History

2014-06-22 22:32:38 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
2015-03-08 02:16:09 +01:00
Date: Sat, 7 Mar 2015 20:20:29 -0600
2014-06-22 22:32:38 +02:00
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
@@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal {
}
2015-03-08 02:16:09 +01:00
public boolean bR() {
- return this.locY > 45.0D && this.locY < (double) this.world.F() && super.bR();
2014-11-28 02:17:45 +01:00
+ // PaperSpigot - Configurable squid spawn range
2015-03-08 02:16:09 +01:00
+ return this.locY > this.world.paperSpigotConfig.squidMinSpawnHeight && this.locY < (double) this.world.paperSpigotConfig.squidMaxSpawnHeight && super.bR();
2014-06-22 22:32:38 +02:00
}
2014-11-28 02:17:45 +01:00
public void b(float f, float f1, float f2) {
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2014-06-22 22:32:38 +02:00
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
2015-03-08 02:16:09 +01:00
allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", false );
log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
2014-06-22 22:32:38 +02:00
}
+
2014-08-06 01:45:22 +02:00
+ public double squidMinSpawnHeight;
+ public double squidMaxSpawnHeight;
2014-06-22 22:32:38 +02:00
+ private void squidSpawnHeight()
+ {
+ squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D );
+ squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D );
2015-03-08 02:16:09 +01:00
+ log( "Squids will spawn between Y: " + squidMinSpawnHeight + " and Y: " + squidMaxSpawnHeight );
2014-06-22 22:32:38 +02:00
+ }
}
2015-03-08 02:16:09 +01:00
--