Class AbstractPacket

java.lang.Object
com.comphenix.packetwrapper.wrappers.AbstractPacket
Direct Known Subclasses:
WrapperHandshakingClientSetProtocol, WrapperLoginClientCustomPayload, WrapperLoginClientEncryptionBegin, WrapperLoginClientStart, WrapperLoginServerCustomPayload, WrapperLoginServerDisconnect, WrapperLoginServerEncryptionBegin, WrapperLoginServerSetCompression, WrapperLoginServerSuccess, WrapperPlayClientAbilities, WrapperPlayClientAdvancements, WrapperPlayClientArmAnimation, WrapperPlayClientAutoRecipe, WrapperPlayClientBeacon, WrapperPlayClientBEdit, WrapperPlayClientBlockDig, WrapperPlayClientBoatMove, WrapperPlayClientChat, WrapperPlayClientChatAck, WrapperPlayClientChatCommand, WrapperPlayClientChatSessionUpdate, WrapperPlayClientClientCommand, WrapperPlayClientCloseWindow, WrapperPlayClientCustomPayload, WrapperPlayClientDifficultyChange, WrapperPlayClientDifficultyLock, WrapperPlayClientEnchantItem, WrapperPlayClientEntityAction, WrapperPlayClientEntityNbtQuery, WrapperPlayClientGround, WrapperPlayClientHeldItemSlot, WrapperPlayClientItemName, WrapperPlayClientJigsawGenerate, WrapperPlayClientKeepAlive, WrapperPlayClientLook, WrapperPlayClientPickItem, WrapperPlayClientPong, WrapperPlayClientPosition, WrapperPlayClientPositionLook, WrapperPlayClientRecipeDisplayed, WrapperPlayClientRecipeSettings, WrapperPlayClientResourcePackStatus, WrapperPlayClientSetCommandBlock, WrapperPlayClientSetCommandMinecart, WrapperPlayClientSetCreativeSlot, WrapperPlayClientSetJigsaw, WrapperPlayClientSettings, WrapperPlayClientSpectate, WrapperPlayClientSteerVehicle, WrapperPlayClientStruct, WrapperPlayClientTabComplete, WrapperPlayClientTeleportAccept, WrapperPlayClientTileNbtQuery, WrapperPlayClientTrSel, WrapperPlayClientUpdateSign, WrapperPlayClientUseEntity, WrapperPlayClientUseItem, WrapperPlayClientVehicleMove, WrapperPlayClientWindowClick, WrapperPlayServerAbilities, WrapperPlayServerAdvancements, WrapperPlayServerAnimation, WrapperPlayServerAttachEntity, WrapperPlayServerAutoRecipe, WrapperPlayServerBlockAction, WrapperPlayServerBlockBreakAnimation, WrapperPlayServerBlockChange, WrapperPlayServerBlockChangedAck, WrapperPlayServerBoss, WrapperPlayServerBundle, WrapperPlayServerCamera, WrapperPlayServerChat, WrapperPlayServerChunksBiomes, WrapperPlayServerClearTitles, WrapperPlayServerCloseWindow, WrapperPlayServerCollect, WrapperPlayServerCommands, WrapperPlayServerCustomChatCompletions, WrapperPlayServerCustomPayload, WrapperPlayServerDamageEvent, WrapperPlayServerDeleteChatMessage, WrapperPlayServerDisguisedChat, WrapperPlayServerEntityDestroy, WrapperPlayServerEntityEffect, WrapperPlayServerEntityEquipment, WrapperPlayServerEntityHeadRotation, WrapperPlayServerEntityLook, WrapperPlayServerEntityMetadata, WrapperPlayServerEntitySound, WrapperPlayServerEntityStatus, WrapperPlayServerEntityTeleport, WrapperPlayServerEntityVelocity, WrapperPlayServerExperience, WrapperPlayServerExplosion, WrapperPlayServerGameStateChange, WrapperPlayServerHeldItemSlot, WrapperPlayServerHurtAnimation, WrapperPlayServerInitializeBorder, WrapperPlayServerKeepAlive, WrapperPlayServerKickDisconnect, WrapperPlayServerLightUpdate, WrapperPlayServerLogin, WrapperPlayServerLookAt, WrapperPlayServerMap, WrapperPlayServerMapChunk, WrapperPlayServerMount, WrapperPlayServerMultiBlockChange, WrapperPlayServerNamedEntitySpawn, WrapperPlayServerNamedSoundEffect, WrapperPlayServerNbtQuery, WrapperPlayServerOpenBook, WrapperPlayServerOpenSignEditor, WrapperPlayServerOpenWindow, WrapperPlayServerOpenWindowHorse, WrapperPlayServerOpenWindowMerchant, WrapperPlayServerPing, WrapperPlayServerPlayerCombatEnd, WrapperPlayServerPlayerCombatEnter, WrapperPlayServerPlayerCombatKill, WrapperPlayServerPlayerInfo, WrapperPlayServerPlayerInfoRemove, WrapperPlayServerPlayerListHeaderFooter, WrapperPlayServerPosition, WrapperPlayServerRecipes, WrapperPlayServerRecipeUpdate, WrapperPlayServerRelEntityMove, WrapperPlayServerRelEntityMoveLook, WrapperPlayServerRemoveEntityEffect, WrapperPlayServerResourcePackSend, WrapperPlayServerRespawn, WrapperPlayServerScoreboardDisplayObjective, WrapperPlayServerScoreboardObjective, WrapperPlayServerScoreboardScore, WrapperPlayServerScoreboardTeam, WrapperPlayServerSelectAdvancementTab, WrapperPlayServerServerData, WrapperPlayServerServerDifficulty, WrapperPlayServerSetActionBarText, WrapperPlayServerSetBorderCenter, WrapperPlayServerSetBorderLerpSize, WrapperPlayServerSetBorderSize, WrapperPlayServerSetBorderWarningDelay, WrapperPlayServerSetBorderWarningDistance, WrapperPlayServerSetCooldown, WrapperPlayServerSetSlot, WrapperPlayServerSetSubtitleText, WrapperPlayServerSetTitlesAnimation, WrapperPlayServerSetTitleText, WrapperPlayServerSpawnEntity, WrapperPlayServerSpawnEntityExperienceOrb, WrapperPlayServerSpawnPosition, WrapperPlayServerStatistic, WrapperPlayServerStopSound, WrapperPlayServerSystemChat, WrapperPlayServerTabComplete, WrapperPlayServerTags, WrapperPlayServerTileEntityData, WrapperPlayServerUnloadChunk, WrapperPlayServerUpdateAttributes, WrapperPlayServerUpdateEnabledFeatures, WrapperPlayServerUpdateHealth, WrapperPlayServerUpdateSimulationDistance, WrapperPlayServerUpdateTime, WrapperPlayServerVehicleMove, WrapperPlayServerViewCentre, WrapperPlayServerViewDistance, WrapperPlayServerWindowData, WrapperPlayServerWindowItems, WrapperPlayServerWorldEvent, WrapperPlayServerWorldParticles, WrapperStatusClientPing, WrapperStatusClientStart, WrapperStatusServerPong, WrapperStatusServerServerInfo

