Documentation ¶
Index ¶
- Constants
- type Player
- func (player *Player) Client() gamerules.IPlayerClient
- func (player *Player) Enqueue(f func(*Player))
- func (player *Player) Look() LookDegrees
- func (player *Player) MarshalNbt(tag *nbt.Compound) (err error)
- func (player *Player) Name() string
- func (player *Player) PacketChatMessage(message string)
- func (player *Player) PacketDisconnect(reason string)
- func (player *Player) PacketEntityAction(entityId EntityId, action EntityAction)
- func (player *Player) PacketEntityAnimation(entityId EntityId, animation EntityAnimation)
- func (player *Player) PacketHoldingChange(slotId SlotId)
- func (player *Player) PacketKeepAlive(id int32)
- func (player *Player) PacketPlayer(onGround bool)
- func (player *Player) PacketPlayerBlockHit(status DigStatus, target *BlockXyz, face Face)
- func (player *Player) PacketPlayerBlockInteract(itemId ItemTypeId, target *BlockXyz, face Face, amount ItemCount, ...)
- func (player *Player) PacketPlayerLook(look *LookDegrees, onGround bool)
- func (player *Player) PacketPlayerPosition(position *AbsXyz, stance AbsCoord, onGround bool)
- func (player *Player) PacketRespawn(dimension DimensionId, unknown int8, gameType GameType, worldHeight int16, ...)
- func (player *Player) PacketServerHandshake(username string)
- func (player *Player) PacketServerListPing()
- func (player *Player) PacketServerLogin(username string)
- func (player *Player) PacketSignUpdate(position *BlockXyz, lines [4]string)
- func (player *Player) PacketUseEntity(user EntityId, target EntityId, leftClick bool)
- func (player *Player) PacketWindowClick(windowId WindowId, slotId SlotId, rightClick bool, txId TxId, shiftClick bool, ...)
- func (player *Player) PacketWindowClose(windowId WindowId)
- func (player *Player) PacketWindowTransaction(windowId WindowId, txId TxId, accepted bool)
- func (player *Player) Position() AbsXyz
- func (player *Player) Run()
- func (player *Player) SetPosition(pos AbsXyz)
- func (player *Player) Stop()
- func (player *Player) String() string
- func (player *Player) TransmitPacket(packet []byte)
- func (player *Player) UnmarshalNbt(tag *nbt.Compound) (err error)
- type RemoteInventory
- func (inv *RemoteInventory) Click(click *gamerules.Click) (txState TxState)
- func (inv *RemoteInventory) Close()
- func (inv *RemoteInventory) IsForBlock(block *BlockXyz) bool
- func (inv *RemoteInventory) NumSlots() SlotId
- func (inv *RemoteInventory) SetSubscriber(subscriber gamerules.IInventorySubscriber)
- func (inv *RemoteInventory) WriteProtoSlots(slots []proto.WindowSlot)
Constants ¶
View Source
const ( StanceNormal = AbsCoord(1.62) MaxHealth = Health(20) MaxFoodUnits = FoodUnits(20) PingTimeoutNs = 1e9 * 60 // Player connection times out after 60 seconds. PingIntervalNs = 1e9 * 20 // Time between receiving keep alive response from client and sending new request. )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player struct { EntityId // contains filtered or unexported fields }
func (*Player) Client ¶
func (player *Player) Client() gamerules.IPlayerClient
func (*Player) Enqueue ¶
Enqueue queues a function to run with the player lock within the player's mainloop.
func (*Player) MarshalNbt ¶
MarshalNbt packs the player data into a nbt.Compound so it can be written to persistant storage.
func (*Player) PacketChatMessage ¶
func (*Player) PacketDisconnect ¶
func (*Player) PacketEntityAction ¶
func (player *Player) PacketEntityAction(entityId EntityId, action EntityAction)
func (*Player) PacketEntityAnimation ¶
func (player *Player) PacketEntityAnimation(entityId EntityId, animation EntityAnimation)
func (*Player) PacketHoldingChange ¶
func (player *Player) PacketHoldingChange(slotId SlotId)
func (*Player) PacketKeepAlive ¶
func (*Player) PacketPlayer ¶
func (*Player) PacketPlayerBlockHit ¶
func (player *Player) PacketPlayerBlockHit(status DigStatus, target *BlockXyz, face Face)
func (*Player) PacketPlayerBlockInteract ¶
func (player *Player) PacketPlayerBlockInteract(itemId ItemTypeId, target *BlockXyz, face Face, amount ItemCount, uses ItemData)
func (*Player) PacketPlayerLook ¶
func (*Player) PacketPlayerPosition ¶
func (*Player) PacketRespawn ¶
func (*Player) PacketServerHandshake ¶
func (*Player) PacketServerListPing ¶
func (player *Player) PacketServerListPing()
func (*Player) PacketServerLogin ¶
func (*Player) PacketSignUpdate ¶
func (*Player) PacketUseEntity ¶
func (*Player) PacketWindowClick ¶
func (player *Player) PacketWindowClick(windowId WindowId, slotId SlotId, rightClick bool, txId TxId, shiftClick bool, expectedSlot *proto.WindowSlot)
func (*Player) PacketWindowClose ¶
func (player *Player) PacketWindowClose(windowId WindowId)
func (*Player) PacketWindowTransaction ¶
func (*Player) SetPosition ¶
func (player *Player) SetPosition(pos AbsXyz)
func (*Player) TransmitPacket ¶
type RemoteInventory ¶
type RemoteInventory struct {
// contains filtered or unexported fields
}
func NewRemoteInventory ¶
func NewRemoteInventory(block *BlockXyz, chunkSubs *chunkSubscriptions, slots []proto.WindowSlot) *RemoteInventory
func (*RemoteInventory) Click ¶
func (inv *RemoteInventory) Click(click *gamerules.Click) (txState TxState)
func (*RemoteInventory) Close ¶
func (inv *RemoteInventory) Close()
func (*RemoteInventory) IsForBlock ¶
func (inv *RemoteInventory) IsForBlock(block *BlockXyz) bool
func (*RemoteInventory) NumSlots ¶
func (inv *RemoteInventory) NumSlots() SlotId
func (*RemoteInventory) SetSubscriber ¶
func (inv *RemoteInventory) SetSubscriber(subscriber gamerules.IInventorySubscriber)
func (*RemoteInventory) WriteProtoSlots ¶
func (inv *RemoteInventory) WriteProtoSlots(slots []proto.WindowSlot)
Click to show internal directories.
Click to hide internal directories.