3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/Spigot-Server-Patches/0006-Configurable-squid-spawn-ranges.patch

48 Zeilen
2.0 KiB
Diff

From 3f93ef064552c89e5f00bccff99ecd3589f48b2d Mon Sep 17 00:00:00 2001
2014-06-22 22:32:38 +02:00
From: Zach Brown <Zbob750@live.com>
Date: Mon, 19 May 2014 19:30:58 -0500
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 6e6d612..da6b3a2 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
@@ -2,6 +2,8 @@ package net.minecraft.server;
import org.bukkit.craftbukkit.TrigMath; // CraftBukkit
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
2014-06-22 22:32:38 +02:00
+
public class EntitySquid extends EntityWaterAnimal {
public float bp;
@@ -146,6 +148,6 @@ public class EntitySquid extends EntityWaterAnimal {
}
public boolean canSpawn() {
- return this.locY > 45.0D && this.locY < 63.0D && super.canSpawn();
+ return this.locY > PaperSpigotWorldConfig.squidMinSpawnHeight && this.locY < PaperSpigotWorldConfig.squidMaxSpawnHeight && super.canSpawn(); // PaperSpigot - Configurable squid spawn height range
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
index 1eb5e47..dc8c581 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -81,4 +81,12 @@ 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-06-22 22:32:38 +02:00
+ public static double squidMinSpawnHeight;
+ public static double squidMaxSpawnHeight;
+ private void squidSpawnHeight()
+ {
+ squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D );
+ squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D );
+ }
}
2014-06-22 22:32:38 +02:00
--
1.9.1