Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Commit

Permalink
fix packets losing reader indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
BasiqueEvangelist committed Jul 27, 2024
1 parent 639263f commit 9a89bce
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.wispforest.gadget.dump.fake.GadgetDynamicRegistriesPacket;
import io.wispforest.gadget.dump.fake.GadgetReadErrorPacket;
import io.wispforest.gadget.dump.fake.GadgetWriteErrorPacket;
import io.wispforest.gadget.util.SlicingPacketByteBuf;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import net.minecraft.network.NetworkState;
Expand Down Expand Up @@ -46,7 +47,7 @@ public static void writePacket(PacketByteBuf buf, Packet<?> packet, NetworkState
return;
}

((PacketCodec<ByteBuf, Object>)(Object) state.codec()).encode(buf, packet);
((PacketCodec<ByteBuf, Object>)(Object) state.codec()).encode(new SlicingPacketByteBuf(buf), packet);
} catch (Exception e) {
buf.writerIndex(startWriteIdx);

Expand Down

0 comments on commit 9a89bce

Please sign in to comment.