3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/Spigot-Server-Patches/0011-Configurable-fishing-time-ranges.patch

40 Zeilen
1.9 KiB
Diff

From 75e357a8a366b9f89e20cf0a799aef4f1f238915 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 7 Mar 2015 21:00:13 -0600
Subject: [PATCH] Configurable fishing time ranges
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index c2bfb1f..28d698d 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -331,7 +331,7 @@ public class EntityFishingHook extends Entity {
this.ax = MathHelper.nextInt(this.random, 20, 80);
}
} else {
- this.aw = MathHelper.nextInt(this.random, 100, 900);
+ this.aw = MathHelper.nextInt(this.random, this.world.paperSpigotConfig.fishingMinTicks, this.world.paperSpigotConfig.fishingMaxTicks); // PaperSpigot - Configurable fishing tick range
this.aw -= EnchantmentManager.h(this.owner) * 20 * 5;
}
}
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 014b8d9..b7afd3e 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -106,4 +106,12 @@ public class PaperSpigotWorldConfig
reedMaxHeight = getInt( "max-growth-height.reeds", 3 );
log( "Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight );
}
+
+ public int fishingMinTicks;
+ public int fishingMaxTicks;
+ private void fishingTickRange()
+ {
+ fishingMinTicks = getInt( "fishing-time-range.MinimumTicks", 100 );
+ fishingMaxTicks = getInt( "fishing-time-range.MaximumTicks", 900 );
+ }
}
--
1.9.1