entity

package
v0.0.0-...-f33b5a6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandLeft  = 0
	HandRight = 1
)

Variables

This section is empty.

Functions

func GetEntityTypeByName

func GetEntityTypeByName(name string)

Types

type Entity

type Entity struct {
	// the entity type info
	Type *Type

	// Identifiers
	// per-runtime
	EID int32
	// persistent
	UUID uuid.UUID

	// the entity position
	Moved           bool
	Rotated         bool
	OnGroundChanged bool

	PrevPosition math.Point
	Position     math.Point
	// TODO: PositionDelta
	Velocity            math.Point
	Yaw, Pitch, HeadYaw minecraft.Angle
	OnGround            bool

	// flags
	OnFire    bool
	Sprinting bool
	Invisible bool
	Glowing   bool
	Pose      minecraft.Pose

	// The metadata of the entity
	// has changed
	MetadataChanged bool

	// The entity equipment
	Equipment        [6]*play.Slot
	EquipmentChanged int

	// The animation to play
	Animation byte
	// contains filtered or unexported fields
}

func (*Entity) Bounds

func (e *Entity) Bounds() *math.Rect

func (*Entity) GetEntity

func (e *Entity) GetEntity() *Entity

func (*Entity) GetFacing

func (e *Entity) GetFacing() minecraft.Face

func (*Entity) UpdateBounds

func (e *Entity) UpdateBounds()

func (*Entity) WriteMetadata

func (e *Entity) WriteMetadata(writer *minecraft.EntityMetadataWriter)

type IEntity

type IEntity interface {
	math.Spatial
	GetEntity() *Entity
	UpdateBounds()
}

type Living

type Living struct {
	Entity

	// active hand
	IsHandActive  bool
	OffhandActive bool
}

func (*Living) GetEntity

func (p *Living) GetEntity() *Entity

func (*Living) WriteMetadata

func (p *Living) WriteMetadata(writer *minecraft.EntityMetadataWriter)

type Player

type Player struct {
	Living

	// username of the player
	Username string

	// visual
	SkinMask byte
	MainHand byte

	// Action related
	Flying bool

	// The stats of the player
	Health float32
	Food   float32
}

func NewPlayer

func NewPlayer(username string, uuid uuid.UUID) *Player

func (*Player) WriteMetadata

func (p *Player) WriteMetadata(writer *minecraft.EntityMetadataWriter)

type Type

type Type struct {
	Id     int
	Name   string
	Width  float64
	Height float64
}

Jump to

Keyboard shortcuts

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