From ea49bbcbdfe5c75fbd9b0fcdc36f701efad2250a Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 5 Feb 2023 22:12:46 +0900 Subject: - Fix ability cooldown not working - Fix loading data from inv: Fixes #187 Signed-off-by: syeyoung --- .../mod/features/impl/etc/ability/FeatureAbilityCooldown.java | 10 ++++++++-- .../dungeonsguide/mod/features/text/TextHUDFeature.java | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java index 32ba7920..22d8ed72 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java @@ -373,8 +373,14 @@ public class FeatureAbilityCooldown extends TextHUDFeature { thecd = Integer.parseInt(thecdstr); currentAbility.setCooldown(thecd); currentAbility = null; - } else if (specific.startsWith("§6Item Ability: ")) { - String ability = TextUtils.stripColor(specific).substring(14).trim(); + } else if (specific.startsWith("§6Ability: ") || specific.startsWith("§6Item Ability: ")) { + String ability; + if (specific.startsWith("§6I")) + ability = specific.substring(18); + else + ability = specific.substring(11); + if (ability.endsWith(" §e§lRIGHT CLICK")) ability = ability.replace(" §e§lRIGHT CLICK", ""); + ability = TextUtils.stripColor(ability).trim(); for (SkyblockAbility skyblockAbility1 : skyblockAbility) { if (skyblockAbility1.getName().equals(ability)) { diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java index 4235d79f..90ef0ffe 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java @@ -70,7 +70,7 @@ public abstract class TextHUDFeature extends AbstractHUDFeature implements Style private Map builtTextStyles = new HashMap<>(); @DGEventHandler - public void onTick(DGTickEvent dgTickEvent) { + public void onTick0(DGTickEvent dgTickEvent) { try { checkVisibility(); if (isHUDViewable()) { -- cgit