Package net.minecraft.server.network
Class ServerPlayNetworkHandler
java.lang.Object
net.minecraft.server.network.ServerPlayNetworkHandler
- All Implemented Interfaces:
PacketListener
,ServerPlayPacketListener
public class ServerPlayNetworkHandler extends Object implements ServerPlayPacketListener
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ServerPlayNetworkHandler(MinecraftServer server, ClientConnection connection, ServerPlayerEntity player)
-
Method Summary
-
Field Details
-
LOGGER
-
connection
-
server
-
player
-
ticks
private int ticks -
lastKeepAliveTime
private long lastKeepAliveTime -
waitingForKeepAlive
private boolean waitingForKeepAlive -
keepAliveId
private long keepAliveId -
messageCooldown
private int messageCooldown -
creativeItemDropThreshold
private int creativeItemDropThreshold -
transactions
-
lastTickX
private double lastTickX -
lastTickY
private double lastTickY -
lastTickZ
private double lastTickZ -
updatedX
private double updatedX -
updatedY
private double updatedY -
updatedZ
private double updatedZ -
topmostRiddenEntity
-
lastTickRiddenX
private double lastTickRiddenX -
lastTickRiddenY
private double lastTickRiddenY -
lastTickRiddenZ
private double lastTickRiddenZ -
updatedRiddenX
private double updatedRiddenX -
updatedRiddenY
private double updatedRiddenY -
updatedRiddenZ
private double updatedRiddenZ -
requestedTeleportPos
-
requestedTeleportId
private int requestedTeleportId -
teleportRequestTick
private int teleportRequestTick -
floating
private boolean floating -
floatingTicks
private int floatingTicks -
ridingEntity
private boolean ridingEntity -
vehicleFloatingTicks
private int vehicleFloatingTicks -
movePacketsCount
private int movePacketsCount -
lastTickMovePacketsCount
private int lastTickMovePacketsCount
-
-
Constructor Details
-
ServerPlayNetworkHandler
public ServerPlayNetworkHandler(MinecraftServer server, ClientConnection connection, ServerPlayerEntity player)
-
-
Method Details
-
tick
public void tick() -
syncWithPlayerPosition
public void syncWithPlayerPosition() -
getConnection
- Specified by:
getConnection
in interfacePacketListener
-
isHost
private boolean isHost() -
disconnect
-
filterText
private <T> void filterText(T text, Consumer<T> consumer, BiFunction<TextStream,T,CompletableFuture<Optional<T>>> backingFilterer) -
filterText
-
filterTexts
-
onPlayerInput
- Specified by:
onPlayerInput
in interfaceServerPlayPacketListener
-
validatePlayerMove
-
validateVehicleMove
-
onVehicleMove
- Specified by:
onVehicleMove
in interfaceServerPlayPacketListener
-
method_29780
-
onTeleportConfirm
- Specified by:
onTeleportConfirm
in interfaceServerPlayPacketListener
-
onRecipeBookData
- Specified by:
onRecipeBookData
in interfaceServerPlayPacketListener
-
onRecipeCategoryOptions
- Specified by:
onRecipeCategoryOptions
in interfaceServerPlayPacketListener
-
onAdvancementTab
- Specified by:
onAdvancementTab
in interfaceServerPlayPacketListener
-
onRequestCommandCompletions
- Specified by:
onRequestCommandCompletions
in interfaceServerPlayPacketListener
-
onUpdateCommandBlock
- Specified by:
onUpdateCommandBlock
in interfaceServerPlayPacketListener
-
onUpdateCommandBlockMinecart
- Specified by:
onUpdateCommandBlockMinecart
in interfaceServerPlayPacketListener
-
onPickFromInventory
- Specified by:
onPickFromInventory
in interfaceServerPlayPacketListener
-
onRenameItem
- Specified by:
onRenameItem
in interfaceServerPlayPacketListener
-
onUpdateBeacon
- Specified by:
onUpdateBeacon
in interfaceServerPlayPacketListener
-
onStructureBlockUpdate
- Specified by:
onStructureBlockUpdate
in interfaceServerPlayPacketListener
-
onJigsawUpdate
- Specified by:
onJigsawUpdate
in interfaceServerPlayPacketListener
-
onJigsawGenerating
- Specified by:
onJigsawGenerating
in interfaceServerPlayPacketListener
-
onMerchantTradeSelect
- Specified by:
onMerchantTradeSelect
in interfaceServerPlayPacketListener
-
onBookUpdate
- Specified by:
onBookUpdate
in interfaceServerPlayPacketListener
-
method_31278
-
method_31276
-
onQueryEntityNbt
- Specified by:
onQueryEntityNbt
in interfaceServerPlayPacketListener
-
onQueryBlockNbt
- Specified by:
onQueryBlockNbt
in interfaceServerPlayPacketListener
-
onPlayerMove
- Specified by:
onPlayerMove
in interfaceServerPlayPacketListener
-
isPlayerNotCollidingWithBlocks
-
requestTeleport
public void requestTeleport(double x, double y, double z, float yaw, float pitch) -
teleportRequest
public void teleportRequest(double x, double y, double z, float yaw, float pitch, Set<PlayerPositionLookS2CPacket.Flag> set) -
onPlayerAction
- Specified by:
onPlayerAction
in interfaceServerPlayPacketListener
-
canPlace
Checks if a player can place a block or fluid from a bucket.For this to return true, the player must not be actively cooling down.
-
onPlayerInteractBlock
- Specified by:
onPlayerInteractBlock
in interfaceServerPlayPacketListener
-
onPlayerInteractItem
- Specified by:
onPlayerInteractItem
in interfaceServerPlayPacketListener
-
onSpectatorTeleport
- Specified by:
onSpectatorTeleport
in interfaceServerPlayPacketListener
-
onResourcePackStatus
- Specified by:
onResourcePackStatus
in interfaceServerPlayPacketListener
-
onBoatPaddleState
- Specified by:
onBoatPaddleState
in interfaceServerPlayPacketListener
-
onDisconnected
- Specified by:
onDisconnected
in interfacePacketListener
-
sendPacket
-
sendPacket
-
onUpdateSelectedSlot
- Specified by:
onUpdateSelectedSlot
in interfaceServerPlayPacketListener
-
onGameMessage
- Specified by:
onGameMessage
in interfaceServerPlayPacketListener
-
method_31286
-
executeCommand
-
onHandSwing
- Specified by:
onHandSwing
in interfaceServerPlayPacketListener
-
onClientCommand
- Specified by:
onClientCommand
in interfaceServerPlayPacketListener
-
onPlayerInteractEntity
- Specified by:
onPlayerInteractEntity
in interfaceServerPlayPacketListener
-
onClientStatus
- Specified by:
onClientStatus
in interfaceServerPlayPacketListener
-
onCloseHandledScreen
- Specified by:
onCloseHandledScreen
in interfaceServerPlayPacketListener
-
onClickSlot
- Specified by:
onClickSlot
in interfaceServerPlayPacketListener
-
onCraftRequest
- Specified by:
onCraftRequest
in interfaceServerPlayPacketListener
-
onButtonClick
- Specified by:
onButtonClick
in interfaceServerPlayPacketListener
-
onCreativeInventoryAction
- Specified by:
onCreativeInventoryAction
in interfaceServerPlayPacketListener
-
onConfirmScreenAction
- Specified by:
onConfirmScreenAction
in interfaceServerPlayPacketListener
-
onSignUpdate
- Specified by:
onSignUpdate
in interfaceServerPlayPacketListener
-
method_31282
-
onKeepAlive
- Specified by:
onKeepAlive
in interfaceServerPlayPacketListener
-
onPlayerAbilities
- Specified by:
onPlayerAbilities
in interfaceServerPlayPacketListener
-
onClientSettings
- Specified by:
onClientSettings
in interfaceServerPlayPacketListener
-
onCustomPayload
- Specified by:
onCustomPayload
in interfaceServerPlayPacketListener
-
onUpdateDifficulty
- Specified by:
onUpdateDifficulty
in interfaceServerPlayPacketListener
-
onUpdateDifficultyLock
- Specified by:
onUpdateDifficultyLock
in interfaceServerPlayPacketListener
-