Package com.pixelmonmod.tcg.network.data
Class AbstractTCGPacket
java.lang.Object
com.pixelmonmod.tcg.network.data.AbstractTCGPacket
- All Implemented Interfaces:
TCGPacket,net.minecraft.network.protocol.common.custom.CustomPacketPayload
- Direct Known Subclasses:
BattleSpectatorUpdatePacket,CardSelectorToServerPacket,CoinFlipAckPacket,CustomGUIChoiceToServerPacket,EndGamePacket,ForceEndBattlePacket,GameStateSyncPacket,GenericActionRequestPacket,GenericGUIPacket,OpenBinderPacket,OpenPackGuiPacket,OpenPackPacket,PrizeSelectorToClientPacket,PrizeSelectorToServerPacket,RenderStatePreBattleSyncPacket,RenderStateSyncPacket,RetreatAndSwitchPacket,RulebookUpdatePacket,ShowOpponentCardPacket,SwitchPacket,TCGGuiClientPacket,TrainerPlayedPacket,UpdateServerCardRecordPacket
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B extends net.minecraft.network.FriendlyByteBuf>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B extends net.minecraft.network.FriendlyByteBuf,T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTCGPacket(boolean sync) AbstractTCGPacket(PacketDirection direction) AbstractTCGPacket(PacketDirection direction, boolean sync) -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(net.minecraft.network.RegistryFriendlyByteBuf buffer) Decodes the information from the buffer to the packet instancevoidencode(net.minecraft.network.RegistryFriendlyByteBuf buffer) Encodes the buffer with the packet informationvoidhandle(net.neoforged.neoforge.network.handling.IPayloadContext context) Handles the packet being executed on the server or the clientprotected abstract voidhandlePacket(net.neoforged.neoforge.network.handling.IPayloadContext context) protected voidAbstracted method for replying to the received packetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Constructor Details
-
AbstractTCGPacket
-
AbstractTCGPacket
-
AbstractTCGPacket
public AbstractTCGPacket(boolean sync)
-
-
Method Details
-
encode
public void encode(net.minecraft.network.RegistryFriendlyByteBuf buffer) Description copied from interface:TCGPacketEncodes the buffer with the packet information -
decode
public void decode(net.minecraft.network.RegistryFriendlyByteBuf buffer) Description copied from interface:TCGPacketDecodes the information from the buffer to the packet instance -
handle
public void handle(net.neoforged.neoforge.network.handling.IPayloadContext context) Description copied from interface:TCGPacketHandles the packet being executed on the server or the client -
handlePacket
protected abstract void handlePacket(net.neoforged.neoforge.network.handling.IPayloadContext context) -
reply
protected void reply(net.neoforged.neoforge.network.handling.IPayloadContext context, Object packet) Abstracted method for replying to the received packet- Parameters:
context- The context of the packetpacket- The packet to reply with
-