Documentation ¶
Index ¶
- func VelocityFromLook(look LookDegrees, speed float64) AbsVelocity
- type IBlockQuerier
- type PointObject
- func (obj *PointObject) Init(position *AbsXyz, velocity *AbsVelocity)
- func (obj *PointObject) MarshalNbt(tag *nbt.Compound) (err error)
- func (obj *PointObject) Position() *AbsXyz
- func (obj *PointObject) SendUpdate(writer io.Writer, entityId EntityId, look *LookBytes) (err error)
- func (obj *PointObject) Tick(blockQuerier IBlockQuerier) (leftChunk bool)
- func (obj *PointObject) UnmarshalNbt(tag *nbt.Compound) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VelocityFromLook ¶
func VelocityFromLook(look LookDegrees, speed float64) AbsVelocity
Create a velocity from a look (yaw and pitch) and a momentum.
Types ¶
type IBlockQuerier ¶
type PointObject ¶
type PointObject struct { // Used in knowing what to send as client updates LastSentPosition AbsIntXyz LastSentVelocity Velocity // contains filtered or unexported fields }
func (*PointObject) Init ¶
func (obj *PointObject) Init(position *AbsXyz, velocity *AbsVelocity)
func (*PointObject) MarshalNbt ¶
func (obj *PointObject) MarshalNbt(tag *nbt.Compound) (err error)
func (*PointObject) Position ¶
func (obj *PointObject) Position() *AbsXyz
func (*PointObject) SendUpdate ¶
func (obj *PointObject) SendUpdate(writer io.Writer, entityId EntityId, look *LookBytes) (err error)
Generates any packets needed to update clients as to the position and velocity of the object. It assumes that the clients have either been sent packets via this method before, or that the previous position/velocity sent was generated from the LastSentPosition and LastSentVelocity attributes.
func (*PointObject) Tick ¶
func (obj *PointObject) Tick(blockQuerier IBlockQuerier) (leftChunk bool)
func (*PointObject) UnmarshalNbt ¶
func (obj *PointObject) UnmarshalNbt(tag *nbt.Compound) (err error)
Click to show internal directories.
Click to hide internal directories.