aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java2
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java20
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