aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2023-12-26 10:24:57 +0100
committerGitHub <noreply@github.com>2023-12-26 10:24:57 +0100
commit0267c885c1cd2787599fbdc41363a2f819794c18 (patch)
tree044a2a379015a44db45aaf962cf4f587a484b431 /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
parentdf5972b57c2460f43434820fb3970d99df0162b8 (diff)
downloadnotenoughupdates-0267c885c1cd2787599fbdc41363a2f819794c18.tar.gz
notenoughupdates-0267c885c1cd2787599fbdc41363a2f819794c18.tar.bz2
notenoughupdates-0267c885c1cd2787599fbdc41363a2f819794c18.zip
Added slug pet support to the fishing timer (#979)
Co-authored-by: hannibal2 <24389977+hannibal002@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
index b43b0e78..8be03412 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java
@@ -150,7 +150,18 @@ public class FishingHelper {
int ticksExisted = hook.ticksExisted;
float seconds = ticksExisted / 20F;
int color;
- if (seconds >= 20) {
+ float maxSlugTime = 20;
+ PetInfoOverlay.Pet pet = PetInfoOverlay.getCurrentPet();
+ if (NotEnoughUpdates.INSTANCE.config.fishing.enableSlugCheck && pet != null) {
+ if (pet.petLevel != null &&
+ pet.petType.equalsIgnoreCase("slug")
+ ) {
+ double slugFactor = 0.005 * pet.petLevel.getCurrentLevel();
+ maxSlugTime = (float) (maxSlugTime * (1 - slugFactor));
+ }
+ }
+
+ if (seconds >= maxSlugTime) {
color = ChromaColour.specialToChromaRGB(NotEnoughUpdates.INSTANCE.config.fishing.fishingTimerColor30SecPlus);
if (NotEnoughUpdates.INSTANCE.config.fishing.fishingSound30Sec && !playedSound) {
ISound sound = new PositionedSound(new ResourceLocation("random.orb")) {{