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
,CardSyncPacket
,CoinFlipAckPacket
,CustomGUIChoiceToServerPacket
,EndGamePacket
,ForceEndBattlePacket
,GameStateSyncPacket
,GenericActionRequestPacket
,GenericGUIPacket
,OpenBinderPacket
,OpenPackGuiPacket
,OpenPackPacket
,PackSyncPacket
,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 TypeMethodDescriptionvoid
decode
(net.minecraft.network.RegistryFriendlyByteBuf buffer) Decodes the information from the buffer to the packet instancevoid
encode
(net.minecraft.network.RegistryFriendlyByteBuf buffer) Encodes the buffer with the packet informationvoid
handle
(net.neoforged.neoforge.network.handling.IPayloadContext context) Handles the packet being executed on the server or the clientprotected abstract void
handlePacket
(net.neoforged.neoforge.network.handling.IPayloadContext context) protected void
Abstracted method for replying to the received packetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:TCGPacket
Encodes the buffer with the packet information -
decode
public void decode(net.minecraft.network.RegistryFriendlyByteBuf buffer) Description copied from interface:TCGPacket
Decodes the information from the buffer to the packet instance -
handle
public void handle(net.neoforged.neoforge.network.handling.IPayloadContext context) Description copied from interface:TCGPacket
Handles 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
-