block

package
v0.0.0-...-b8cd253 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AirID        = "core:air"
	GrassBlockID = "core:grass_block"
	DirtID       = "core:dirt"
	StoneID      = "core:stone"
	SandID       = "core:sand"
	WoodID       = "core:wood"
	LeavesID     = "core:leaves"
	GrassID      = "core:grass"
	DandelionID  = "core:dandelion"
	CloudID      = "core:cloud"
)

Variables

This section is empty.

Functions

func AddBlock

func AddBlock(block *Block) error

func BlockData

func BlockData(vertices []float32, show Side, block Vec3, tex *texture.BlockTexture) []float32

func InitRegister

func InitRegister()

func LoadBlocks

func LoadBlocks()

func PlantData

func PlantData(vertices []float32, _ Side, block Vec3, tex *texture.BlockTexture) []float32

func RangeBlocks

func RangeBlocks(rangeFunc func(block *Block) bool)

Types

type Block

type Block struct {
	ID          string
	Breakable   bool    `json:"breakable,omitempty"`
	Durability  float32 `json:"durability,omitempty"`
	Hardness    float32 `json:"hardness,omitempty"`
	Liquid      bool    `json:"liquid,omitempty"`
	Material    string  `json:"material,omitempty"`
	Strength    float32 `json:"strength,omitempty"`
	StepSound   string  `json:"stepSound,omitempty"`
	Transparent bool    `json:"transparent,omitempty"`
	Visible     bool    `json:"visible,omitempty"`
	Obstacle    bool    `json:"obstacle,omitempty"`
	Plant       bool    `json:"plant,omitempty"`
}

func GetBlock

func GetBlock(id string) (block *Block)

func NewBlock

func NewBlock(id string) *Block

type Side

type Side struct {
	Left, Right,
	Up, Down,
	Front, Back bool
}

func Sides

func Sides(left, right, up, down, front, back bool) Side

Jump to

Keyboard shortcuts

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