diff options
| author | ThatGravyBoat <gravyboat211@gmail.com> | 2021-02-10 08:31:18 -0330 |
|---|---|---|
| committer | ThatGravyBoat <gravyboat211@gmail.com> | 2021-02-10 08:31:18 -0330 |
| commit | ada86e95cc85700ca39022ac25eeb32febaaa2fb (patch) | |
| tree | 78516b10c84da820c93b25130a9cc77a2a23fca0 /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java | |
| parent | a2292c332c22646bd177eaf3123ce31a74991e36 (diff) | |
| download | notenoughupdates-ada86e95cc85700ca39022ac25eeb32febaaa2fb.tar.gz notenoughupdates-ada86e95cc85700ca39022ac25eeb32febaaa2fb.tar.bz2 notenoughupdates-ada86e95cc85700ca39022ac25eeb32febaaa2fb.zip | |
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.
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java | 19 |
1 files changed, 16 insertions, 3 deletions
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; } |
