diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-05 22:31:43 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-05 22:31:43 +0900 |
commit | bfb7f88902585725b58b82f083515d36ac9cf06f (patch) | |
tree | 975cdad74be11cd8e513ab42799d9707c99b18a5 /mod/src/main/java | |
parent | ea49bbcbdfe5c75fbd9b0fcdc36f701efad2250a (diff) | |
download | Skyblock-Dungeons-Guide-bfb7f88902585725b58b82f083515d36ac9cf06f.tar.gz Skyblock-Dungeons-Guide-bfb7f88902585725b58b82f083515d36ac9cf06f.tar.bz2 Skyblock-Dungeons-Guide-bfb7f88902585725b58b82f083515d36ac9cf06f.zip |
- legit fix ability cooldown
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main/java')
2 files changed, 13 insertions, 8 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java index ab8c1ae9..54ba4f8a 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java @@ -59,20 +59,22 @@ public class PacketInjector extends ChannelDuplexHandler { if (doStuff) { RawPacketReceivedEvent receivedEvent = new RawPacketReceivedEvent(packet); MinecraftForge.EVENT_BUS.post(receivedEvent); + packet = receivedEvent.packet; } } catch (Throwable t) { t.printStackTrace(); } // Hopefully this works? idk + Packet finalPacket = packet; if (doStuff) Minecraft.getMinecraft().addScheduledTask(() -> { - MinecraftForge.EVENT_BUS.post(new PacketProcessedEvent.Pre(packet)); + MinecraftForge.EVENT_BUS.post(new PacketProcessedEvent.Pre(finalPacket)); }); super.channelRead(ctx, packet); if (doStuff) Minecraft.getMinecraft().addScheduledTask(() -> { - MinecraftForge.EVENT_BUS.post(new PacketProcessedEvent.Post(packet)); + MinecraftForge.EVENT_BUS.post(new PacketProcessedEvent.Post(finalPacket)); }); } 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 22d8ed72..5f06ccd6 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 @@ -218,7 +218,7 @@ public class FeatureAbilityCooldown extends TextHUDFeature { register(new SkyblockAbility("Stinger", 150, -1, "SCORPION_BOW")); register(new SkyblockAbility("Eye Beam", -1, -1, "PRECURSOR_EYE")); register(new SkyblockAbility("Water Burst", 20, -1, "SALMON_BOOTS")); - register(new SkyblockAbility("Mining Speed Boost", -1, 120, null)); + register(new SkyblockAbility("Mining Speed Boost", -1, 10000, null)); register(new SkyblockAbility("Pikobulus", -1, 110, null)); // abilities @@ -357,7 +357,6 @@ public class FeatureAbilityCooldown extends TextHUDFeature { NBTTagCompound extra = nbt.getCompoundTag("ExtraAttributes"); if (extra == null) return; String id = extra.getString("id"); - if (!skyblockAbilitiesByItemID.containsKey(id)) return; List<SkyblockAbility> skyblockAbility = skyblockAbilitiesByItemID.get(id); NBTTagCompound display = nbt.getCompoundTag("display"); @@ -382,12 +381,16 @@ public class FeatureAbilityCooldown extends TextHUDFeature { 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)) { - currentAbility = skyblockAbility1; - break; + if (skyblockAbility != null) { + for (SkyblockAbility skyblockAbility1 : skyblockAbility) { + if (skyblockAbility1.getName().equals(ability)) { + currentAbility = skyblockAbility1; + break; + } } } + if (currentAbility == null) + currentAbility = skyblockAbilities.get(ability); } } } |