core

package
v0.0.0-...-18e7427 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EyePos = 1.62
View Source
var EyePosVec = maths.Vec3d{Y: 1.62}

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Left, Right, Forward, Back  float64
	LeftImpulse, ForwardImpulse float64
	Jump, Sneak, Sprint, Drop   bool
}

func (*Controller) Reset

func (c *Controller) Reset()

type Entity

type Entity interface {
	GetName() string
	GetDisplayName() string
	GetType() entity.TypeEntity
	GetID() int32
	GetUUID() uuid.UUID
	GetPosition() maths.Vec3d
	GetEyePosition() maths.Vec3d
	GetRotation() maths.Vec2d
	GetMotion() maths.Vec3d
	GetBoundingBox() maths.AxisAlignedBB
	GetWidth() float64
	GetHeight() float64
	GetDataManager() map[int32]interface{}
	IsLivingEntity() bool
	IsPlayer() bool
	SetPosition(x, y, z float64)
	SetRotation(yaw, pitch float64)
	SetMotion(x, y, z float64)
	SetSize(width, height float64)
	Equals(other entity.TypeEntity) bool
	IsPassenger() bool
	IsVehicle() bool
	GetPassengers() []Entity
}

type EntityLiving

type EntityLiving struct {
	*UnaliveEntity
	Health                  float32
	MinHealth               float32
	MaxHealth               float32
	Food                    int32
	MaxFood                 int32
	Saturation              float32
	Absorption              float32
	ActiveItem              *item.Item
	ActiveItemStackUseCount int32
	ActivePotionEffects     map[int32]effects.EffectStatus
	OnGround                bool
	LastOnGround            bool
	MoveStrafing            float32
	MoveForward             float32
	MoveVertical            float32
}

func NewEntityLiving

func NewEntityLiving(id int32, uuid uuid.UUID, t int32, x, y, z float64, yaw, pitch float64) *EntityLiving

func (*EntityLiving) GetDisplayName

func (e *EntityLiving) GetDisplayName() string

func (*EntityLiving) GetEyePos

func (e *EntityLiving) GetEyePos() maths.Vec3d

func (*EntityLiving) GetHealth

func (e *EntityLiving) GetHealth(absorption bool) float32

func (*EntityLiving) GetName

func (e *EntityLiving) GetName() string

func (*EntityLiving) GetPotionEffect

func (e *EntityLiving) GetPotionEffect(effect effects.Effect) effects.EffectStatus

func (*EntityLiving) IsDead

func (e *EntityLiving) IsDead() bool

func (*EntityLiving) IsLivingEntity

func (e *EntityLiving) IsLivingEntity() bool

func (*EntityLiving) IsPotionActive

func (e *EntityLiving) IsPotionActive(effect effects.Effect) bool

func (*EntityLiving) SetHealth

func (e *EntityLiving) SetHealth(health float32) bool

type EntityPlayer

type EntityPlayer struct {
	*EntityLiving
	Username string
}

func NewEntityPlayer

func NewEntityPlayer(displayName string, id int32, uuid uuid.UUID, t int32, x, y, z float64, yaw, pitch float64) *EntityPlayer

func (*EntityPlayer) GetDisplayName

func (e *EntityPlayer) GetDisplayName() string

func (*EntityPlayer) GetName

func (e *EntityPlayer) GetName() string

func (*EntityPlayer) IsPlayer

func (e *EntityPlayer) IsPlayer() bool

type PlayerEntry

type PlayerEntry struct {
	UUID        uuid.UUID
	Name        string
	Properties  []pk.Property
	Gamemode    int32
	Ping        int32
	DisplayName pk.Optional[chat.Message, *chat.Message]
}

func (*PlayerEntry) ReadFrom

func (p *PlayerEntry) ReadFrom(r io.Reader) (int64, error)

type PlayerList

type PlayerList struct {
	Players map[uuid.UUID]PlayerEntry
}

func NewPlayerList

func NewPlayerList() *PlayerList

func (*PlayerList) AddPlayers

func (p *PlayerList) AddPlayers(players []PlayerEntry)

func (*PlayerList) GetPlayer

func (p *PlayerList) GetPlayer(uuid uuid.UUID) PlayerEntry

