Class AbstractPixelmonPacket

java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
All Implemented Interfaces:
PixelmonPacket
Direct Known Subclasses:
AbandonResearchPacket, AcceptDeclineBattlePacket, AcceptNPCTradePacket, AddNewInteractionPacket, AddToDayCarePacket, ApplyPresetPacket, BackToMainMenuPacket, BadgeCaseActionPacket, BagPacket, BattleGuiClosedPacket, BattleQueryPacket, BattleScreenDisabledPacket, BattleSwitchPacket, BattleTaskPacket, CancelDayCareBoxPacket, CancelTeamSelectPacket, ChangeLurePacket, ChangePokemonOpenGUIPacket, ChangePokemonPacket, CheckPlayerBattlePacket, CheckPokemonEditorAllowedPacket, CheckRulesVersion, ChooseAttackPacket, ChooseMovesetPacket, ChooseStarterPacket, ClaimObjectivePacket, ClaimStagePacket, ClearClientResearchPacket, ClientboundSetSelectedSlotPacket, ClientboundUpdateSpawnerPacket, ClientChangeOpenPCPacket, ClientInitializeStoragePacket, ClientQueryResultsPCPacket, ClientResearchPacket, ClientSetLastOpenBoxPacket, ClientSetPacket, ClientUpdatePokedexPacket, CloseBattlePacket, CloseEditedPlayerPacket, CloseEditingPlayerPacket, CloseProfessorDialoguePacket, CloseRaidPacket, CloseTeamSelectScreenPacket, CompleteDayCareRequirementPacket, ConfirmTeamSelectPacket, CopyNPCPacket, CreateNPCFromPresetPacket, CustomDropsActionPacket, CustomDropsOpenPacket, CustomNoticePacketPacket, CustomScoreboardDisplayPacket, CustomScoreboardUpdatePacket, DayCareAllErrorsPacket, DayCareConditionStatusResponsePacket, DayCareHourglassUsedPacket, DayCareRequestAllErrorsPacket, DayCareRequestConditionUpdatePacket, DeleteMovePacket, DeleteNPCPacket, DeletePokemonPacket, DialogueChoiceMadePacket, DialogueClosurePacket, DialogueInputActionPacket, DialogueInputResponsePacket, DialogueNextActionPacket, DisplayBattleQueryRulesPacket, DistanceUntilBattleForfeitedPacket, DynamaxMegaRulePacket, DynamaxPacket, ElevatorUsedPacket, EndSpectatePacket, EnforcedRevivePacket, EvolutionResponsePacket, EvolvePokemonPacket, ExitBattlePacket, ExportRequestPacket, ExportResponsePacket, FavoriteResearchPacket, FinishSyncDataEntryPacket, FleePacket, FormBattleUpdatePacket, FreeToMoveDuringBattlePacket, GuiBattleUpdatePacket, GuiOpenClosePacket, HealerGuiClosePacket, HoverPacket, IlluminatePositionsPacket, ImportRequestPacket, ImportResponsePacket, InteractNPCPacket, InvalidateRegistriesPacket, ItemCameraPacket, ItemDropPacket, KeyPacket, LensInfoPacket, LevelUpPacket, LinkPresetPacket, MailPacket, MegaEvolvePacket, NPCEditorClosedPacket, NPCLearnMovePacket, NPCTeachMovePacket, OpenBadgeCasePacket, OpenBattleModePacket, OpenDialogueInputPacket, OpenEvolutionGUIPacket, OpenNPCEditorPacket, OpenProfessorDialoguePacket, OpenRaidPacket, OpenReplaceMoveScreenPacket, OpenScreenPacket, OpenSelectionPacket, OpenTutorPacket, ParticipantReadyPacket, PartyFainedRespawnPacket, PCClonePacket, PCSortPacket, PixelExtrasDisplayClientPacket, PixelExtrasDisplayServerPacket, PlayBattleMusicPacket, PlayBattleParticleSystemPacket, PlayerDeathPacket, PlayerExtrasPacket, PlayParticleSystemPacket, PokeDisplayOpenPacket, PokeDisplaySwapPacket, PokeDisplayUpdatePacket, PokemonListPacket, ProposeBattleRulesPacket, QueryResourceLocationPacket, QueryResourceLocationResult, RaidActionPacket, RandomizePokemonPacket, RegisterMoveSkillPacket, RegisterTraderPacket, RejectTeamSelectPacket, RelearnerTutorClosePacket, RemoveSpectatorPacket, RenamePokemonPacket, ReplaceMovePacket, RequestAllRibbonsPacket, RequestBagItemsPacket, RequestCloseEditedPlayerPacket, RequestCloseEditingPlayerPacket, RequestCustomRulesUpdatePacket, RequestDayCareChildPacket, RequestExtrasDisplayDataPacket, RequestNPCEditorPacket, RequestSpawnDataPacket, RequestSpectatePacket, RequestToggleFreeMoveInBattlePacket, RequestTrainerCardPacket, RequestUpdatedPokemonList, RespondDayCareChildPacket, RespondPokemonEditorAllowed, RespondToggleFreeMoveInBattlePacket, ReturnBagItemsPacket, RidingMovementPacket, RidingVerticalMovementPacket, RotateEntityPacket, SaveToPresetPacket, ScoreboardDisplayPacket, SelectionResponsePacket, SelectMovePacket, SelectStatPacket, SendAllRibbonsPacket, SendEntireDayCarePacket, SendSpawnDataPacket, SendToastPacket, SendTrackedNPCsOpenScreenPacket, SendUpdatedInteractionDataPacket, ServerboundSetSelectedSlotPacket, ServerCloseStoragePacket, ServerConfigListPacket, ServerCosmeticsUpdatePacket, ServerItemDropPacket, ServerPokedexPacket, ServerQueryPCPacket, ServerSetLastOpenBoxPacket, ServerSwapPacket, ServerTradesPacket, ServerTrashPacket, ServerUpdateBoxPacket, SetAllBattlingPokemonPacket, SetBattlingPokemonPacket, SetCharmPacket, SetClientTradePairPacket, SetDialogueDataPacket, SetDisplayRibbonPacket, SetEditedPlayerPacket, SetEditingPlayerPacket, SetHeldItemPacket, SetImportPokemonIDPacket, SetMegaItemPacket, SetNPCIconPacket, SetPokeBallIdPacket, SetPokemonBattleDataPacket, SetProposedRulesPacket, SetSelectedStatsPacket, SetSelectionOptionsPacket, SetStrugglePacket, SetTempMode, SetTradeTargetPacket, ShopClosePacket, ShopOpenPacket, ShopTransactionPacket, ShowSpectateMessagePacket, ShowTeamSelectPacket, StartBattlePacket, StarterListPacket, StartSpectatePacket, StatueUpdatePacket, StopStartLevellingPacket, SummonParticleArcaneryPacket, SwapBoxPacket, SwapHeldItemPacket, SwapMovePacket, SwapPositionPacket, SwitchCameraPacket, SwitchPokemonPacket, SyncAbilityPacket, SyncBossTiersPacket, SyncConditionDataEntryPacket, SyncDataProvidersDataEntryPacket, SyncMovesPacket, SyncPokeBallsPacket, SyncResultDataEntryPacket, SyncRibbonsPacket, SyncSpawningPacket, SyncSpeciesPacket, SyncSpectatorRangePacket, SyncStartersPacket, TeleportNPCPacket, TeleportPlayerPacket, TradeReadyPacket, TrainerCardColorPacket, TrainerCardPacket, TransformPacket, UIKeyPressPacket, UnconfirmTeamSelectPacket, UnLinkPresetPacket, UpdateBattleQueryRulesPacket, UpdateClientEditingStatuePacket, UpdateClientPlayerDataPacket, UpdateClientRulesPacket, UpdateDayCareBoxPacket, UpdateDayCareHistoryPacket, UpdateEditedPartyPacket, UpdateEditedPokemonPacket, UpdateEntityPropertiesPacket, UpdateInteractionDataPacket, UpdateMovesetPacket, UpdateNamePacket, UpdatePixelmonMovementPacket, UpdateRaidCatchPacket, UpdateRenderingHandlerPacket, UpdateSinglePokemonPacket, UpdateSpawnerPacket, UpdateSpriteItemRequestPacket, UpdateTerrainPacket, UpdateTurnPacket, UpdateWeatherPacket, UseEtherPacket, UseItemPacket, UseMoveSkillPacket, UseRevivePacket, UseZMovePacket, WithdrawDayCareBoxPacket, WithdrawHeldItemPacket, ZygardeCubePacket, ZygardeReassemblyPacket

