PaperMC/patches/server/0014-Configurable-fishing-time-ranges.patch

39 lines
1.9 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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
2021-06-11 14:02:28 +02:00
--- 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 {
2021-06-11 14:02:28 +02:00
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
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
2021-06-12 00:37:16 +02:00
@@ -83,6 +83,10 @@ public class FishingHook extends Projectile {
this.noCulling = true;
2021-06-11 14:02:28 +02:00
this.luck = Math.max(0, lureLevel);
this.lureSpeed = Math.max(0, luckOfTheSeaLevel);
+ // Paper start
+ minWaitTime = world.paperConfig.fishingMinTicks;
+ maxWaitTime = world.paperConfig.fishingMaxTicks;
+ // Paper end
2021-06-11 14:02:28 +02:00
}
2021-06-12 00:37:16 +02:00
public FishingHook(EntityType<? extends FishingHook> type, Level world) {