3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 03:20:07 +01:00
Paper/Spigot-Server-Patches/0007-Configurable-squid-spawn-ranges.patch

41 Zeilen
1.8 KiB
Diff

2014-08-06 01:45:22 +02:00
From 2eaa0b4e142f591ab7c320f0ff3a96c4f406cd38 Mon Sep 17 00:00:00 2001
2014-06-22 22:32:38 +02:00
From: Zach Brown <Zbob750@live.com>
2014-08-06 01:45:22 +02:00
Date: Tue, 5 Aug 2014 16:17:15 -0500
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
2014-08-06 01:45:22 +02:00
index 6e6d612..bf95300 100644
2014-06-22 22:32:38 +02:00
--- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
2014-08-06 01:45:22 +02:00
@@ -146,6 +146,7 @@ public class EntitySquid extends EntityWaterAnimal {
2014-06-22 22:32:38 +02:00
}
public boolean canSpawn() {
- return this.locY > 45.0D && this.locY < 63.0D && super.canSpawn();
2014-08-06 01:45:22 +02:00
+ // PaperSpigot - Configurable squid spawn height range
+ return this.locY > this.world.paperSpigotConfig.squidMinSpawnHeight && this.locY < this.world.paperSpigotConfig.squidMaxSpawnHeight && super.canSpawn();
2014-06-22 22:32:38 +02:00
}
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2014-08-06 01:45:22 +02:00
index b9d1afe..f6b0349 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
2014-08-06 01:45:22 +02:00
@@ -81,4 +81,13 @@ public class PaperSpigotWorldConfig
allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );
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 );
2014-08-06 01:45:22 +02:00
+ log( "Squids will spawn between Y: " + squidMinSpawnHeight + " and Y: " + squidMaxSpawnHeight);
2014-06-22 22:32:38 +02:00
+ }
}
2014-06-22 22:32:38 +02:00
--
1.9.1