package moe.nea.firmament.apis.ingame import io.netty.buffer.ByteBuf import net.minecraft.network.codec.PacketCodec import net.minecraft.network.packet.CustomPayload import net.minecraft.util.Identifier interface FirmamentCustomPayload : CustomPayload { class Unhandled private constructor(val identifier: Identifier) : FirmamentCustomPayload { override fun getId(): CustomPayload.Id { return CustomPayload.id(identifier.toString()) } companion object { fun createCodec(identifier: Identifier): PacketCodec { return object : PacketCodec { override fun decode(buf: B): Unhandled { return Unhandled(identifier) } override fun encode(buf: B, value: Unhandled) { // we will never send an unhandled packet stealthy } } } } } }