player

package
v0.0.0-...-566b5d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2011 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StanceNormal = 1.62
	MaxHealth    = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Player

type Player struct {
	// These entities should be unchanged through a single login
	EntityId
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(entityId EntityId, shardConnecter gamerules.IShardConnecter, conn net.Conn, name string, spawnBlock BlockXyz, onDisconnect chan<- EntityId, game gamerules.IGame) *Player

func (*Player) Client

func (player *Player) Client() gamerules.IPlayerClient

func (*Player) Enqueue

func (player *Player) Enqueue(f func(*Player))

Enqueue queues a function to run with the player lock within the player's mainloop.

func (*Player) Look

func (player *Player) Look() LookDegrees

func (*Player) Name

func (player *Player) Name() string

func (*Player) PacketChatMessage

func (player *Player) PacketChatMessage(message string)

func (*Player) PacketDisconnect

func (player *Player) PacketDisconnect(reason string)

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 *Player) PacketKeepAlive()

func (*Player) PacketPlayer

func (player *Player) PacketPlayer(onGround bool)

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 *Player) PacketPlayerLook(look *LookDegrees, onGround bool)

func (*Player) PacketPlayerPosition

func (player *Player) PacketPlayerPosition(position *AbsXyz, stance AbsCoord, onGround bool)

func (*Player) PacketRespawn

func (player *Player) PacketRespawn(dimension DimensionId)

func (*Player) PacketSignUpdate

func (player *Player) PacketSignUpdate(position *BlockXyz, lines [4]string)

func (*Player) PacketUnknown0x1b

func (player *Player) PacketUnknown0x1b(field1, field2 float32, field3, field4 bool, field5, field6 float32)

func (*Player) PacketUnknown0x3d

func (player *Player) PacketUnknown0x3d(field1, field2 int32, field3 int8, field4, field5 int32)

func (*Player) PacketUseEntity

func (player *Player) PacketUseEntity(user EntityId, target EntityId, leftClick bool)

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 *Player) PacketWindowTransaction(windowId WindowId, txId TxId, accepted bool)

func (*Player) Position

func (player *Player) Position() AbsXyz

func (*Player) ReadNbt

func (player *Player) ReadNbt(playerData nbt.ITag) (err os.Error)

ReadNbt reads the player data from their persistently stored NBT data. It must only be called before Player.Start().

func (*Player) SetPosition

func (player *Player) SetPosition(pos AbsXyz)

func (*Player) Start

func (player *Player) Start()

func (*Player) TransmitPacket

func (player *Player) TransmitPacket(packet []byte)

func (*Player) WriteNbt

func (player *Player) WriteNbt() *nbt.Compound

Serialize the player data to an Nbt tag so it can be written to file

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL