Skip to content

atl/sm/item

import "atl/sm/item"

sm.item: static information about item and shape uuids.

func IsBlock(u sm.Uuid) bool
func IsPart(u sm.Uuid) bool
func IsTool(u sm.Uuid) bool
func IsJoint(u sm.Uuid) bool
func IsHarvestablePart(u sm.Uuid) bool

What kind of item a uuid is.

func IsFlammable(u sm.Uuid) bool

True if the item can burn.

func Title(u sm.Uuid) string
func Description(u sm.Uuid) string

The item's display name and description.

func StackSize(u sm.Uuid) int

How many fit in one inventory slot.

func QualityLevel(u sm.Uuid) int

The item's quality level.

func Material(u sm.Uuid) string
func MaterialID(u sm.Uuid) int

The physics material name and id.

func Size(u sm.Uuid) sm.Vec3

Size in blocks (the part's bounding box).

func Offset(u sm.Uuid) sm.Vec3

Offset of the part's origin within its bounding box.

func DefaultColor(u sm.Uuid) sm.Color

The color the item has when first placed.

func Rotation(u sm.Uuid, rotationIndex int) sm.Quat

The rotation for one of the part's rotation-set indices.

func FeatureData(u sm.Uuid) atl.Value
func Edible(u sm.Uuid) atl.Value
func Plantable(u sm.Uuid) atl.Value

Raw definition tables; nil when the item has no such feature.

func InteractablesOfType(typ string) []sm.Uuid

Every interactable item of a type, e.g. "chest", "engine", "seat".

func Plantables() []sm.Uuid

Every item that can be planted.

func IsMultiShape(u sm.Uuid) bool

True for an item made of several shapes.

func AddTracked(u sm.Uuid, typ int)
func RemoveTracked(u sm.Uuid, typ int)

[client] Starts / stops tracking placement and use of an item (typ is sm.item's tracking type).

type Ratings struct {
Density, Durability, Friction, Buoyancy int
}

The 1 to 10 ratings shown in the inventory.

func RatingsOf(u sm.Uuid) Ratings

Reads all four ratings of an item.

type CharacterShape struct {
CharacterUuid sm.Uuid
PlacementSphereRadius float64
}

The character a "character shape" item places.

func CharacterShapeOf(u sm.Uuid) CharacterShape

Reads an item's character shape; empty if it has none.