diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-08 16:53:49 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-08 16:53:49 +0900 |
commit | a8f67b684de08e1e7fa751ca78a068a4e6400cd1 (patch) | |
tree | b611aaa8f159ee8cce347561f2fb5f948714824b /mod | |
parent | 9ea4e7e3521af59b524aa629e90daec56a25aa02 (diff) | |
download | Skyblock-Dungeons-Guide-a8f67b684de08e1e7fa751ca78a068a4e6400cd1.tar.gz Skyblock-Dungeons-Guide-a8f67b684de08e1e7fa751ca78a068a4e6400cd1.tar.bz2 Skyblock-Dungeons-Guide-a8f67b684de08e1e7fa751ca78a068a4e6400cd1.zip |
- is it my fault that I'm getting kicked from pixel?
=> No, it's my apartment's fault
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod')
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java | 2 | ||||
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java | 20 |
2 files changed, 14 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 676682ff..ca295afa 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 @@ -25,6 +25,8 @@ import kr.syeyoung.dungeonsguide.mod.events.impl.RawPacketReceivedEvent; import net.minecraft.client.Minecraft; import net.minecraft.network.Packet; import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; import net.minecraft.network.play.server.*; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java index 5ef43e8c..f84da51f 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java @@ -44,17 +44,21 @@ public class PacketListener { @SubscribeEvent public void onPacketReceive(RawPacketReceivedEvent event) { - Packet packet = event.packet; - if (skyblockStatus.isOnSkyblock() - && packet instanceof S04PacketEntityEquipment + try { + Packet packet = event.packet; + if (skyblockStatus.isOnSkyblock() + && packet instanceof S04PacketEntityEquipment && FeatureRegistry.FIX_SPIRIT_BOOTS.isEnabled()) { // Inventory packet name - S04PacketEntityEquipment packet2 = (S04PacketEntityEquipment) packet; - if (packet2.getEntityID() == Minecraft.getMinecraft().thePlayer.getEntityId()) { - packet2 = new S04PacketEntityEquipment(packet2.getEntityID(), packet2.getEquipmentSlot() + 1, packet2.getItemStack()); - packet = packet2; + S04PacketEntityEquipment packet2 = (S04PacketEntityEquipment) packet; + if (packet2.getEntityID() == Minecraft.getMinecraft().thePlayer.getEntityId()) { + packet2 = new S04PacketEntityEquipment(packet2.getEntityID(), packet2.getEquipmentSlot() + 1, packet2.getItemStack()); + packet = packet2; + } } + event.packet = packet; + } catch (Exception e) { + e.printStackTrace(); } - event.packet = packet; } @SubscribeEvent |