net.minecraft.network

## Class NetServerHandler

- java.lang.Object
- - net.minecraft.network.packet.NetHandler
  - - net.minecraft.network.NetServerHandler

-     public class NetServerHandler
      extends NetHandler

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `connectionClosed` This is set to true whenever a player disconnects from the server.
    `static Logger` | `logger` The logging system.
    `INetworkManager` | `netManager` The underlying network manager for this server handler.
    `EntityPlayerMP` | `playerEntity` Reference to the EntityPlayerMP object.
    `int` | `ticksForFloatKick` player is kicked if they float for over 80 ticks without flying enabled

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetServerHandler(MinecraftServer par1, INetworkManager par2, EntityPlayerMP par3)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canProcessPacketsAsync()` If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be processed asynchronously.
    `EntityPlayerMP` | `getPlayer()`
    `void` | `handleAnimation(Packet18Animation par1Packet18Animation)`
    `void` | `handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete)`
    `void` | `handleBlockDig(Packet14BlockDig par1Packet14BlockDig)`
    `void` | `handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch)`
    `void` | `handleChat(Packet3Chat par1Packet3Chat)`
    `void` | `handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand)`
    `void` | `handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo)`
    `void` | `handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow)`
    `void` | `handleCreativeSetSlot(Packet107CreativeSetSlot par1Packet107CreativeSetSlot)` Handle a creative slot packet.
    `void` | `handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload)`
    `void` | `handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem)`
    `void` | `handleEntityAction(Packet19EntityAction par1Packet19EntityAction)` runs registerPacket on the given Packet19EntityAction
    `void` | `handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)`
    `void` | `handleFlying(Packet10Flying par1Packet10Flying)`
    `void` | `handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive)` Handle a keep alive packet.
    `void` | `handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)`
    `void` | `handleMapData(Packet131MapData par1Packet131MapData)` Contains logic for handling packets containing arbitrary unique item data.
    `void` | `handlePlace(Packet15Place par1Packet15Place)`
    `void` | `handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities)` Handle a player abilities packet.
    `void` | `handleRespawn(Packet9Respawn par1Packet9Respawn)` respawns the player
    `void` | `handleTransaction(Packet106Transaction par1Packet106Transaction)`
    `void` | `handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)` Updates Client side signs
    `void` | `handleUseEntity(Packet7UseEntity par1Packet7UseEntity)`
    `void` | `handleVanilla250Packet(Packet250CustomPayload par1Packet250CustomPayload)`
    `void` | `handleWindowClick(Packet102WindowClick par1Packet102WindowClick)`
    `boolean` | `isServerHandler()` determine if it is a server handler
    `void` | `kickPlayerFromServer(String par1Str)`
    `void` | `networkTick()` run once each game tick
    `int` | `packetSize()` returns 0 for memoryMapped connections
    `void` | `sendPacketToPlayer(Packet par1Packet)` addToSendQueue.
    `void` | `setPlayerLocation(double par1, double par3, double par5, float par7, float par8)` Moves the player to the specified destination and rotation
    `void` | `unexpectedPacket(Packet par1Packet)` Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing.

    - ### Methods inherited from class net.minecraft.network.packet.NetHandler

      `handleAttachEntity, handleBlockChange, handleBlockDestroy, handleBlockEvent, handleClientProtocol, handleCollect, handleDestroyEntity, handleDoorChange, handleEntity, handleEntityEffect, handleEntityExpOrb, handleEntityHeadRotation, handleEntityMetadata, handleEntityPainting, handleEntityStatus, handleEntityTeleport, handleEntityVelocity, handleExperience, handleExplosion, handleGameEvent, handleLevelSound, handleLogin, handleMapChunk, handleMapChunks, handleMobSpawn, handleMultiBlockChange, handleNamedEntitySpawn, handleOpenWindow, handlePlayerInfo, handlePlayerInventory, handleRemoveEntityEffect, handleServerAuthData, handleServerPing, handleSetSlot, handleSharedKey, handleSleep, handleSpawnPosition, handleStatistic, handleTileEntityData, handleUpdateHealth, handleUpdateProgressbar, handleUpdateTime, handleVehicleSpawn, handleWeather, handleWindowItems`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          public static Logger logger

      The logging system.

    - #### netManager

          public INetworkManager netManager

      The underlying network manager for this server handler.

    - #### connectionClosed

          public boolean connectionClosed

      This is set to true whenever a player disconnects from the server.

    - #### playerEntity

          public EntityPlayerMP playerEntity

      Reference to the EntityPlayerMP object.

    - #### ticksForFloatKick

          public int ticksForFloatKick

      player is kicked if they float for over 80 ticks without flying enabled

  - ### Constructor Detail

    - #### NetServerHandler

          public NetServerHandler(MinecraftServer par1,
                          INetworkManager par2,
                          EntityPlayerMP par3)

  - ### Method Detail

    - #### networkTick

          public void networkTick()

      run once each game tick

    - #### kickPlayerFromServer

          public void kickPlayerFromServer(String par1Str)

    - #### handleFlying

          public void handleFlying(Packet10Flying par1Packet10Flying)

      Overrides:
        `handleFlying` in class `NetHandler`

    - #### setPlayerLocation

          public void setPlayerLocation(double par1,
                               double par3,
                               double par5,
                               float par7,
                               float par8)

      Moves the player to the specified destination and rotation

    - #### handleBlockDig

          public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig)

      Overrides:
        `handleBlockDig` in class `NetHandler`

    - #### handlePlace

          public void handlePlace(Packet15Place par1Packet15Place)

      Overrides:
        `handlePlace` in class `NetHandler`

    - #### handleErrorMessage

          public void handleErrorMessage(String par1Str,
                                Object[] par2ArrayOfObj)

      Overrides:
        `handleErrorMessage` in class `NetHandler`

    - #### unexpectedPacket

          public void unexpectedPacket(Packet par1Packet)

      Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing.
      Overrides:
        `unexpectedPacket` in class `NetHandler`

    - #### sendPacketToPlayer

          public void sendPacketToPlayer(Packet par1Packet)

      addToSendQueue. if it is a chat packet, check before sending it

    - #### handleBlockItemSwitch

          public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch)

      Overrides:
        `handleBlockItemSwitch` in class `NetHandler`

    - #### handleChat

          public void handleChat(Packet3Chat par1Packet3Chat)

      Overrides:
        `handleChat` in class `NetHandler`

    - #### handleAnimation

          public void handleAnimation(Packet18Animation par1Packet18Animation)

      Overrides:
        `handleAnimation` in class `NetHandler`

    - #### handleEntityAction

          public void handleEntityAction(Packet19EntityAction par1Packet19EntityAction)

      runs registerPacket on the given Packet19EntityAction
      Overrides:
        `handleEntityAction` in class `NetHandler`

    - #### handleKickDisconnect

          public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)

      Overrides:
        `handleKickDisconnect` in class `NetHandler`

    - #### packetSize

          public int packetSize()

      returns 0 for memoryMapped connections

    - #### handleUseEntity

          public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity)

      Overrides:
        `handleUseEntity` in class `NetHandler`

    - #### handleClientCommand

          public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand)

      Overrides:
        `handleClientCommand` in class `NetHandler`

    - #### canProcessPacketsAsync

          public boolean canProcessPacketsAsync()

      If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded (which happens on the main thread)
      Overrides:
        `canProcessPacketsAsync` in class `NetHandler`

    - #### handleRespawn

          public void handleRespawn(Packet9Respawn par1Packet9Respawn)

      respawns the player
      Overrides:
        `handleRespawn` in class `NetHandler`

    - #### handleCloseWindow

          public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow)

      Overrides:
        `handleCloseWindow` in class `NetHandler`

    - #### handleWindowClick

          public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick)

      Overrides:
        `handleWindowClick` in class `NetHandler`

    - #### handleEnchantItem

          public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem)

      Overrides:
        `handleEnchantItem` in class `NetHandler`

    - #### handleCreativeSetSlot

          public void handleCreativeSetSlot(Packet107CreativeSetSlot par1Packet107CreativeSetSlot)

      Handle a creative slot packet.
      Overrides:
        `handleCreativeSetSlot` in class `NetHandler`

    - #### handleTransaction

          public void handleTransaction(Packet106Transaction par1Packet106Transaction)

      Overrides:
        `handleTransaction` in class `NetHandler`

    - #### handleUpdateSign

          public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)

      Updates Client side signs
      Overrides:
        `handleUpdateSign` in class `NetHandler`

    - #### handleKeepAlive

          public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive)

      Handle a keep alive packet.
      Overrides:
        `handleKeepAlive` in class `NetHandler`

    - #### isServerHandler

          public boolean isServerHandler()

      determine if it is a server handler
      Specified by:
        `isServerHandler` in class `NetHandler`

    - #### handlePlayerAbilities

          public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities)

      Handle a player abilities packet.
      Overrides:
        `handlePlayerAbilities` in class `NetHandler`

    - #### handleAutoComplete

          public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete)

      Overrides:
        `handleAutoComplete` in class `NetHandler`

    - #### handleClientInfo

          public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo)

      Overrides:
        `handleClientInfo` in class `NetHandler`

    - #### handleCustomPayload

          public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload)

      Overrides:
        `handleCustomPayload` in class `NetHandler`

    - #### handleVanilla250Packet

          public void handleVanilla250Packet(Packet250CustomPayload par1Packet250CustomPayload)

      Specified by:
        `handleVanilla250Packet` in class `NetHandler`

    - #### handleMapData

          public void handleMapData(Packet131MapData par1Packet131MapData)

      Description copied from class: `NetHandler`
      Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps.
      Overrides:
        `handleMapData` in class `NetHandler`

    - #### getPlayer

          public EntityPlayerMP getPlayer()

      Specified by:
        `getPlayer` in class `NetHandler`