Skip to content

Commit

Permalink
Fix network decoding errors, closes #346
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIllusiveC4 committed Nov 2, 2023
1 parent fc810c4 commit bb30107
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void encode(CPacketToggleRender msg, FriendlyByteBuf buf) {
}

public static CPacketToggleRender decode(FriendlyByteBuf buf) {
return new CPacketToggleRender(buf.readUtf(100), buf.readInt());
return new CPacketToggleRender(buf.readUtf(), buf.readInt());
}

public static void handle(CPacketToggleRender msg, Supplier<NetworkEvent.Context> ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void encode(SPacketBreak msg, FriendlyByteBuf buf) {
}

public static SPacketBreak decode(FriendlyByteBuf buf) {
return new SPacketBreak(buf.readInt(), buf.readUtf(25), buf.readInt());
return new SPacketBreak(buf.readInt(), buf.readUtf(), buf.readInt());
}

public static void handle(SPacketBreak msg, Supplier<NetworkEvent.Context> ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static SPacketSetIcons decode(FriendlyByteBuf buf) {
Map<String, ResourceLocation> map = new HashMap<>();

for (int i = 0; i < entrySize; i++) {
map.put(buf.readUtf(25), new ResourceLocation(buf.readUtf(100)));
map.put(buf.readUtf(), new ResourceLocation(buf.readUtf()));
}
return new SPacketSetIcons(map);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static SPacketSyncCurios decode(FriendlyByteBuf buf) {
Map<String, CompoundTag> map = new LinkedHashMap<>();

for (int i = 0; i < entrySize; i++) {
String key = buf.readUtf(25);
String key = buf.readUtf();
map.put(key, buf.readNbt());
}
return new SPacketSyncCurios(map, entityId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static SPacketSyncModifiers decode(FriendlyByteBuf buf) {
Map<String, CompoundTag> map = new LinkedHashMap<>();

for (int i = 0; i < entrySize; i++) {
String key = buf.readUtf(25);
String key = buf.readUtf();
map.put(key, buf.readNbt());
}
return new SPacketSyncModifiers(map, entityId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void encode(SPacketSyncOperation msg, FriendlyByteBuf buf) {
}

public static SPacketSyncOperation decode(FriendlyByteBuf buf) {
return new SPacketSyncOperation(buf.readInt(), buf.readUtf(25),
return new SPacketSyncOperation(buf.readInt(), buf.readUtf(),
Operation.fromValue(buf.readInt()), buf.readInt(), buf.readBoolean(), buf.readBoolean());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void encode(SPacketSyncRender msg, FriendlyByteBuf buf) {
}

public static SPacketSyncRender decode(FriendlyByteBuf buf) {
return new SPacketSyncRender(buf.readInt(), buf.readUtf(25), buf.readInt(),
return new SPacketSyncRender(buf.readInt(), buf.readUtf(), buf.readInt(),
buf.readBoolean());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static void encode(SPacketSyncStack msg, FriendlyByteBuf buf) {
}

public static SPacketSyncStack decode(FriendlyByteBuf buf) {
return new SPacketSyncStack(buf.readInt(), buf.readUtf(25), buf.readInt(),
return new SPacketSyncStack(buf.readInt(), buf.readUtf(), buf.readInt(),
buf.readItem(), HandlerType.fromValue(buf.readInt()), buf.readNbt());
}

Expand Down

0 comments on commit bb30107

Please sign in to comment.