PaperMC/patches/server/0014-Configurable-fishing-time-ranges.patch
Jake Potrebic a923e332ee
Make despawn distance configs per-category, improve per category spawn limit config (#6717)
Also adds per-world spawn limit config in paper.yml for `underground_water_creature`, and migrates existing spawn limit config options to their Mojang names.
2021-11-08 23:59:15 -08:00

38 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 13:14:11 -0600
Subject: [PATCH] Configurable fishing time ranges
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index d5a93adafc9e897b78f83102ea101d96c5bf2744..3b35d45881a041aaa7adea0ffc92379208a138b7 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -109,4 +109,12 @@ public class PaperWorldConfig {
log("Baby zombies will move at the speed of " + babyZombieMovementModifier);
}
+
+ public int fishingMinTicks;
+ public int fishingMaxTicks;
+ private void fishingTickRange() {
+ fishingMinTicks = getInt("fishing-time-range.MinimumTicks", 100);
+ fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
+ log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index dde25bf5e4e6e6514a8141e4dee473d96eee83f5..b007efe91c0abef3e90179b67dfdaf999ced11d2 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -83,6 +83,10 @@ public class FishingHook extends Projectile {
this.noCulling = true;
this.luck = Math.max(0, lureLevel);
this.lureSpeed = Math.max(0, luckOfTheSeaLevel);
+ // Paper start
+ minWaitTime = world.paperConfig.fishingMinTicks;
+ maxWaitTime = world.paperConfig.fishingMaxTicks;
+ // Paper end
}
public FishingHook(EntityType<? extends FishingHook> type, Level world) {