aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Fishing.java9
2 files changed, 21 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")) {{
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Fishing.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Fishing.java
index fe34c428..48b0661d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Fishing.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Fishing.java
@@ -273,6 +273,15 @@ public class Fishing {
@ConfigAccordionId(id = 6)
public boolean fishingSound30Sec = true;
+ @Expose
+ @ConfigOption(
+ name = "Enable Slug Pet Check",
+ desc = "Check what pet you're using to determine the cooldown for the fishing timer colour/ping"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 6)
+ public boolean enableSlugCheck = true;
+
@ConfigOption(
name = "Trophy Reward",
desc = ""