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) Position() AbsXyz
- func (player *Player) Run()
- func (player *Player) SendPacket(packet proto.IPacket)
- 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) GetProtoSlots(slots proto.ItemSlotSlice)
- func (inv *RemoteInventory) IsForBlock(block *BlockXyz) bool
- func (inv *RemoteInventory) NumSlots() SlotId
- func (inv *RemoteInventory) SetSubscriber(subscriber gamerules.IInventorySubscriber)
Constants ¶
View Source
const ( StanceNormal = AbsCoord(1.62) MaxHealth = Health(20) MaxFoodUnits = FoodUnits(20) PingTimeout = 60 * time.Second // Player connection times out after 60 seconds. PingInterval = 20 * time.Second // 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) MarshalNbt ¶
MarshalNbt packs the player data into a nbt.Compound so it can be written to persistant storage.
func (*Player) SendPacket ¶
SendPacket sends the given packet to the player's client. This must be called from the player main loop.
func (*Player) SetPosition ¶
func (player *Player) SetPosition(pos AbsXyz)
func (*Player) TransmitPacket ¶
TransmitPacket sends the given bytes to the player's client. This may be called from any goroutine.
type RemoteInventory ¶
type RemoteInventory struct {
// contains filtered or unexported fields
}
func NewRemoteInventory ¶
func NewRemoteInventory(block *BlockXyz, chunkSubs *chunkSubscriptions, slots proto.ItemSlotSlice) *RemoteInventory
func (*RemoteInventory) Click ¶
func (inv *RemoteInventory) Click(click *gamerules.Click) (txState TxState)
func (*RemoteInventory) Close ¶
func (inv *RemoteInventory) Close()
func (*RemoteInventory) GetProtoSlots ¶
func (inv *RemoteInventory) GetProtoSlots(slots proto.ItemSlotSlice)
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)
Click to show internal directories.
Click to hide internal directories.