diff options
author | Nassim Jahnke <[email protected]> | 2022-05-09 11:03:07 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-05-09 11:03:07 +0200 |
commit | 18f0f8d1cad34c3d1566defcc94e5536e3260d41 (patch) | |
tree | e4dff5b5ffa6467f2f48c60693f7264c79511945 /patches/server/0832-Make-water-animal-spawn-height-configurable.patch | |
parent | 268476bba3f1796fffff13a213e3ffa81ff76cc6 (diff) | |
download | Paper-18f0f8d1cad34c3d1566defcc94e5536e3260d41.tar.gz Paper-18f0f8d1cad34c3d1566defcc94e5536e3260d41.zip |
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
312281ea PR-742: Make World implement Keyed
CraftBukkit Changes:
2ac7fa7a SPIGOT-7014: getLootTable API should not persistently update loot table
7fdd7941 PR-1046: Make World implement Keyed
7bc728a6 PR-1045: Revert changes to persistence required checks
Spigot Changes:
b6d12d17 Rebuild patches
Diffstat (limited to 'patches/server/0832-Make-water-animal-spawn-height-configurable.patch')
-rw-r--r-- | patches/server/0832-Make-water-animal-spawn-height-configurable.patch | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/patches/server/0832-Make-water-animal-spawn-height-configurable.patch b/patches/server/0832-Make-water-animal-spawn-height-configurable.patch deleted file mode 100644 index 6d771b9cf6..0000000000 --- a/patches/server/0832-Make-water-animal-spawn-height-configurable.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Brokkonaut <[email protected]> -Date: Sat, 18 Dec 2021 08:26:55 +0100 -Subject: [PATCH] Make water animal spawn height configurable - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 937d0574f4d1989475345690e800783a84a16602..dcd42cfe2a9ac3e33565340e83ede1bd98ba3814 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -416,6 +416,24 @@ public class PaperWorldConfig { - mobSpawnerTickRate = getInt("mob-spawner-tick-rate", 1); - } - -+ public Integer waterAnimalMaxSpawnHeight; -+ private void waterAnimalMaxSpawnHeight() { -+ String v = getString("wateranimal-spawn-height.maximum", "default"); -+ try { -+ waterAnimalMaxSpawnHeight = Integer.parseInt(v); -+ } catch (NumberFormatException ignored) { -+ } -+ } -+ -+ public Integer waterAnimalMinSpawnHeight; -+ private void waterAnimalMinSpawnHeight() { -+ String v = getString("wateranimal-spawn-height.minimum", "default"); -+ try { -+ waterAnimalMinSpawnHeight = Integer.parseInt(v); -+ } catch (NumberFormatException ignored) { -+ } -+ } -+ - public int containerUpdateTickRate; - private void containerUpdateTickRate() { - containerUpdateTickRate = getInt("container-update-tick-rate", 1); -diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -index 69f7e034cab1bfd7ca5dffc660b6decd739adf35..c039b896ee85543c26a8ab76640080f539deaa4c 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -+++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -@@ -79,6 +79,10 @@ public abstract class WaterAnimal extends PathfinderMob { - public static boolean checkSurfaceWaterAnimalSpawnRules(EntityType<? extends WaterAnimal> type, LevelAccessor world, MobSpawnType reason, BlockPos pos, Random random) { - int i = world.getSeaLevel(); - int j = i - 13; -+ // Paper start -+ i = world.getMinecraftWorld().paperConfig.waterAnimalMaxSpawnHeight != null ? world.getMinecraftWorld().paperConfig.waterAnimalMaxSpawnHeight : i; -+ j = world.getMinecraftWorld().paperConfig.waterAnimalMinSpawnHeight != null ? world.getMinecraftWorld().paperConfig.waterAnimalMinSpawnHeight : j; -+ // Paper end - return pos.getY() >= j && pos.getY() <= i && world.getFluidState(pos.below()).is(FluidTags.WATER) && world.getBlockState(pos.above()).is(Blocks.WATER); - } - } |