P1Light
)
+//go:generate stringer -trimprefix P1 -type Param1Type
+
type Param2Type uint8
const (
P2ColorFaceDir
P2ColorMounted
P2GlassLikeLevel
+ P2ColorRotation
)
+//go:generate stringer -trimprefix P2 -type Param2Type
+
// A DrawType specifies how a node is drawn.
type DrawType uint8
DrawRootedPlant
)
+//go:generate stringer -trimprefix Draw -type DrawType
+
type WaveType uint8
const (
LiquidWaving // Wave up and down.
)
+//go:generate stringer -type WaveType
+
type LiquidType uint8
const (
LiquidSrc
)
+//go:generate stringer -type LiquidType
+
// AlphaUse specifies how the alpha channel of a texture is used.
type AlphaUse uint8
Legacy
)
+//go:generate stringer -type AlphaUse
+
type NodeDef struct {
Param0 Content
AlphaUse
+ MoveResistance uint8
+
+ LiquidMovePhysics bool
+
//mt:end
}
+
+func BuiltinNodeDefs(n int) map[Content]NodeDef {
+ defs := make(map[Content]NodeDef, 3+n)
+ defs[Unknown] = NodeDef{
+ Name: "unknown",
+ }
+ defs[Air] = NodeDef{
+ Name: "air",
+ DrawType: DrawNothing,
+ P1Type: P1Light,
+ Translucent: true,
+ Transparent: true,
+ Replaceable: true,
+ Floodable: true,
+ GndContent: true,
+ }
+ defs[Ignore] = NodeDef{
+ Name: "ignore",
+ DrawType: DrawNothing,
+ Replaceable: true,
+ GndContent: true,
+ }
+ return defs
+}