From 8d495347bad4b2061200704535149aa274ea015e Mon Sep 17 00:00:00 2001 From: UnfamiliarLegacy <74633542+UnfamiliarLegacy@users.noreply.github.com> Date: Sat, 22 Jun 2024 06:41:06 +0200 Subject: [PATCH] Reset to correct read index --- .../extension_handler/extensions/GEarthExtension.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/G-Earth/src/main/java/gearth/services/extension_handler/extensions/GEarthExtension.java b/G-Earth/src/main/java/gearth/services/extension_handler/extensions/GEarthExtension.java index 431bc84..f181e8e 100644 --- a/G-Earth/src/main/java/gearth/services/extension_handler/extensions/GEarthExtension.java +++ b/G-Earth/src/main/java/gearth/services/extension_handler/extensions/GEarthExtension.java @@ -62,7 +62,7 @@ public abstract class GEarthExtension { protected void sendManipulatedPacket(HMessage hMessage) { int orgIndex = hMessage.getPacket().getReadIndex(); extensionObservable.fireEvent(listener -> { - hMessage.getPacket().setReadIndex(6); + hMessage.getPacket().resetReadIndex(); listener.manipulatedPacket(hMessage); }); hMessage.getPacket().setReadIndex(orgIndex); @@ -73,7 +73,7 @@ public abstract class GEarthExtension { protected void sendMessage(HMessage.Direction direction, HPacket packet) { int orgIndex = packet.getReadIndex(); extensionObservable.fireEvent(listener -> { - packet.setReadIndex(6); + packet.resetReadIndex(); listener.sendMessage(direction, packet); }); packet.setReadIndex(orgIndex); @@ -88,7 +88,7 @@ public abstract class GEarthExtension { protected void packetToStringRequest(HPacket packet) { int orgIndex = packet.getReadIndex(); extensionObservable.fireEvent(listener -> { - packet.setReadIndex(6); + packet.resetReadIndex(); listener.packetToStringRequest(packet); }); packet.setReadIndex(orgIndex);