Class FakePlayer.FakePlayerNetHandler
java.lang.Object
net.minecraft.server.network.ServerCommonPacketListenerImpl
net.minecraft.server.network.ServerGamePacketListenerImpl
net.neoforged.neoforge.common.util.FakePlayer.FakePlayerNetHandler
- All Implemented Interfaces:
PacketListener,ServerCommonPacketListener,ServerCookiePacketListener,GameProtocols.Context,ServerGamePacketListener,ServerPacketListener,ServerPingPacketListener,ServerboundPacketListener,TickablePacketListener,ServerPlayerConnection,ICommonPacketListener,IServerCommonPacketListenerExtension,IServerGamePacketListenerExtension
- Enclosing class:
FakePlayer
@ParametersAreNonnullByDefault
private static class FakePlayer.FakePlayerNetHandler
extends ServerGamePacketListenerImpl
-
Field Summary
FieldsFields inherited from class net.minecraft.server.network.ServerGamePacketListenerImpl
chunkSender, playerFields inherited from class net.minecraft.server.network.ServerCommonPacketListenerImpl
connection, connectionType, LATENCY_CHECK_INTERVAL, server -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidackBlockChangesUpTo(int sequence) voiddisconnect(Component message) Triggers a disconnection with the given reason.voidvoidhandleAnimate(ServerboundSwingPacket packet) voidvoidvoidhandleChat(ServerboundChatPacket packet) Process chat messages (broadcast back to clients) and commands (executes)voidvoidvoidvoidProcesses the client status updates: respawn attempt from player, opening statistics or achievements, or acquiring 'open inventory' achievementvoidvoidEnchants the item identified by the packet given some convoluted conditions (matching window, which should/shouldn't be in use?)voidExecutes a container/inventory slot manipulation as indicated by the packet.voidProcesses the client closing windows (container)voidThis method is only called for manual tab-completion (theminecraft:ask_serversuggestion provider).voidvoidvoidvoidProcesses left and right clicks on entitiesvoidvoidhandleKeepAlive(ServerboundKeepAlivePacket p_294627_) voidvoidProcesses clients perspective on player positioning and/or orientationvoidvoidvoidvoidProcesses a player starting/stopping flyingvoidProcesses the player initiating/stopping digging on a particular spot, as well as a player dropping itemsvoidProcesses a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump height of the horse the player is ridingvoidProcesses player movement input.voidvoidvoidvoidvoidvoidvoidvoidUpdates which quickbar slot is selectedvoidvoidvoidUpdate the server with an ItemStack in a slot.voidvoidvoidvoidvoidCalled when a client is using an item while not pointing at a block, but simply using an itemvoidvoidonDisconnect(DisconnectionDetails details) voidvoidSends a packet to the target of this listener.voidSends a packet to the client of this listener.voidsendDisguisedChatMessage(Component content, ChatType.Bound boundChatType) voidsendPlayerChatMessage(PlayerChatMessage message, ChatType.Bound boundChatType) voidteleport(double x, double y, double z, float yaw, float pitch) voidteleport(PositionMoveRotation posMoveRot, Set<Relative> relatives) voidtick()Methods inherited from class net.minecraft.server.network.ServerGamePacketListenerImpl
getPlayer, getRemoteAddress, handleAcceptPlayerLoad, handleBundleItemSelectedPacket, handleChangeGameMode, handleChunkBatchReceived, handleClientTickEnd, handleConfigurationAcknowledged, handleContainerSlotStateChanged, handleDebugSubscriptionRequest, handlePickItemFromBlock, handlePickItemFromEntity, handlePingRequest, handleSetTestBlock, handleSignedChatCommand, handleTestInstanceBlockAction, hasInfiniteMaterials, isAcceptingMessages, playerProfile, shouldHandleMessage, switchToConfigMethods inherited from class net.minecraft.server.network.ServerCommonPacketListenerImpl
createCookie, createCookie, disconnect, getConnection, getConnectionType, getOwner, getPacketProcessor, handleCookieResponse, handleCustomClickAction, handlePong, isSingleplayerOwner, keepConnectionAlive, latency, onPacketError, resumeFlushing, suspendFlushingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.ICommonPacketListener
getConnection, getConnectionType, getPacketProcessor, hasChannel, hasChannel, hasChannelMethods inherited from interface net.neoforged.neoforge.common.extensions.IServerCommonPacketListenerExtension
send, sendMethods inherited from interface net.neoforged.neoforge.common.extensions.IServerGamePacketListenerExtension
sendBundled, sendBundledMethods inherited from interface net.minecraft.network.PacketListener
createDisconnectionInfo, fillCrashReport, fillListenerSpecificCrashDetailsMethods inherited from interface net.minecraft.network.ServerboundPacketListener
flowMethods inherited from interface net.minecraft.network.protocol.common.ServerCommonPacketListener
handleCustomClickAction, handlePongMethods inherited from interface net.minecraft.network.protocol.cookie.ServerCookiePacketListener
handleCookieResponseMethods inherited from interface net.minecraft.network.protocol.game.ServerGamePacketListener
protocolMethods inherited from interface net.minecraft.network.protocol.game.ServerPacketListener
onPacketError
-
Field Details
-
DUMMY_CONNECTION
-
-
Constructor Details
-
FakePlayerNetHandler
-
-
Method Details
-
tick
public void tick()- Specified by:
tickin interfaceTickablePacketListener- Overrides:
tickin classServerGamePacketListenerImpl
-
resetPosition
public void resetPosition()- Overrides:
resetPositionin classServerGamePacketListenerImpl
-
disconnect
Description copied from interface:ICommonPacketListenerTriggers a disconnection with the given reason.- Specified by:
disconnectin interfaceICommonPacketListener- Overrides:
disconnectin classServerCommonPacketListenerImpl- Parameters:
message- The reason for the disconnection
-
handlePlayerInput
Description copied from class:ServerGamePacketListenerImplProcesses player movement input. Includes walking, strafing, jumping, and sneaking. Excludes riding and toggling flying/sprinting.- Specified by:
handlePlayerInputin interfaceServerGamePacketListener- Overrides:
handlePlayerInputin classServerGamePacketListenerImpl
-
handleMoveVehicle
- Specified by:
handleMoveVehiclein interfaceServerGamePacketListener- Overrides:
handleMoveVehiclein classServerGamePacketListenerImpl
-
handleAcceptTeleportPacket
- Specified by:
handleAcceptTeleportPacketin interfaceServerGamePacketListener- Overrides:
handleAcceptTeleportPacketin classServerGamePacketListenerImpl
-
handleRecipeBookSeenRecipePacket
- Specified by:
handleRecipeBookSeenRecipePacketin interfaceServerGamePacketListener- Overrides:
handleRecipeBookSeenRecipePacketin classServerGamePacketListenerImpl
-
handleRecipeBookChangeSettingsPacket
- Specified by:
handleRecipeBookChangeSettingsPacketin interfaceServerGamePacketListener- Overrides:
handleRecipeBookChangeSettingsPacketin classServerGamePacketListenerImpl
-
handleSeenAdvancements
- Specified by:
handleSeenAdvancementsin interfaceServerGamePacketListener- Overrides:
handleSeenAdvancementsin classServerGamePacketListenerImpl
-
handleCustomCommandSuggestions
Description copied from class:ServerGamePacketListenerImplThis method is only called for manual tab-completion (theminecraft:ask_serversuggestion provider).- Specified by:
handleCustomCommandSuggestionsin interfaceServerGamePacketListener- Overrides:
handleCustomCommandSuggestionsin classServerGamePacketListenerImpl
-
handleSetCommandBlock
- Specified by:
handleSetCommandBlockin interfaceServerGamePacketListener- Overrides:
handleSetCommandBlockin classServerGamePacketListenerImpl
-
handleSetCommandMinecart
- Specified by:
handleSetCommandMinecartin interfaceServerGamePacketListener- Overrides:
handleSetCommandMinecartin classServerGamePacketListenerImpl
-
handleRenameItem
- Specified by:
handleRenameItemin interfaceServerGamePacketListener- Overrides:
handleRenameItemin classServerGamePacketListenerImpl
-
handleSetBeaconPacket
- Specified by:
handleSetBeaconPacketin interfaceServerGamePacketListener- Overrides:
handleSetBeaconPacketin classServerGamePacketListenerImpl
-
handleSetStructureBlock
- Specified by:
handleSetStructureBlockin interfaceServerGamePacketListener- Overrides:
handleSetStructureBlockin classServerGamePacketListenerImpl
-
handleSetJigsawBlock
- Specified by:
handleSetJigsawBlockin interfaceServerGamePacketListener- Overrides:
handleSetJigsawBlockin classServerGamePacketListenerImpl
-
handleJigsawGenerate
- Specified by:
handleJigsawGeneratein interfaceServerGamePacketListener- Overrides:
handleJigsawGeneratein classServerGamePacketListenerImpl
-
handleSelectTrade
- Specified by:
handleSelectTradein interfaceServerGamePacketListener- Overrides:
handleSelectTradein classServerGamePacketListenerImpl
-
handleEditBook
- Specified by:
handleEditBookin interfaceServerGamePacketListener- Overrides:
handleEditBookin classServerGamePacketListenerImpl
-
handleEntityTagQuery
- Specified by:
handleEntityTagQueryin interfaceServerGamePacketListener- Overrides:
handleEntityTagQueryin classServerGamePacketListenerImpl
-
handleBlockEntityTagQuery
- Specified by:
handleBlockEntityTagQueryin interfaceServerGamePacketListener- Overrides:
handleBlockEntityTagQueryin classServerGamePacketListenerImpl
-
handleMovePlayer
Description copied from class:ServerGamePacketListenerImplProcesses clients perspective on player positioning and/or orientation- Specified by:
handleMovePlayerin interfaceServerGamePacketListener- Overrides:
handleMovePlayerin classServerGamePacketListenerImpl
-
teleport
public void teleport(double x, double y, double z, float yaw, float pitch) - Overrides:
teleportin classServerGamePacketListenerImpl
-
handlePlayerAction
Description copied from class:ServerGamePacketListenerImplProcesses the player initiating/stopping digging on a particular spot, as well as a player dropping items- Specified by:
handlePlayerActionin interfaceServerGamePacketListener- Overrides:
handlePlayerActionin classServerGamePacketListenerImpl
-
handleUseItemOn
- Specified by:
handleUseItemOnin interfaceServerGamePacketListener- Overrides:
handleUseItemOnin classServerGamePacketListenerImpl
-
handleUseItem
Description copied from class:ServerGamePacketListenerImplCalled when a client is using an item while not pointing at a block, but simply using an item- Specified by:
handleUseItemin interfaceServerGamePacketListener- Overrides:
handleUseItemin classServerGamePacketListenerImpl
-
handleTeleportToEntityPacket
- Specified by:
handleTeleportToEntityPacketin interfaceServerGamePacketListener- Overrides:
handleTeleportToEntityPacketin classServerGamePacketListenerImpl
-
handleResourcePackResponse
- Specified by:
handleResourcePackResponsein interfaceServerCommonPacketListener- Overrides:
handleResourcePackResponsein classServerCommonPacketListenerImpl
-
handlePaddleBoat
- Specified by:
handlePaddleBoatin interfaceServerGamePacketListener- Overrides:
handlePaddleBoatin classServerGamePacketListenerImpl
-
onDisconnect
- Specified by:
onDisconnectin interfacePacketListener- Overrides:
onDisconnectin classServerGamePacketListenerImpl
-
send
Description copied from interface:ICommonPacketListenerSends a packet to the target of this listener.- Specified by:
sendin interfaceICommonPacketListener- Specified by:
sendin interfaceServerPlayerConnection- Overrides:
sendin classServerCommonPacketListenerImpl
-
send
public void send(Packet<?> packet, @Nullable @Nullable io.netty.channel.ChannelFutureListener sendListener) Description copied from interface:IServerCommonPacketListenerExtensionSends a packet to the client of this listener.- Specified by:
sendin interfaceIServerCommonPacketListenerExtension- Overrides:
sendin classServerCommonPacketListenerImpl- Parameters:
sendListener- An optional callback for when the payload is sent
-
handleSetCarriedItem
Description copied from class:ServerGamePacketListenerImplUpdates which quickbar slot is selected- Specified by:
handleSetCarriedItemin interfaceServerGamePacketListener- Overrides:
handleSetCarriedItemin classServerGamePacketListenerImpl
-
handleChat
Description copied from class:ServerGamePacketListenerImplProcess chat messages (broadcast back to clients) and commands (executes)- Specified by:
handleChatin interfaceServerGamePacketListener- Overrides:
handleChatin classServerGamePacketListenerImpl
-
handleAnimate
- Specified by:
handleAnimatein interfaceServerGamePacketListener- Overrides:
handleAnimatein classServerGamePacketListenerImpl
-
handlePlayerCommand
Description copied from class:ServerGamePacketListenerImplProcesses a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump height of the horse the player is riding- Specified by:
handlePlayerCommandin interfaceServerGamePacketListener- Overrides:
handlePlayerCommandin classServerGamePacketListenerImpl
-
handleInteract
Description copied from class:ServerGamePacketListenerImplProcesses left and right clicks on entities- Specified by:
handleInteractin interfaceServerGamePacketListener- Overrides:
handleInteractin classServerGamePacketListenerImpl
-
handleClientCommand
Description copied from class:ServerGamePacketListenerImplProcesses the client status updates: respawn attempt from player, opening statistics or achievements, or acquiring 'open inventory' achievement- Specified by:
handleClientCommandin interfaceServerGamePacketListener- Overrides:
handleClientCommandin classServerGamePacketListenerImpl
-
handleContainerClose
Description copied from class:ServerGamePacketListenerImplProcesses the client closing windows (container)- Specified by:
handleContainerClosein interfaceServerGamePacketListener- Overrides:
handleContainerClosein classServerGamePacketListenerImpl
-
handleContainerClick
Description copied from class:ServerGamePacketListenerImplExecutes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they didn't match the indicated result and prevents further manipulation by the player until he confirms that it has the same open container/inventory- Specified by:
handleContainerClickin interfaceServerGamePacketListener- Overrides:
handleContainerClickin classServerGamePacketListenerImpl
-
handlePlaceRecipe
- Specified by:
handlePlaceRecipein interfaceServerGamePacketListener- Overrides:
handlePlaceRecipein classServerGamePacketListenerImpl
-
handleContainerButtonClick
Description copied from class:ServerGamePacketListenerImplEnchants the item identified by the packet given some convoluted conditions (matching window, which should/shouldn't be in use?)- Specified by:
handleContainerButtonClickin interfaceServerGamePacketListener- Overrides:
handleContainerButtonClickin classServerGamePacketListenerImpl
-
handleSetCreativeModeSlot
Description copied from class:ServerGamePacketListenerImplUpdate the server with an ItemStack in a slot.- Specified by:
handleSetCreativeModeSlotin interfaceServerGamePacketListener- Overrides:
handleSetCreativeModeSlotin classServerGamePacketListenerImpl
-
handleSignUpdate
- Specified by:
handleSignUpdatein interfaceServerGamePacketListener- Overrides:
handleSignUpdatein classServerGamePacketListenerImpl
-
handleKeepAlive
- Specified by:
handleKeepAlivein interfaceServerCommonPacketListener- Overrides:
handleKeepAlivein classServerCommonPacketListenerImpl
-
handleCustomPayload
- Specified by:
handleCustomPayloadin interfaceServerCommonPacketListener- Overrides:
handleCustomPayloadin classServerGamePacketListenerImpl
-
handleClientInformation
- Specified by:
handleClientInformationin interfaceServerCommonPacketListener- Overrides:
handleClientInformationin classServerGamePacketListenerImpl
-
handlePlayerAbilities
Description copied from class:ServerGamePacketListenerImplProcesses a player starting/stopping flying- Specified by:
handlePlayerAbilitiesin interfaceServerGamePacketListener- Overrides:
handlePlayerAbilitiesin classServerGamePacketListenerImpl
-
handleChangeDifficulty
- Specified by:
handleChangeDifficultyin interfaceServerGamePacketListener- Overrides:
handleChangeDifficultyin classServerGamePacketListenerImpl
-
handleLockDifficulty
- Specified by:
handleLockDifficultyin interfaceServerGamePacketListener- Overrides:
handleLockDifficultyin classServerGamePacketListenerImpl
-
teleport
- Overrides:
teleportin classServerGamePacketListenerImpl
-
ackBlockChangesUpTo
public void ackBlockChangesUpTo(int sequence) - Overrides:
ackBlockChangesUpToin classServerGamePacketListenerImpl
-
handleChatCommand
- Specified by:
handleChatCommandin interfaceServerGamePacketListener- Overrides:
handleChatCommandin classServerGamePacketListenerImpl
-
handleChatAck
- Specified by:
handleChatAckin interfaceServerGamePacketListener- Overrides:
handleChatAckin classServerGamePacketListenerImpl
-
sendPlayerChatMessage
- Overrides:
sendPlayerChatMessagein classServerGamePacketListenerImpl
-
sendDisguisedChatMessage
- Overrides:
sendDisguisedChatMessagein classServerGamePacketListenerImpl
-
handleChatSessionUpdate
- Specified by:
handleChatSessionUpdatein interfaceServerGamePacketListener- Overrides:
handleChatSessionUpdatein classServerGamePacketListenerImpl
-