You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
Java
31 lines
1.1 KiB
Java
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<DeleteSkin> TYPE =
|
|
new Type<>(Identifier.fromNamespaceAndPath(DecoFashion.MODID, "delete_skin"));
|
|
|
|
public static final StreamCodec<FriendlyByteBuf, DeleteSkin> STREAM_CODEC =
|
|
StreamCodec.composite(
|
|
ByteBufCodecs.stringUtf8(64), DeleteSkin::hash,
|
|
DeleteSkin::new
|
|
);
|
|
|
|
@Override
|
|
public Type<DeleteSkin> type() {
|
|
return TYPE;
|
|
}
|
|
} |