public abstract class AbstractPixelmonPacket extends Object implements PixelmonPacket
Abstract implementation of the PixelmonPacket interface. It abstracts the process of checking if the method should be run on the main Minecraft server Thread. It also abstracts the process of performing safety checks depending on the enviroment it's being executed in (i.e. DistExecutor.unsafeRunWhenOn(Dist, Supplier)
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractPixelmonPacket(boolean sync)
     
     
    AbstractPixelmonPacket(PacketDirection direction, boolean sync)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    decode(net.minecraft.network.FriendlyByteBuf buffer)
    Decodes the information from the buffer to the packet instance
    void
    encode(net.minecraft.network.FriendlyByteBuf buffer)
    Encodes the buffer with the packet information
    void
    handle(net.minecraftforge.event.network.CustomPayloadEvent.Context context)
    Handles the packet being executed on the server or the client
    protected abstract void
    handlePacket(net.minecraftforge.event.network.CustomPayloadEvent.Context context)
     
    protected void
    reply(net.minecraftforge.event.network.CustomPayloadEvent.Context context, Object packet)
    Abstracted method for replying to the received packet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractPixelmonPacket

      public AbstractPixelmonPacket(PacketDirection direction)
    • AbstractPixelmonPacket

      public AbstractPixelmonPacket(PacketDirection direction, boolean sync)
    • AbstractPixelmonPacket

      public AbstractPixelmonPacket(boolean sync)
  • Method Details

    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PixelmonPacket
      Encodes the buffer with the packet information
      Specified by:
      encode in interface PixelmonPacket
      Parameters:
      buffer - The buffer being encoded
    • decode

      public void decode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PixelmonPacket
      Decodes the information from the buffer to the packet instance
      Specified by:
      decode in interface PixelmonPacket
      Parameters:
      buffer - The buffer being decoded
    • handle

      public void handle(net.minecraftforge.event.network.CustomPayloadEvent.Context context)
      Description copied from interface: PixelmonPacket
      Handles the packet being executed on the server or the client
      Specified by:
      handle in interface PixelmonPacket
      Parameters:
      context - The network event context being supplied by Forge
    • handlePacket

      protected abstract void handlePacket(net.minecraftforge.event.network.CustomPayloadEvent.Context context)
    • reply

      protected void reply(net.minecraftforge.event.network.CustomPayloadEvent.Context context, Object packet)
      Abstracted method for replying to the received packet
      Parameters:
      context - The context of the packet
      packet - The packet to reply with