Package net.minecraft.network.play
Class ServerPlayNetHandler
- java.lang.Object
-
- net.minecraft.network.play.ServerPlayNetHandler
-
- All Implemented Interfaces:
INetHandler
,IServerPlayNetHandler
- Direct Known Subclasses:
FakePlayer.FakePlayerNetHandler
public class ServerPlayNetHandler extends java.lang.Object implements IServerPlayNetHandler
-
-
Field Summary
Fields Modifier and Type Field Description private int
aboveGroundTickCount
private int
aboveGroundVehicleTickCount
private Vector3d
awaitingPositionFromClient
private int
awaitingTeleport
private int
awaitingTeleportTime
private int
chatSpamTickCount
private boolean
clientIsFloating
private boolean
clientVehicleIsFloating
NetworkManager
connection
private int
dropSpamTickCount
private it.unimi.dsi.fastutil.ints.Int2ShortMap
expectedAcks
private double
firstGoodX
private double
firstGoodY
private double
firstGoodZ
private long
keepAliveChallenge
private boolean
keepAlivePending
private long
keepAliveTime
private int
knownMovePacketCount
private double
lastGoodX
private double
lastGoodY
private double
lastGoodZ
private Entity
lastVehicle
private static org.apache.logging.log4j.Logger
LOGGER
ServerPlayerEntity
player
private int
receivedMovePacketCount
private MinecraftServer
server
private int
tickCount
private double
vehicleFirstGoodX
private double
vehicleFirstGoodY
private double
vehicleFirstGoodZ
private double
vehicleLastGoodX
private double
vehicleLastGoodY
private double
vehicleLastGoodZ
-
Constructor Summary
Constructors Constructor Description ServerPlayNetHandler(MinecraftServer p_i1530_1_, NetworkManager p_i1530_2_, ServerPlayerEntity p_i1530_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static boolean
containsInvalidValues(CMoveVehiclePacket p_184341_0_)
private static boolean
containsInvalidValues(CPlayerPacket p_183006_0_)
void
disconnect(ITextComponent p_194028_1_)
private void
filterTextPacket(java.lang.String p_244535_1_, java.util.function.Consumer<java.lang.String> p_244535_2_)
private void
filterTextPacket(java.util.List<java.lang.String> p_244537_1_, java.util.function.Consumer<java.util.List<java.lang.String>> p_244537_2_)
private <T> void
filterTextPacket(T p_244533_1_, java.util.function.Consumer<T> p_244533_2_, java.util.function.BiFunction<IChatFilter,T,java.util.concurrent.CompletableFuture<java.util.Optional<T>>> p_244533_3_)
NetworkManager
getConnection()
void
handleAcceptTeleportPacket(CConfirmTeleportPacket p_184339_1_)
void
handleAnimate(CAnimateHandPacket p_175087_1_)
void
handleBlockEntityTagQuery(CQueryTileEntityNBTPacket p_211525_1_)
void
handleChangeDifficulty(CSetDifficultyPacket p_217263_1_)
private void
handleChat(java.lang.String p_244548_1_)
void
handleChat(CChatMessagePacket p_147354_1_)
void
handleClientCommand(CClientStatusPacket p_147342_1_)
void
handleClientInformation(CClientSettingsPacket p_147352_1_)
private void
handleCommand(java.lang.String p_147361_1_)
void
handleContainerAck(CConfirmTransactionPacket p_147339_1_)
void
handleContainerButtonClick(CEnchantItemPacket p_147338_1_)
void
handleContainerClick(CClickWindowPacket p_147351_1_)
void
handleContainerClose(CCloseWindowPacket p_147356_1_)
void
handleCustomCommandSuggestions(CTabCompletePacket p_195518_1_)
void
handleCustomPayload(CCustomPayloadPacket p_147349_1_)
void
handleEditBook(CEditBookPacket p_210156_1_)
void
handleEntityTagQuery(CQueryEntityNBTPacket p_211526_1_)
void
handleInteract(CUseEntityPacket p_147340_1_)
void
handleJigsawGenerate(CJigsawBlockGeneratePacket p_230549_1_)
void
handleKeepAlive(CKeepAlivePacket p_147353_1_)
void
handleLockDifficulty(CLockDifficultyPacket p_217261_1_)
void
handleMovePlayer(CPlayerPacket p_147347_1_)
void
handleMoveVehicle(CMoveVehiclePacket p_184338_1_)
void
handlePaddleBoat(CSteerBoatPacket p_184340_1_)
void
handlePickItem(CPickItemPacket p_210152_1_)
void
handlePlaceRecipe(CPlaceRecipePacket p_194308_1_)
void
handlePlayerAbilities(CPlayerAbilitiesPacket p_147348_1_)
void
handlePlayerAction(CPlayerDiggingPacket p_147345_1_)
void
handlePlayerCommand(CEntityActionPacket p_147357_1_)
void
handlePlayerInput(CInputPacket p_147358_1_)
void
handleRecipeBookChangeSettingsPacket(CUpdateRecipeBookStatusPacket p_241831_1_)
void
handleRecipeBookSeenRecipePacket(CMarkRecipeSeenPacket p_191984_1_)
void
handleRenameItem(CRenameItemPacket p_210155_1_)
void
handleResourcePackResponse(CResourcePackStatusPacket p_175086_1_)
void
handleSeenAdvancements(CSeenAdvancementsPacket p_194027_1_)
void
handleSelectTrade(CSelectTradePacket p_210159_1_)
void
handleSetBeaconPacket(CUpdateBeaconPacket p_210154_1_)
void
handleSetCarriedItem(CHeldItemChangePacket p_147355_1_)
void
handleSetCommandBlock(CUpdateCommandBlockPacket p_210153_1_)
void
handleSetCommandMinecart(CUpdateMinecartCommandBlockPacket p_210158_1_)
void
handleSetCreativeModeSlot(CCreativeInventoryActionPacket p_147344_1_)
void
handleSetJigsawBlock(CUpdateJigsawBlockPacket p_217262_1_)
void
handleSetStructureBlock(CUpdateStructureBlockPacket p_210157_1_)
void
handleSignUpdate(CUpdateSignPacket p_147343_1_)
void
handleTeleportToEntityPacket(CSpectatePacket p_175088_1_)
void
handleUseItem(CPlayerTryUseItemPacket p_147346_1_)
void
handleUseItemOn(CPlayerTryUseItemOnBlockPacket p_184337_1_)
private boolean
isPlayerCollidingWithAnythingNew(IWorldReader p_241163_1_, AxisAlignedBB p_241163_2_)
private boolean
isSingleplayerOwner()
private boolean
noBlocksAround(Entity p_241162_1_)
void
onDisconnect(ITextComponent p_147231_1_)
void
resetPosition()
void
send(IPacket<?> p_147359_1_)
void
send(IPacket<?> p_211148_1_, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> p_211148_2_)
private void
signBook(java.lang.String p_244534_1_, java.util.List<java.lang.String> p_244534_2_, int p_244534_3_)
void
teleport(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_)
void
teleport(double p_175089_1_, double p_175089_3_, double p_175089_5_, float p_175089_7_, float p_175089_8_, java.util.Set<SPlayerPositionLookPacket.Flags> p_175089_9_)
void
tick()
private void
updateBookContents(java.util.List<java.lang.String> p_244536_1_, int p_244536_2_)
private void
updateSignText(CUpdateSignPacket p_244542_1_, java.util.List<java.lang.String> p_244542_2_)
private static boolean
wasBlockPlacementAttempt(ServerPlayerEntity p_241166_0_, ItemStack p_241166_1_)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
connection
public final NetworkManager connection
-
server
private final MinecraftServer server
-
player
public ServerPlayerEntity player
-
tickCount
private int tickCount
-
keepAliveTime
private long keepAliveTime
-
keepAlivePending
private boolean keepAlivePending
-
keepAliveChallenge
private long keepAliveChallenge
-
chatSpamTickCount
private int chatSpamTickCount
-
dropSpamTickCount
private int dropSpamTickCount
-
expectedAcks
private final it.unimi.dsi.fastutil.ints.Int2ShortMap expectedAcks
-
firstGoodX
private double firstGoodX
-
firstGoodY
private double firstGoodY
-
firstGoodZ
private double firstGoodZ
-
lastGoodX
private double lastGoodX
-
lastGoodY
private double lastGoodY
-
lastGoodZ
private double lastGoodZ
-
lastVehicle
private Entity lastVehicle
-
vehicleFirstGoodX
private double vehicleFirstGoodX
-
vehicleFirstGoodY
private double vehicleFirstGoodY
-
vehicleFirstGoodZ
private double vehicleFirstGoodZ
-
vehicleLastGoodX
private double vehicleLastGoodX
-
vehicleLastGoodY
private double vehicleLastGoodY
-
vehicleLastGoodZ
private double vehicleLastGoodZ
-
awaitingPositionFromClient
private Vector3d awaitingPositionFromClient
-
awaitingTeleport
private int awaitingTeleport
-
awaitingTeleportTime
private int awaitingTeleportTime
-
clientIsFloating
private boolean clientIsFloating
-
aboveGroundTickCount
private int aboveGroundTickCount
-
clientVehicleIsFloating
private boolean clientVehicleIsFloating
-
aboveGroundVehicleTickCount
private int aboveGroundVehicleTickCount
-
receivedMovePacketCount
private int receivedMovePacketCount
-
knownMovePacketCount
private int knownMovePacketCount
-
-
Constructor Detail
-
ServerPlayNetHandler
public ServerPlayNetHandler(MinecraftServer p_i1530_1_, NetworkManager p_i1530_2_, ServerPlayerEntity p_i1530_3_)
-
-
Method Detail
-
tick
public void tick()
-
resetPosition
public void resetPosition()
-
getConnection
public NetworkManager getConnection()
- Specified by:
getConnection
in interfaceINetHandler
-
isSingleplayerOwner
private boolean isSingleplayerOwner()
-
disconnect
public void disconnect(ITextComponent p_194028_1_)
-
filterTextPacket
private <T> void filterTextPacket(T p_244533_1_, java.util.function.Consumer<T> p_244533_2_, java.util.function.BiFunction<IChatFilter,T,java.util.concurrent.CompletableFuture<java.util.Optional<T>>> p_244533_3_)
-
filterTextPacket
private void filterTextPacket(java.lang.String p_244535_1_, java.util.function.Consumer<java.lang.String> p_244535_2_)
-
filterTextPacket
private void filterTextPacket(java.util.List<java.lang.String> p_244537_1_, java.util.function.Consumer<java.util.List<java.lang.String>> p_244537_2_)
-
handlePlayerInput
public void handlePlayerInput(CInputPacket p_147358_1_)
- Specified by:
handlePlayerInput
in interfaceIServerPlayNetHandler
-
containsInvalidValues
private static boolean containsInvalidValues(CPlayerPacket p_183006_0_)
-
containsInvalidValues
private static boolean containsInvalidValues(CMoveVehiclePacket p_184341_0_)
-
handleMoveVehicle
public void handleMoveVehicle(CMoveVehiclePacket p_184338_1_)
- Specified by:
handleMoveVehicle
in interfaceIServerPlayNetHandler
-
noBlocksAround
private boolean noBlocksAround(Entity p_241162_1_)
-
handleAcceptTeleportPacket
public void handleAcceptTeleportPacket(CConfirmTeleportPacket p_184339_1_)
- Specified by:
handleAcceptTeleportPacket
in interfaceIServerPlayNetHandler
-
handleRecipeBookSeenRecipePacket
public void handleRecipeBookSeenRecipePacket(CMarkRecipeSeenPacket p_191984_1_)
- Specified by:
handleRecipeBookSeenRecipePacket
in interfaceIServerPlayNetHandler
-
handleRecipeBookChangeSettingsPacket
public void handleRecipeBookChangeSettingsPacket(CUpdateRecipeBookStatusPacket p_241831_1_)
- Specified by:
handleRecipeBookChangeSettingsPacket
in interfaceIServerPlayNetHandler
-
handleSeenAdvancements
public void handleSeenAdvancements(CSeenAdvancementsPacket p_194027_1_)
- Specified by:
handleSeenAdvancements
in interfaceIServerPlayNetHandler
-
handleCustomCommandSuggestions
public void handleCustomCommandSuggestions(CTabCompletePacket p_195518_1_)
- Specified by:
handleCustomCommandSuggestions
in interfaceIServerPlayNetHandler
-
handleSetCommandBlock
public void handleSetCommandBlock(CUpdateCommandBlockPacket p_210153_1_)
- Specified by:
handleSetCommandBlock
in interfaceIServerPlayNetHandler
-
handleSetCommandMinecart
public void handleSetCommandMinecart(CUpdateMinecartCommandBlockPacket p_210158_1_)
- Specified by:
handleSetCommandMinecart
in interfaceIServerPlayNetHandler
-
handlePickItem
public void handlePickItem(CPickItemPacket p_210152_1_)
- Specified by:
handlePickItem
in interfaceIServerPlayNetHandler
-
handleRenameItem
public void handleRenameItem(CRenameItemPacket p_210155_1_)
- Specified by:
handleRenameItem
in interfaceIServerPlayNetHandler
-
handleSetBeaconPacket
public void handleSetBeaconPacket(CUpdateBeaconPacket p_210154_1_)
- Specified by:
handleSetBeaconPacket
in interfaceIServerPlayNetHandler
-
handleSetStructureBlock
public void handleSetStructureBlock(CUpdateStructureBlockPacket p_210157_1_)
- Specified by:
handleSetStructureBlock
in interfaceIServerPlayNetHandler
-
handleSetJigsawBlock
public void handleSetJigsawBlock(CUpdateJigsawBlockPacket p_217262_1_)
- Specified by:
handleSetJigsawBlock
in interfaceIServerPlayNetHandler
-
handleJigsawGenerate
public void handleJigsawGenerate(CJigsawBlockGeneratePacket p_230549_1_)
- Specified by:
handleJigsawGenerate
in interfaceIServerPlayNetHandler
-
handleSelectTrade
public void handleSelectTrade(CSelectTradePacket p_210159_1_)
- Specified by:
handleSelectTrade
in interfaceIServerPlayNetHandler
-
handleEditBook
public void handleEditBook(CEditBookPacket p_210156_1_)
- Specified by:
handleEditBook
in interfaceIServerPlayNetHandler
-
updateBookContents
private void updateBookContents(java.util.List<java.lang.String> p_244536_1_, int p_244536_2_)
-
signBook
private void signBook(java.lang.String p_244534_1_, java.util.List<java.lang.String> p_244534_2_, int p_244534_3_)
-
handleEntityTagQuery
public void handleEntityTagQuery(CQueryEntityNBTPacket p_211526_1_)
- Specified by:
handleEntityTagQuery
in interfaceIServerPlayNetHandler
-
handleBlockEntityTagQuery
public void handleBlockEntityTagQuery(CQueryTileEntityNBTPacket p_211525_1_)
- Specified by:
handleBlockEntityTagQuery
in interfaceIServerPlayNetHandler
-
handleMovePlayer
public void handleMovePlayer(CPlayerPacket p_147347_1_)
- Specified by:
handleMovePlayer
in interfaceIServerPlayNetHandler
-
isPlayerCollidingWithAnythingNew
private boolean isPlayerCollidingWithAnythingNew(IWorldReader p_241163_1_, AxisAlignedBB p_241163_2_)
-
teleport
public void teleport(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_)
-
teleport
public void teleport(double p_175089_1_, double p_175089_3_, double p_175089_5_, float p_175089_7_, float p_175089_8_, java.util.Set<SPlayerPositionLookPacket.Flags> p_175089_9_)
-
handlePlayerAction
public void handlePlayerAction(CPlayerDiggingPacket p_147345_1_)
- Specified by:
handlePlayerAction
in interfaceIServerPlayNetHandler
-
wasBlockPlacementAttempt
private static boolean wasBlockPlacementAttempt(ServerPlayerEntity p_241166_0_, ItemStack p_241166_1_)
-
handleUseItemOn
public void handleUseItemOn(CPlayerTryUseItemOnBlockPacket p_184337_1_)
- Specified by:
handleUseItemOn
in interfaceIServerPlayNetHandler
-
handleUseItem
public void handleUseItem(CPlayerTryUseItemPacket p_147346_1_)
- Specified by:
handleUseItem
in interfaceIServerPlayNetHandler
-
handleTeleportToEntityPacket
public void handleTeleportToEntityPacket(CSpectatePacket p_175088_1_)
- Specified by:
handleTeleportToEntityPacket
in interfaceIServerPlayNetHandler
-
handleResourcePackResponse
public void handleResourcePackResponse(CResourcePackStatusPacket p_175086_1_)
- Specified by:
handleResourcePackResponse
in interfaceIServerPlayNetHandler
-
handlePaddleBoat
public void handlePaddleBoat(CSteerBoatPacket p_184340_1_)
- Specified by:
handlePaddleBoat
in interfaceIServerPlayNetHandler
-
onDisconnect
public void onDisconnect(ITextComponent p_147231_1_)
- Specified by:
onDisconnect
in interfaceINetHandler
-
send
public void send(IPacket<?> p_147359_1_)
-
send
public void send(IPacket<?> p_211148_1_, @Nullable io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> p_211148_2_)
-
handleSetCarriedItem
public void handleSetCarriedItem(CHeldItemChangePacket p_147355_1_)
- Specified by:
handleSetCarriedItem
in interfaceIServerPlayNetHandler
-
handleChat
public void handleChat(CChatMessagePacket p_147354_1_)
- Specified by:
handleChat
in interfaceIServerPlayNetHandler
-
handleChat
private void handleChat(java.lang.String p_244548_1_)
-
handleCommand
private void handleCommand(java.lang.String p_147361_1_)
-
handleAnimate
public void handleAnimate(CAnimateHandPacket p_175087_1_)
- Specified by:
handleAnimate
in interfaceIServerPlayNetHandler
-
handlePlayerCommand
public void handlePlayerCommand(CEntityActionPacket p_147357_1_)
- Specified by:
handlePlayerCommand
in interfaceIServerPlayNetHandler
-
handleInteract
public void handleInteract(CUseEntityPacket p_147340_1_)
- Specified by:
handleInteract
in interfaceIServerPlayNetHandler
-
handleClientCommand
public void handleClientCommand(CClientStatusPacket p_147342_1_)
- Specified by:
handleClientCommand
in interfaceIServerPlayNetHandler
-
handleContainerClose
public void handleContainerClose(CCloseWindowPacket p_147356_1_)
- Specified by:
handleContainerClose
in interfaceIServerPlayNetHandler
-
handleContainerClick
public void handleContainerClick(CClickWindowPacket p_147351_1_)
- Specified by:
handleContainerClick
in interfaceIServerPlayNetHandler
-
handlePlaceRecipe
public void handlePlaceRecipe(CPlaceRecipePacket p_194308_1_)
- Specified by:
handlePlaceRecipe
in interfaceIServerPlayNetHandler
-
handleContainerButtonClick
public void handleContainerButtonClick(CEnchantItemPacket p_147338_1_)
- Specified by:
handleContainerButtonClick
in interfaceIServerPlayNetHandler
-
handleSetCreativeModeSlot
public void handleSetCreativeModeSlot(CCreativeInventoryActionPacket p_147344_1_)
- Specified by:
handleSetCreativeModeSlot
in interfaceIServerPlayNetHandler
-
handleContainerAck
public void handleContainerAck(CConfirmTransactionPacket p_147339_1_)
- Specified by:
handleContainerAck
in interfaceIServerPlayNetHandler
-
handleSignUpdate
public void handleSignUpdate(CUpdateSignPacket p_147343_1_)
- Specified by:
handleSignUpdate
in interfaceIServerPlayNetHandler
-
updateSignText
private void updateSignText(CUpdateSignPacket p_244542_1_, java.util.List<java.lang.String> p_244542_2_)
-
handleKeepAlive
public void handleKeepAlive(CKeepAlivePacket p_147353_1_)
- Specified by:
handleKeepAlive
in interfaceIServerPlayNetHandler
-
handlePlayerAbilities
public void handlePlayerAbilities(CPlayerAbilitiesPacket p_147348_1_)
- Specified by:
handlePlayerAbilities
in interfaceIServerPlayNetHandler
-
handleClientInformation
public void handleClientInformation(CClientSettingsPacket p_147352_1_)
- Specified by:
handleClientInformation
in interfaceIServerPlayNetHandler
-
handleCustomPayload
public void handleCustomPayload(CCustomPayloadPacket p_147349_1_)
- Specified by:
handleCustomPayload
in interfaceIServerPlayNetHandler
-
handleChangeDifficulty
public void handleChangeDifficulty(CSetDifficultyPacket p_217263_1_)
- Specified by:
handleChangeDifficulty
in interfaceIServerPlayNetHandler
-
handleLockDifficulty
public void handleLockDifficulty(CLockDifficultyPacket p_217261_1_)
- Specified by:
handleLockDifficulty
in interfaceIServerPlayNetHandler
-
-