1
0
mirror of https://github.com/Suiranoil/SkinRestorer.git synced 2026-01-16 04:42:12 +00:00

make decode and encode public

This commit is contained in:
2024-11-28 16:02:50 +03:00
parent b475168fb1
commit 8338f5dac9
2 changed files with 7 additions and 7 deletions

View File

@@ -15,15 +15,15 @@ public record SkinShuffleSkinRefreshV1Payload(
SkinShuffleSkinRefreshV1Payload::decode
);
private static void encode(FriendlyByteBuf buf, SkinShuffleSkinRefreshV1Payload value) {
public static void encode(FriendlyByteBuf buf, SkinShuffleSkinRefreshV1Payload value) {
var textureProperty = value.textureProperty();
buf.writeUtf(textureProperty.name());
buf.writeUtf(textureProperty.value());
buf.writeNullable(textureProperty.signature(), FriendlyByteBuf::writeUtf);
}
private static SkinShuffleSkinRefreshV1Payload decode(FriendlyByteBuf buf) {
public static SkinShuffleSkinRefreshV1Payload decode(FriendlyByteBuf buf) {
return new SkinShuffleSkinRefreshV1Payload(new Property(buf.readUtf(), buf.readUtf(), buf.readNullable(FriendlyByteBuf::readUtf)));
}

View File

@@ -14,8 +14,8 @@ public record SkinShuffleSkinRefreshV2Payload(
SkinShuffleSkinRefreshV2Payload::encode,
SkinShuffleSkinRefreshV2Payload::decode
);
private static void encode(FriendlyByteBuf buf, SkinShuffleSkinRefreshV2Payload value) {
public static void encode(FriendlyByteBuf buf, SkinShuffleSkinRefreshV2Payload value) {
var textureProperty = value.textureProperty();
buf.writeBoolean(textureProperty.hasSignature());
@@ -27,8 +27,8 @@ public record SkinShuffleSkinRefreshV2Payload(
buf.writeUtf(textureProperty.signature());
}
}
private static SkinShuffleSkinRefreshV2Payload decode(FriendlyByteBuf buf) {
public static SkinShuffleSkinRefreshV2Payload decode(FriendlyByteBuf buf) {
if (buf.readBoolean()) {
return new SkinShuffleSkinRefreshV2Payload(new Property(buf.readUtf(), buf.readUtf(), buf.readUtf()));
}