package com.razz.dfashion.skin.packet; import com.razz.dfashion.DecoFashion; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.Identifier; /** * Client → server. Remove {@code hash} from the player's personal skin library. If the * hash was the currently-equipped skin, the server also resets {@code SkinData} back to * vanilla. Unknown hashes are silently ignored (idempotent). */ public record DeleteSkin(String hash) implements CustomPacketPayload { public static final Type TYPE = new Type<>(Identifier.fromNamespaceAndPath(DecoFashion.MODID, "delete_skin")); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.stringUtf8(64), DeleteSkin::hash, DeleteSkin::new ); @Override public Type type() { return TYPE; } }