Package net.minecraft.server.network
Class ServerGamePacketListenerImpl
java.lang.Object
net.minecraft.server.network.ServerGamePacketListenerImpl
- All Implemented Interfaces:
PacketListener,ServerGamePacketListener,ServerPacketListener,TickablePacketListener,ServerPlayerConnection
- Direct Known Subclasses:
FakePlayer.FakePlayerNetHandler
public class ServerGamePacketListenerImpl
extends Object
implements ServerPlayerConnection, TickablePacketListener, ServerGamePacketListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprivate intprivate Vec3private intprivate intprivate static final Componentprivate final FutureChainprivate RemoteChatSessionprivate intprivate booleanprivate booleanfinal Connectionprivate intprivate doubleprivate doubleprivate doubleprivate longprivate booleanprivate longprivate intprivate final AtomicReference<Instant>private doubleprivate doubleprivate doubleprivate final LastSeenMessagesValidatorprivate Entityprivate static final int(package private) static final org.slf4j.Loggerstatic final doubleDeprecated.private final MessageSignatureCacheprivate static final intprivate intprivate final MinecraftServerprivate SignedMessageChain.Decoderprivate intprivate static final intprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate double -
Constructor Summary
ConstructorsConstructorDescriptionServerGamePacketListenerImpl(MinecraftServer p_9770_, Connection p_9771_, ServerPlayer p_9772_) -
Method Summary
Modifier and TypeMethodDescriptionvoidackBlockChangesUpTo(int p_215202_) voidaddPendingMessage(PlayerChatMessage p_242439_) private voidbroadcastChatMessage(PlayerChatMessage p_243277_) private static doubleclampHorizontal(double p_143610_) private static doubleclampVertical(double p_143654_) private Map<String,PlayerChatMessage> collectSignedArguments(ServerboundChatCommandPacket p_249441_, SignableCommand<?> p_250039_, LastSeenMessages p_249207_) private static booleancontainsInvalidValues(double p_143664_, double p_143665_, double p_143666_, float p_143667_, float p_143668_) private voidvoiddisconnect(Component p_9943_) private CompletableFuture<FilteredText>filterTextPacket(String p_243213_) private CompletableFuture<List<FilteredText>>filterTextPacket(List<String> p_243258_) private <T,R> CompletableFuture<R> filterTextPacket(T p_243240_, BiFunction<TextFilter, T, CompletableFuture<R>> p_243271_) private PlayerChatMessagegetSignedMessage(ServerboundChatPacket p_251061_, LastSeenMessages p_250566_) voidvoidhandleAnimate(ServerboundSwingPacket p_9926_) voidvoidvoidhandleChat(ServerboundChatPacket p_9841_) voidhandleChatAck(ServerboundChatAckPacket p_242387_) voidhandleChatCommand(ServerboundChatCommandPacket p_215225_) voidvoidvoidvoidvoidvoidvoidvoidvoidhandleEditBook(ServerboundEditBookPacket p_9862_) voidvoidhandleInteract(ServerboundInteractPacket p_9866_) voidvoidvoidprivate voidvoidvoidvoidvoidhandlePickItem(ServerboundPickItemPacket p_9880_) voidvoidvoidvoidvoidvoidhandlePong(ServerboundPongPacket p_143652_) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidhandleUseItem(ServerboundUseItemPacket p_9932_) voidbooleanprivate static booleanisChatMessageIllegal(String p_215215_) private booleanisPlayerCollidingWithAnythingNew(LevelReader p_289008_, AABB p_288986_, double p_288990_, double p_288991_, double p_288967_) private booleanprivate booleannoBlocksAround(Entity p_9794_) voidonDisconnect(Component p_9825_) private com.mojang.brigadier.ParseResults<CommandSourceStack>parseCommand(String p_242938_) private voidperformChatCommand(ServerboundChatCommandPacket p_251139_, LastSeenMessages p_250484_) private voidresetPlayerChatState(RemoteChatSession p_253823_) voidvoidvoidsend(Packet<?> p_243227_, PacketSendListener p_243273_) voidsendDisguisedChatMessage(Component p_251804_, ChatType.Bound p_250040_) voidsendPlayerChatMessage(PlayerChatMessage p_250321_, ChatType.Bound p_250910_) private voidsignBook(FilteredText p_215209_, List<FilteredText> p_215210_, int p_215211_) voidteleport(double p_9775_, double p_9776_, double p_9777_, float p_9778_, float p_9779_) voidteleport(double p_9781_, double p_9782_, double p_9783_, float p_9784_, float p_9785_, Set<RelativeMovement> p_9786_) voidtick()private Optional<LastSeenMessages>tryHandleChat(String p_251364_, Instant p_248959_, LastSeenMessages.Update p_249613_) private Optional<LastSeenMessages>unpackAndApplyLastSeen(LastSeenMessages.Update p_249673_) private voidupdateBookContents(List<FilteredText> p_9813_, int p_9814_) private voidupdateBookPages(List<FilteredText> p_143635_, UnaryOperator<String> p_143636_, ItemStack p_143637_) private booleanupdateChatOrder(Instant p_215237_) private voidupdateSignText(ServerboundSignUpdatePacket p_9923_, List<FilteredText> p_9924_) private static booleanwasBlockPlacementAttempt(ServerPlayer p_9791_, ItemStack p_9792_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.game.ServerPacketListener
shouldPropagateHandlingExceptions
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
LATENCY_CHECK_INTERVAL
private static final int LATENCY_CHECK_INTERVAL- See Also:
-
MAX_INTERACTION_DISTANCE
Deprecated.Forge: Deprecated in favor of range/reach attributes.- See Also:
-
NO_BLOCK_UPDATES_TO_ACK
private static final int NO_BLOCK_UPDATES_TO_ACK- See Also:
-
TRACKED_MESSAGE_DISCONNECT_THRESHOLD
private static final int TRACKED_MESSAGE_DISCONNECT_THRESHOLD- See Also:
-
CHAT_VALIDATION_FAILED
-
connection
-
server
-
player
-
tickCount
private int tickCount -
ackBlockChangesUpTo
private int ackBlockChangesUpTo -
keepAliveTime
private long keepAliveTime -
keepAlivePending
private boolean keepAlivePending -
keepAliveChallenge
private long keepAliveChallenge -
chatSpamTickCount
private int chatSpamTickCount -
dropSpamTickCount
private int dropSpamTickCount -
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
-
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
-
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 -
lastChatTimeStamp
-
chatSession
-
signedMessageDecoder
-
lastSeenMessages
-
messageSignatureCache
-
chatMessageChain
-
-
Constructor Details
-
ServerGamePacketListenerImpl
public ServerGamePacketListenerImpl(MinecraftServer p_9770_, Connection p_9771_, ServerPlayer p_9772_)
-
-
Method Details
-
tick
public void tick()- Specified by:
tickin interfaceTickablePacketListener
-
resetPosition
public void resetPosition() -
isAcceptingMessages
public boolean isAcceptingMessages()- Specified by:
isAcceptingMessagesin interfacePacketListener
-
isSingleplayerOwner
private boolean isSingleplayerOwner() -
disconnect
-
filterTextPacket
private <T,R> CompletableFuture<R> filterTextPacket(T p_243240_, BiFunction<TextFilter, T, CompletableFuture<R>> p_243271_) -
filterTextPacket
-
filterTextPacket
-
handlePlayerInput
- Specified by:
handlePlayerInputin interfaceServerGamePacketListener
-
containsInvalidValues
private static boolean containsInvalidValues(double p_143664_, double p_143665_, double p_143666_, float p_143667_, float p_143668_) -
clampHorizontal
private static double clampHorizontal(double p_143610_) -
clampVertical
private static double clampVertical(double p_143654_) -
handleMoveVehicle
- Specified by:
handleMoveVehiclein interfaceServerGamePacketListener
-
noBlocksAround
-
handleAcceptTeleportPacket
- Specified by:
handleAcceptTeleportPacketin interfaceServerGamePacketListener
-
handleRecipeBookSeenRecipePacket
- Specified by:
handleRecipeBookSeenRecipePacketin interfaceServerGamePacketListener
-
handleRecipeBookChangeSettingsPacket
- Specified by:
handleRecipeBookChangeSettingsPacketin interfaceServerGamePacketListener
-
handleSeenAdvancements
- Specified by:
handleSeenAdvancementsin interfaceServerGamePacketListener
-
handleCustomCommandSuggestions
- Specified by:
handleCustomCommandSuggestionsin interfaceServerGamePacketListener
-
handleSetCommandBlock
- Specified by:
handleSetCommandBlockin interfaceServerGamePacketListener
-
handleSetCommandMinecart
- Specified by:
handleSetCommandMinecartin interfaceServerGamePacketListener
-
handlePickItem
- Specified by:
handlePickItemin interfaceServerGamePacketListener
-
handleRenameItem
- Specified by:
handleRenameItemin interfaceServerGamePacketListener
-
handleSetBeaconPacket
- Specified by:
handleSetBeaconPacketin interfaceServerGamePacketListener
-
handleSetStructureBlock
- Specified by:
handleSetStructureBlockin interfaceServerGamePacketListener
-
handleSetJigsawBlock
- Specified by:
handleSetJigsawBlockin interfaceServerGamePacketListener
-
handleJigsawGenerate
- Specified by:
handleJigsawGeneratein interfaceServerGamePacketListener
-
handleSelectTrade
- Specified by:
handleSelectTradein interfaceServerGamePacketListener
-
handleEditBook
- Specified by:
handleEditBookin interfaceServerGamePacketListener
-
updateBookContents
-
signBook
-
updateBookPages
private void updateBookPages(List<FilteredText> p_143635_, UnaryOperator<String> p_143636_, ItemStack p_143637_) -
handleEntityTagQuery
- Specified by:
handleEntityTagQueryin interfaceServerGamePacketListener
-
handleBlockEntityTagQuery
- Specified by:
handleBlockEntityTagQueryin interfaceServerGamePacketListener
-
handleMovePlayer
- Specified by:
handleMovePlayerin interfaceServerGamePacketListener
-
isPlayerCollidingWithAnythingNew
private boolean isPlayerCollidingWithAnythingNew(LevelReader p_289008_, AABB p_288986_, double p_288990_, double p_288991_, double p_288967_) -
teleport
public void teleport(double p_9775_, double p_9776_, double p_9777_, float p_9778_, float p_9779_) -
teleport
public void teleport(double p_9781_, double p_9782_, double p_9783_, float p_9784_, float p_9785_, Set<RelativeMovement> p_9786_) -
handlePlayerAction
- Specified by:
handlePlayerActionin interfaceServerGamePacketListener
-
wasBlockPlacementAttempt
-
handleUseItemOn
- Specified by:
handleUseItemOnin interfaceServerGamePacketListener
-
handleUseItem
- Specified by:
handleUseItemin interfaceServerGamePacketListener
-
handleTeleportToEntityPacket
- Specified by:
handleTeleportToEntityPacketin interfaceServerGamePacketListener
-
handleResourcePackResponse
- Specified by:
handleResourcePackResponsein interfaceServerGamePacketListener
-
handlePaddleBoat
- Specified by:
handlePaddleBoatin interfaceServerGamePacketListener
-
handlePong
- Specified by:
handlePongin interfaceServerGamePacketListener
-
onDisconnect
- Specified by:
onDisconnectin interfacePacketListener
-
ackBlockChangesUpTo
public void ackBlockChangesUpTo(int p_215202_) -
send
- Specified by:
sendin interfaceServerPlayerConnection
-
send
-
handleSetCarriedItem
- Specified by:
handleSetCarriedItemin interfaceServerGamePacketListener
-
handleChat
- Specified by:
handleChatin interfaceServerGamePacketListener
-
handleChatCommand
- Specified by:
handleChatCommandin interfaceServerGamePacketListener
-
performChatCommand
-
handleMessageDecodeFailure
-
collectSignedArguments
private Map<String,PlayerChatMessage> collectSignedArguments(ServerboundChatCommandPacket p_249441_, SignableCommand<?> p_250039_, LastSeenMessages p_249207_) throws SignedMessageChain.DecodeException -
parseCommand
-
tryHandleChat
private Optional<LastSeenMessages> tryHandleChat(String p_251364_, Instant p_248959_, LastSeenMessages.Update p_249613_) -
unpackAndApplyLastSeen
-
updateChatOrder
-
isChatMessageIllegal
-
getSignedMessage
private PlayerChatMessage getSignedMessage(ServerboundChatPacket p_251061_, LastSeenMessages p_250566_) throws SignedMessageChain.DecodeException -
broadcastChatMessage
-
detectRateSpam
private void detectRateSpam() -
handleChatAck
- Specified by:
handleChatAckin interfaceServerGamePacketListener
-
handleAnimate
- Specified by:
handleAnimatein interfaceServerGamePacketListener
-
handlePlayerCommand
- Specified by:
handlePlayerCommandin interfaceServerGamePacketListener
-
addPendingMessage
-
sendPlayerChatMessage
-
sendDisguisedChatMessage
-
getRemoteAddress
-
handleInteract
- Specified by:
handleInteractin interfaceServerGamePacketListener
-
handleClientCommand
- Specified by:
handleClientCommandin interfaceServerGamePacketListener
-
handleContainerClose
- Specified by:
handleContainerClosein interfaceServerGamePacketListener
-
handleContainerClick
- Specified by:
handleContainerClickin interfaceServerGamePacketListener
-
handlePlaceRecipe
- Specified by:
handlePlaceRecipein interfaceServerGamePacketListener
-
handleContainerButtonClick
- Specified by:
handleContainerButtonClickin interfaceServerGamePacketListener
-
handleSetCreativeModeSlot
- Specified by:
handleSetCreativeModeSlotin interfaceServerGamePacketListener
-
handleSignUpdate
- Specified by:
handleSignUpdatein interfaceServerGamePacketListener
-
updateSignText
-
handleKeepAlive
- Specified by:
handleKeepAlivein interfaceServerGamePacketListener
-
handlePlayerAbilities
- Specified by:
handlePlayerAbilitiesin interfaceServerGamePacketListener
-
handleClientInformation
- Specified by:
handleClientInformationin interfaceServerGamePacketListener
-
handleCustomPayload
- Specified by:
handleCustomPayloadin interfaceServerGamePacketListener
-
handleChangeDifficulty
- Specified by:
handleChangeDifficultyin interfaceServerGamePacketListener
-
handleLockDifficulty
- Specified by:
handleLockDifficultyin interfaceServerGamePacketListener
-
handleChatSessionUpdate
- Specified by:
handleChatSessionUpdatein interfaceServerGamePacketListener
-
resetPlayerChatState
-
getPlayer
- Specified by:
getPlayerin interfaceServerPlayerConnection
-