From ada86e95cc85700ca39022ac25eeb32febaaa2fb Mon Sep 17 00:00:00 2001 From: ThatGravyBoat Date: Wed, 10 Feb 2021 08:31:18 -0330 Subject: Added PetInfo display, allows for the checking of certain pets for certain features, also adds monkey check for treecap cooldown and adds a notification if you are using the wrong pet. --- .../notenoughupdates/miscfeatures/ItemCooldowns.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java index f567ead5..f3a21b1d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java @@ -52,6 +52,19 @@ public class ItemCooldowns { blocksClicked.clear(); } + public static long getTreecapCooldownWithPet(){ + if (NotEnoughUpdates.INSTANCE.config.treecap.enableMonkeyCheck && PetInfo.currentPet != null) { + PetInfo.pet pet = PetInfo.currentPet; + if (pet.petLevel != null && + pet.petType.equalsIgnoreCase("monkey") && + pet.rarity.equals(PetInfo.Rarity.LEGENDARY) + ) { + return 2000 - (int) (2000 * (0.005 * (int) PetInfo.currentPet.petLevel.level)); + } + } + return 2000; + } + public static void blockClicked(BlockPos pos) { long currentTime = System.currentTimeMillis(); blocksClicked.put(currentTime, pos); @@ -74,7 +87,7 @@ public class ItemCooldowns { if(internalname != null) { if(treecapitatorCooldownMillisRemaining < 0 && (internalname.equals("TREECAPITATOR_AXE") || internalname.equals("JUNGLE_AXE"))) { - treecapitatorCooldownMillisRemaining = 2*1000; + treecapitatorCooldownMillisRemaining = getTreecapCooldownWithPet(); } } } @@ -120,10 +133,10 @@ public class ItemCooldowns { return -1; } - if(treecapitatorCooldownMillisRemaining > 2*1000) { + if(treecapitatorCooldownMillisRemaining > getTreecapCooldownWithPet()) { return stack.getItemDamage(); } - float dura = (float)(treecapitatorCooldownMillisRemaining/(2.0*1000.0)); + float dura = (treecapitatorCooldownMillisRemaining/(float)getTreecapCooldownWithPet()); durabilityOverrideMap.put(stack, dura); return dura; } -- cgit