diff options
Diffstat (limited to 'patches/server/0794-Make-water-animal-spawn-height-configurable.patch')
-rw-r--r-- | patches/server/0794-Make-water-animal-spawn-height-configurable.patch | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/patches/server/0794-Make-water-animal-spawn-height-configurable.patch b/patches/server/0794-Make-water-animal-spawn-height-configurable.patch new file mode 100644 index 0000000000..dea45f0b70 --- /dev/null +++ b/patches/server/0794-Make-water-animal-spawn-height-configurable.patch @@ -0,0 +1,21 @@ +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/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java +index 522abd880c1e7f7c9026f0ab6457bc649f11802c..18389f46902bb9879ac6d734723e9a720724dc48 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, RandomSource random) { + int i = world.getSeaLevel(); + int j = i - 13; ++ // Paper start ++ i = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(i); ++ j = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(j); ++ // Paper end + return pos.getY() >= j && pos.getY() <= i && world.getFluidState(pos.below()).is(FluidTags.WATER) && world.getBlockState(pos.above()).is(Blocks.WATER); + } + } |