public abstract class AbstractPacket extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.comphenix.protocol.events.PacketContainer
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractPacket(com.comphenix.protocol.events.PacketContainer handle, com.comphenix.protocol.PacketType type)
    Constructs a new strongly typed wrapper for the given packet.
     
    AbstractPacket(com.comphenix.protocol.PacketType type)
    Constructs a new strongly typed wrapper for the given packet and initialize it with a default packet instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Send the current packet to all online players.
    boolean
     
    com.comphenix.protocol.events.PacketContainer
    Retrieve a handle to the raw packet data.
    int
     
    void
    receivePacket(org.bukkit.entity.Player sender)
    Simulate receiving the current packet from the given sender.
    void
    sendPacket(org.bukkit.entity.Player receiver)
    Send the current packet to the given receiver.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • handle

      protected com.comphenix.protocol.events.PacketContainer handle
  • Constructor Details

    • AbstractPacket

      protected AbstractPacket(com.comphenix.protocol.events.PacketContainer handle, com.comphenix.protocol.PacketType type)
      Constructs a new strongly typed wrapper for the given packet.
      Parameters:
      handle - - handle to the raw packet data.
      type - - the packet type.
    • AbstractPacket

      public AbstractPacket(com.comphenix.protocol.PacketType type)
      Constructs a new strongly typed wrapper for the given packet and initialize it with a default packet instance.
      Parameters:
      type - - the packet type.
  • Method Details

    • getHandle

      public com.comphenix.protocol.events.PacketContainer getHandle()
      Retrieve a handle to the raw packet data.
      Returns:
      Raw packet data.
    • sendPacket

      public void sendPacket(org.bukkit.entity.Player receiver)
      Send the current packet to the given receiver.
      Parameters:
      receiver - - the receiver.
      Throws:
      RuntimeException - If the packet cannot be sent.
    • broadcastPacket

      public void broadcastPacket()
      Send the current packet to all online players.
    • receivePacket

      public void receivePacket(org.bukkit.entity.Player sender)
      Simulate receiving the current packet from the given sender.
      Parameters:
      sender - - the sender.
      Throws:
      RuntimeException - if the packet cannot be received.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object