func (*PlayerList) ReadFrom

func (p *PlayerList) ReadFrom(r io.Reader) (int64, error)

func (*PlayerList) RemovePlayers

func (p *PlayerList) RemovePlayers(uuids []pk.UUID)

func (*PlayerList) UpdateDisplayName

func (p *PlayerList) UpdateDisplayName(uuid uuid.UUID, displayName pk.Optional[chat.Message, *chat.Message])

func (*PlayerList) UpdateGamemode

func (p *PlayerList) UpdateGamemode(uuid uuid.UUID, gamemode int32)

func (*PlayerList) UpdatePing

func (p *PlayerList) UpdatePing(uuid uuid.UUID, ping int32)

type UnaliveEntity

type UnaliveEntity struct {
	Type          entity.TypeEntity
	ID            int32
	UUID          uuid.UUID
	Position      maths.Vec3d
	LastPosition  maths.Vec3d
	Rotation      maths.Vec2d
	LastRotation  maths.Vec2d
	Motion        maths.Vec3d
	BoundingBox   maths.AxisAlignedBB
	Width, Height float64
	Vehicle       Entity
	Passengers    []Entity
	// contains filtered or unexported fields
}

func NewEntity

func NewEntity(id int32, uuid uuid.UUID, t int32, x, y, z float64, yaw, pitch float64) *UnaliveEntity

func (*UnaliveEntity) Equals

func (e *UnaliveEntity) Equals(other entity.TypeEntity) bool

func (*UnaliveEntity) GetBoundingBox

func (e *UnaliveEntity) GetBoundingBox() maths.AxisAlignedBB

func (*UnaliveEntity) GetDataManager

func (e *UnaliveEntity) GetDataManager() map[int32]interface{}

func (*UnaliveEntity) GetDisplayName

func (e *UnaliveEntity) GetDisplayName() string

func (*UnaliveEntity) GetEyePosition

func (e *UnaliveEntity) GetEyePosition() maths.Vec3d

func (*UnaliveEntity) GetHeight

func (e *UnaliveEntity) GetHeight() float64

func (*UnaliveEntity) GetID

func (e *UnaliveEntity) GetID() int32

func (*UnaliveEntity) GetMotion

func (e *UnaliveEntity) GetMotion() maths.Vec3d

func (*UnaliveEntity) GetName

func (e *UnaliveEntity) GetName() string

func (*UnaliveEntity) GetPassengers

func (e *UnaliveEntity) GetPassengers() []Entity

func (*UnaliveEntity) GetPosition

func (e *UnaliveEntity) GetPosition() maths.Vec3d

func (*UnaliveEntity) GetRotation

func (e *UnaliveEntity) GetRotation() maths.Vec2d

func (*UnaliveEntity) GetType

func (e *UnaliveEntity) GetType() entity.TypeEntity

func (*UnaliveEntity) GetUUID

func (e *UnaliveEntity) GetUUID() uuid.UUID

func (*UnaliveEntity) GetWidth

func (e *UnaliveEntity) GetWidth() float64

func (*UnaliveEntity) IsLivingEntity

func (e *UnaliveEntity) IsLivingEntity() bool

func (*UnaliveEntity) IsPassenger

func (e *UnaliveEntity) IsPassenger() bool

func (*UnaliveEntity) IsPlayer

func (e *UnaliveEntity) IsPlayer() bool

func (*UnaliveEntity) IsVehicle

func (e *UnaliveEntity) IsVehicle() bool

func (*UnaliveEntity) SetMotion

func (e *UnaliveEntity) SetMotion(x, y, z float64)

func (*UnaliveEntity) SetPosition

func (e *UnaliveEntity) SetPosition(x, y, z float64)

func (*UnaliveEntity) SetRelativePosition

func (e *UnaliveEntity) SetRelativePosition(x, y, z float64)

func (*UnaliveEntity) SetRelativeRotation

func (e *UnaliveEntity) SetRelativeRotation(yaw, pitch float64)

func (*UnaliveEntity) SetRotation

func (e *UnaliveEntity) SetRotation(yaw, pitch float64)

func (*UnaliveEntity) SetSize

func (e *UnaliveEntity) SetSize(width, height float64)

Jump to

Keyboard shortcuts

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