3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/patches/server/0172-Make-max-squid-spawn-height-configurable.patch
MiniDigger 4104545b11 remove system property for book size limits
"It was from a different time before books were as jank as they are now. As time has gone on they've only proven to be worse and worse."
2021-06-17 21:12:40 +02:00

37 Zeilen
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 11 Jan 2018 16:47:28 -0600
Subject: [PATCH] Make max squid spawn height configurable
I don't know why upstream made only the minimum height configurable but
whatever
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 90ca51dfdbb3045dd528450225cba96f5834166e..3577100f850975020b74f077d688f59dbca78962 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -342,4 +342,9 @@ public class PaperWorldConfig {
disableCreeperLingeringEffect = getBoolean("disable-creeper-lingering-effect", false);
log("Creeper lingering effect: " + disableCreeperLingeringEffect);
}
+
+ public double squidMaxSpawnHeight;
+ private void squidMaxSpawnHeight() {
+ squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D);
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
index 3093fc37c47bec1a6e884553809277fff1053d8e..56838c9f214c0f75041e75c45ad1a0c72fcacc66 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
@@ -211,7 +211,8 @@ public class Squid extends WaterAnimal {
}
public static boolean checkSquidSpawnRules(EntityType<Squid> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
- return pos.getY() > world.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && pos.getY() < world.getSeaLevel(); // Spigot
+ final double maxHeight = world.getMinecraftWorld().paperConfig.squidMaxSpawnHeight > 0 ? world.getMinecraftWorld().paperConfig.squidMaxSpawnHeight : world.getSeaLevel(); // Paper
+ return pos.getY() > world.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && pos.getY() < maxHeight; // Spigot // Paper
}
@Override