Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/Spigot-Server-Patches/0018-Configurable-fishing-time-ranges.patch
Zach Brown 20973ffd0f Make certain game mechanics configurable
Boat drops and rail placement at this time
2014-11-28 14:19:09 -06:00

41 Zeilen
2.0 KiB
Diff

From 07dca9a9864ad7237634a4ca23ed229ea0ba5b5b Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 5 Aug 2014 17:49:02 -0500
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 9d4ea60..0fc1e85 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -315,7 +315,8 @@ public class EntityFishingHook extends Entity {
this.az = MathHelper.nextInt(this.random, 20, 80);
}
} else {
- this.ay = MathHelper.nextInt(this.random, 100, 900);
+ // PaperSpigot - Configurable fishing tick range
+ this.ay = MathHelper.nextInt(this.random, this.world.paperSpigotConfig.fishingMinTicks, this.world.paperSpigotConfig.fishingMaxTicks);
this.ay -= EnchantmentManager.getLureEnchantmentLevel(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 9cd9c6d..1d01f89 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -113,4 +113,12 @@ public class PaperSpigotWorldConfig
invertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false );
log( "Inverted Redstone Lamps: " + invertedDaylightDetectors );
}
+
+ 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