gl01/internal/world/blocks/default.go

54 lines
1.8 KiB
Go
Raw Normal View History

2022-01-28 15:24:03 +08:00
package blocks
import "edgaru089.ml/go/gl01/internal/world"
const (
Nil = iota
Debug
DebugDir
DebugNonexist
Stone
Dirt
Grass
Bedrock
Sand
LogOak
LeavesOak
PlanksOak
Water
2022-02-25 17:58:42 +08:00
Glass
2022-01-28 15:24:03 +08:00
Count
)
func init() {
world.RegisterBlockBehaviour(1, world.BlockBehaviourStatic(world.BlockAppearance{Name: "debug"}))
world.RegisterBlockBehaviour(2, world.BlockBehaviourStatic(world.BlockAppearance{Name: "debug_dir", RenderType: world.SixTexture}))
world.RegisterBlockBehaviour(3, world.BlockBehaviourStatic(world.BlockAppearance{Name: "debug_nonexist"}))
world.RegisterBlockBehaviour(4, world.BlockBehaviourStatic(world.BlockAppearance{Name: "stone"}))
world.RegisterBlockBehaviour(5, world.BlockBehaviourStatic(world.BlockAppearance{Name: "dirt"}))
world.RegisterBlockBehaviour(6, world.BlockBehaviourStatic(world.BlockAppearance{Name: "grass", RenderType: world.ThreeTexture}))
world.RegisterBlockBehaviour(7, world.BlockBehaviourStatic(world.BlockAppearance{Name: "bedrock"}))
world.RegisterBlockBehaviour(8, world.BlockBehaviourStatic(world.BlockAppearance{Name: "sand"}))
world.RegisterBlockBehaviour(9, world.BlockBehaviourStatic(world.BlockAppearance{Name: "log_oak", RenderType: world.ThreeTexture}))
2022-02-25 17:58:42 +08:00
world.RegisterBlockBehaviour(10, world.BlockBehaviourStatic(world.BlockAppearance{Name: "leaves_oak", Transparent: true}))
2022-01-28 15:24:03 +08:00
world.RegisterBlockBehaviour(11, world.BlockBehaviourStatic(world.BlockAppearance{Name: "planks_oak"}))
world.RegisterBlockBehaviour(12, WaterBehaviour{})
2022-02-25 17:58:42 +08:00
world.RegisterBlockBehaviour(13, world.BlockBehaviourStatic(world.BlockAppearance{Name: "glass", Transparent: true}))
if Count != 14 {
2022-01-28 15:24:03 +08:00
panic("world.DefaultBlocks: block count not correct (check for block numbering in default_blocks.go)")
}
world.DoneRegisteringBlockBehaviour()
}