mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 21:17:00 +01:00
1358d1e914
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: 881e06e5 PR-725: Add Item Unlimited Lifetime APIs CraftBukkit Changes: 74c08312 SPIGOT-6962: Call EntityChangeBlockEvent when when FallingBlockEntity starts to fall 64db5126 SPIGOT-6959: Make /loot command ignore empty items for spawn 2d760831 Increase outdated build delay 9ed7e4fb SPIGOT-6138, SPIGOT-6415: Don't call CreatureSpawnEvent after cross-dimensional travel fc4ad813 SPIGOT-6895: Trees grown with applyBoneMeal() don't fire the StructureGrowthEvent 59733a2e SPIGOT-6961: Actually return a copy of the ItemMeta Spigot Changes: ffceeae3 SPIGOT-6956: Drop unload queue patch as attempt at fixing stop issue e19ddabd PR-1011: Add Item Unlimited Lifetime APIs 34d40b0e SPIGOT-2942: give command fires PlayerDropItemEvent, cancelling it causes Item Duplication
50 lines
2.7 KiB
Diff
50 lines
2.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Brokkonaut <hannos17@gmx.de>
|
|
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 ed56c7b42fa3dc454423a283d058deaacc7bd407..12615f12c64c62400ec57fc8930d55251da0ff8c 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -385,6 +385,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);
|
|
}
|
|
}
|