block

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BreakDuration

func BreakDuration(b world.Block, i item.Stack) time.Duration

BreakDuration returns the base duration that breaking the block passed takes when being broken using the item passed.

func BreaksInstantly

func BreaksInstantly(b world.Block, i item.Stack) bool

BreaksInstantly checks if the block passed can be broken instantly using the item stack passed to break it.

func Parse

func Parse(s string) ([]world.Block, error)

Parse attempts to parse a string passed into a slice of blocks. The string passed is a list of either one or more blocks, separated using a comma. If parsing the string was not successful, the slice returned is nil and an error is returned explaining the reason the string could not be parsed.

Parse parses strings in a rather specific format. The strings accepted may look like the following: "andesite" "andesite,log[wood=oak]" "log,leaves[wood=spruce,persistent=true]" The properties, which are optional, are identical to the fields of the blocks registered, except for being fully lowercase.

Errors returned by Parse are explicitly user-friendly. They are fit to be displayed to the end user supplying the string. noinspection GoErrorStringFormat

Types

type AABBer

type AABBer interface {
	// AABB returns all the axis aligned bounding boxes of the block.
	AABB(pos world.BlockPos, w *world.World) []physics.AABB
}

AABBer represents a block that has one or multiple specific Axis Aligned Bounding Boxes. These boxes are used to calculate collision.

type Activatable

type Activatable interface {
	// Activate activates the block at a specific block position. The face clicked is passed, as well as the
	// world in which the block was activated and the viewer that activated it.
	Activate(pos world.BlockPos, clickedFace world.Face, w *world.World, u item.User)
}

Activatable represents a block that may be activated by a viewer of the world. When activated, the block will execute some specific logic.

type Air

type Air struct{}

Air is the block present in otherwise empty space.

func (Air) AABB

func (Air) AABB(world.BlockPos, *world.World) []physics.AABB

AABB returns an empty Axis Aligned Bounding Box (as nothing can collide with air).

func (Air) CanDisplace

func (Air) CanDisplace(world.Liquid) bool

CanDisplace ...

func (Air) EncodeBlock

func (Air) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Air) EncodeItem

func (Air) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Air) HasLiquidDrops

func (Air) HasLiquidDrops() bool

HasLiquidDrops ...

func (Air) LightDiffusionLevel

func (Air) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Air) ReplaceableBy

func (Air) ReplaceableBy(world.Block) bool

ReplaceableBy always returns true.

type Andesite

type Andesite polishable

Andesite is a type of igneous rock.

func (Andesite) BreakInfo

func (a Andesite) BreakInfo() BreakInfo

BreakInfo ...

func (Andesite) EncodeBlock

func (a Andesite) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Andesite) EncodeItem

func (a Andesite) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Bedrock

type Bedrock struct {
	// InfiniteBurning specifies if the bedrock block is set aflame and will burn forever. This is the case
	// for bedrock found under end crystals on top of the end pillars.
	InfiniteBurning bool
}

Bedrock is a block that is indestructible in survival.

func (Bedrock) EncodeBlock

func (b Bedrock) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Bedrock) EncodeItem

func (Bedrock) EncodeItem() (id int32, meta int16)

EncodeItem ...

type BreakInfo

type BreakInfo struct {
	// Hardness is the hardness of the block, which influences the speed with which the block may be mined.
	Hardness float64
	// Harvestable is a function called to check if the block is harvestable using the tool passed. If the
	// item used to break the block is not a tool, a tool.None is passed.
	Harvestable func(t tool.Tool) bool
	// Effective is a function called to check if the block can be mined more effectively with the tool passed
	// than with an empty hand.
	Effective func(t tool.Tool) bool
	// Drops is a function called to get the drops of the block if it is broken using the tool passed. If the
	// item used to break the block is not a tool, a tool.None is passed.
	Drops func(t tool.Tool) []item.Stack
}

BreakInfo is a struct returned by every block. It holds information on block breaking related data, such as the tool type and tier required to break it.

type Breakable

type Breakable interface {
	// BreakInfo returns information of the block related to the breaking of it.
	BreakInfo() BreakInfo
}

Breakable represents a block that may be broken by a player in survival mode. Blocks not include are blocks such as bedrock.

type Chest

type Chest struct {
	// Facing is the direction that the chest is facing.
	Facing world.Direction
	// CustomName is the custom name of the chest. This name is displayed when the chest is opened, and may
	// include colour codes.
	CustomName string
	// contains filtered or unexported fields
}

Chest is a container block which may be used to store items. Chests may also be paired to create a bigger single container. The empty value of Chest is not valid. It must be created using item.NewChest().

func NewChest

func NewChest() Chest

NewChest creates a new initialised chest. The inventory is properly initialised.

func (Chest) AABB

func (c Chest) AABB(world.BlockPos, *world.World) []physics.AABB

AABB ...

func (Chest) Activate

func (c Chest) Activate(pos world.BlockPos, _ world.Face, _ *world.World, u item.User)

Activate ...

func (Chest) AddViewer

func (c Chest) AddViewer(v ContainerViewer, w *world.World, pos world.BlockPos)

AddViewer adds a viewer to the chest, so that it is updated whenever the inventory of the chest is changed.

func (Chest) BreakInfo

func (c Chest) BreakInfo() BreakInfo

BreakInfo ...

func (Chest) CanDisplace

func (Chest) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (Chest) DecodeNBT

func (c Chest) DecodeNBT(data map[string]interface{}) interface{}

DecodeNBT ...

func (Chest) Drops

func (c Chest) Drops() []item.Stack

Drops returns the drops of the chest. This includes all items held in the inventory and the chest itself.

func (Chest) EncodeBlock

func (c Chest) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Chest) EncodeItem

func (Chest) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Chest) EncodeNBT

func (c Chest) EncodeNBT() map[string]interface{}

EncodeNBT ...

func (Chest) Inventory

func (c Chest) Inventory() *inventory.Inventory

Inventory returns the inventory of the chest. The size of the inventory will be 27 or 54, depending on whether the chest is single or double.

func (Chest) LightDiffusionLevel

func (Chest) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Chest) RemoveViewer

func (c Chest) RemoveViewer(v ContainerViewer, w *world.World, pos world.BlockPos)

RemoveViewer removes a viewer from the chest, so that slot updates in the inventory are no longer sent to it.

func (Chest) SideClosed

func (Chest) SideClosed(world.BlockPos, world.BlockPos, *world.World) bool

SideClosed ...

func (Chest) UseOnBlock

func (c Chest) UseOnBlock(pos world.BlockPos, face world.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

func (Chest) WithName

func (c Chest) WithName(a ...interface{}) world.Item

WithName returns the chest after applying a specific name to the block.

type Cobblestone

type Cobblestone struct {
	// Mossy specifies if the cobblestone is mossy. This variant of cobblestone is typically found in
	// dungeons or in small clusters in the giant tree taiga biome.
	Mossy bool
}

Cobblestone is a common block, obtained from mining stone.

func (Cobblestone) BreakInfo

func (c Cobblestone) BreakInfo() BreakInfo

BreakInfo ...

func (Cobblestone) EncodeBlock

func (c Cobblestone) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Cobblestone) EncodeItem

func (c Cobblestone) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Concrete

type Concrete struct {
	// Colour is the colour of the concrete block.
	Colour colour.Colour
}

Concrete is a solid block which comes in the 16 regular dye colors, created by placing concrete powder adjacent to water.

func (Concrete) BreakInfo

func (c Concrete) BreakInfo() BreakInfo

BreakInfo ...

func (Concrete) EncodeBlock

func (c Concrete) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Concrete) EncodeItem

func (c Concrete) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Container

type Container interface {
	AddViewer(v ContainerViewer, w *world.World, pos world.BlockPos)
	RemoveViewer(v ContainerViewer, w *world.World, pos world.BlockPos)
	Inventory() *inventory.Inventory
}

Container represents a container of items, typically a block such as a chest. Containers may have their inventory opened by viewers.

type ContainerOpener

type ContainerOpener interface {
	// OpenBlockContainer opens a block container at the position passed.
	OpenBlockContainer(pos world.BlockPos)
}

ContainerOpener represents an entity that is able to open a container.

type ContainerViewer

type ContainerViewer interface {
	// ViewSlotChange views a change of a single slot in the inventory, in which the item was changed to the
	// new item passed.
	ViewSlotChange(slot int, newItem item.Stack)
}

ContainerViewer represents a viewer that is able to view a container and its inventory.

type Diorite

type Diorite polishable

Diorite is a type of igneous rock.

func (Diorite) BreakInfo

func (d Diorite) BreakInfo() BreakInfo

BreakInfo ...

func (Diorite) EncodeBlock

func (d Diorite) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Diorite) EncodeItem

func (d Diorite) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Dirt

type Dirt struct {
	// Coarse specifies if the dirt should be off the coarse dirt variant. Grass blocks won't spread on
	// the block if set to true.
	Coarse bool
}

Dirt is a block found abundantly in most biomes under a layer of grass blocks at the top of the normal world.

func (Dirt) BreakInfo

func (d Dirt) BreakInfo() BreakInfo

BreakInfo ...

func (Dirt) EncodeBlock

func (d Dirt) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Dirt) EncodeItem

func (d Dirt) EncodeItem() (id int32, meta int16)

EncodeItem ...

type FromStringer

type FromStringer interface {
	FromString(s string) (interface{}, error)
}

FromStringer represents a type that is able to return a specific variant of itself by reading the string passed.

type Granite

type Granite polishable

Granite is a type of igneous rock.

func (Granite) BreakInfo

func (g Granite) BreakInfo() BreakInfo

BreakInfo ...

func (Granite) EncodeBlock

func (g Granite) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Granite) EncodeItem

func (g Granite) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Grass

type Grass struct {
	// Path specifies if the grass was made into a path or not. If true, the block will have only 15/16th of
	// the height of a full block.
	Path bool
}

Grass blocks generate abundantly across the surface of the world.

func (Grass) BreakInfo

func (g Grass) BreakInfo() BreakInfo

BreakInfo ...

func (Grass) EncodeBlock

func (g Grass) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Grass) EncodeItem

func (g Grass) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Grass) NeighbourUpdateTick

func (g Grass) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick handles the turning from grass path into dirt if a block is placed on top of it.

func (Grass) RandomTick

func (g Grass) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick handles the ticking of grass, which may or may not result in the spreading of grass onto dirt.

type Lava

type Lava struct {
	// Still makes the lava not spread whenever it is updated. Still lava cannot be acquired in the game
	// without world editing.
	Still bool
	// Depth is the depth of the water. This is a number from 1-8, where 8 is a source block and 1 is the
	// smallest possible lava block.
	Depth int
	// Falling specifies if the lava is falling. Falling lava will always appear as a source block, but its
	// behaviour differs when it starts spreading.
	Falling bool
}

Lava is a light-emitting fluid block that causes fire damage.

func (Lava) EncodeBlock

func (l Lava) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Lava) Harden

func (l Lava) Harden(pos world.BlockPos, w *world.World, flownIntoBy *world.BlockPos) bool

Harden handles the hardening logic of lava.

func (Lava) HasLiquidDrops

func (Lava) HasLiquidDrops() bool

HasLiquidDrops ...

func (Lava) LightDiffusionLevel

func (Lava) LightDiffusionLevel() uint8

LightDiffusionLevel always returns 2.

func (Lava) LightEmissionLevel

func (Lava) LightEmissionLevel() uint8

LightEmissionLevel returns 15.

func (Lava) LiquidDepth

func (l Lava) LiquidDepth() int

LiquidDepth returns the depth of the lava.

func (Lava) LiquidFalling

func (l Lava) LiquidFalling() bool

LiquidFalling checks if the lava is falling.

func (Lava) LiquidType

func (Lava) LiquidType() string

LiquidType returns "lava" as a unique identifier for the lava liquid.

func (Lava) NeighbourUpdateTick

func (l Lava) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (Lava) ReplaceableBy

func (Lava) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (Lava) ScheduledTick

func (l Lava) ScheduledTick(pos world.BlockPos, w *world.World)

ScheduledTick ...

func (Lava) SpreadDecay

func (Lava) SpreadDecay() int

SpreadDecay always returns 2.

func (Lava) WithDepth

func (l Lava) WithDepth(depth int, falling bool) world.Liquid

WithDepth returns a new Lava block with the depth passed and falling if set to true.

type Leaves

type Leaves struct {
	// Wood is the type of wood of the leaves. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
	// Persistent specifies if the leaves are persistent, meaning they will not decay as a result of no wood
	// being nearby.
	Persistent bool
	// contains filtered or unexported fields
}

Leaves are blocks that grow as part of trees which mainly drop saplings and sticks.

func (Leaves) BreakInfo

func (l Leaves) BreakInfo() BreakInfo

BreakInfo ...

func (Leaves) CanDisplace

func (Leaves) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (Leaves) EncodeBlock

func (l Leaves) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Leaves) EncodeItem

func (l Leaves) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Leaves) LightDiffusionLevel

func (Leaves) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Leaves) SideClosed

func (Leaves) SideClosed(world.BlockPos, world.BlockPos, *world.World) bool

SideClosed ...

type Light

type Light struct {
	// Level is the light level that the light block produces. It is a number from 0-15, where 15 is the
	// brightest and 0 is no light at all.
	Level int
}

Light is an invisible block that can produce any light level.

func (Light) EncodeBlock

func (l Light) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Light) EncodeItem

func (l Light) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Light) LightDiffusionLevel

func (l Light) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Light) LightEmissionLevel

func (l Light) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Light) ReplaceableBy

func (l Light) ReplaceableBy(world.Block) bool

ReplaceableBy ...

type LightDiffuser

type LightDiffuser interface {
	// LightDiffusionLevel returns the amount of light levels that is subtracted when light passes through
	// this block. Some locks, such as leaves, have this behaviour. A diffusion level of 15 means that all
	// light will be completely blocked when light passes through the block.
	LightDiffusionLevel() uint8
}

LightDiffuser represents a block that diffuses light. This means that a specific amount of light levels will be subtracted when light passes through the block. Blocks that do not implement LightDiffuser will be assumed to be solid: Light will not be able to pass through these blocks.

type LightEmitter

type LightEmitter interface {
	// LightEmissionLevel returns the light emission level of the block, a number from 0-15 where 15 is the
	// brightest and 0 means it doesn't emit light at all.
	LightEmissionLevel() uint8
}

LightEmitter represents a block that emits light when placed. Blocks such as torches or lanterns implement this interface.

type LiquidRemovable

type LiquidRemovable interface {
	HasLiquidDrops() bool
}

LiquidRemovable represents a block that may be removed by a liquid flowing into it. When this happens, the block's drops are dropped at the position if HasLiquidDrops returns true.

type Log

type Log struct {
	// Wood is the type of wood of the log. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
	// Stripped specifies if the log is stripped or not.
	Stripped bool
	// Axis is the axis which the log block faces.
	Axis world.Axis
}

Log is a naturally occurring block found in trees, primarily used to create planks. It comes in six species: oak, spruce, birch, jungle, acacia, and dark oak. Stripped log is a variant obtained by using an axe on a log.

func (Log) BreakInfo

func (l Log) BreakInfo() BreakInfo

BreakInfo ...

func (Log) EncodeBlock

func (l Log) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Log) EncodeItem

func (l Log) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Log) UseOnBlock

func (l Log) UseOnBlock(pos world.BlockPos, face world.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock handles the rotational placing of logs.

type Obsidian

type Obsidian struct{}

Obsidian is a dark purple block known for its high blast resistance and strength, most commonly found when water flows over lava.

func (Obsidian) BreakInfo

func (o Obsidian) BreakInfo() BreakInfo

BreakInfo ...

func (Obsidian) EncodeBlock

func (Obsidian) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Obsidian) EncodeItem

func (Obsidian) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Placer

type Placer interface {
	item.User
	PlaceBlock(pos world.BlockPos, b world.Block, ctx *item.UseContext)
}

Placer represents an entity that is able to place a block at a specific position in the world.

type Planks

type Planks struct {
	// Wood is the type of wood of the planks. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
}

Planks are common blocks used in crafting recipes. They are made by crafting logs into planks.

func (Planks) BreakInfo

func (p Planks) BreakInfo() BreakInfo

BreakInfo ...

func (Planks) EncodeBlock

func (p Planks) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Planks) EncodeItem

func (p Planks) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Replaceable

type Replaceable interface {
	// ReplaceableBy returns a bool which indicates if the block is replaceable by another block.
	ReplaceableBy(b world.Block) bool
}

Replaceable represents a block that may be replaced by another block automatically. An example is grass, which may be replaced by clicking it with another block.

type Stone

type Stone struct{}

Stone is a block found underground in the world or on mountains.

func (Stone) BreakInfo

func (s Stone) BreakInfo() BreakInfo

BreakInfo ...

func (Stone) EncodeBlock

func (Stone) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Stone) EncodeItem

func (s Stone) EncodeItem() (id int32, meta int16)

EncodeItem ...

type Water

type Water struct {
	// Still makes the water appear as if it is not flowing.
	Still bool
	// Depth is the depth of the water. This is a number from 1-8, where 8 is a source block and 1 is the
	// smallest possible water block.
	Depth int
	// Falling specifies if the water is falling. Falling water will always appear as a source block, but its
	// behaviour differs when it starts spreading.
	Falling bool
}

Water is a natural fluid that generates abundantly in the world.

func (Water) EncodeBlock

func (w Water) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (Water) Harden

func (w Water) Harden(pos world.BlockPos, wo *world.World, flownIntoBy *world.BlockPos) bool

Harden hardens the water if lava flows into it.

func (Water) HasLiquidDrops

func (Water) HasLiquidDrops() bool

HasLiquidDrops ...

func (Water) LightDiffusionLevel

func (Water) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Water) LiquidDepth

func (w Water) LiquidDepth() int

LiquidDepth returns the depth of the water.

func (Water) LiquidFalling

func (w Water) LiquidFalling() bool

LiquidFalling returns Water.Falling.

func (Water) LiquidType

func (Water) LiquidType() string

LiquidType ...

func (Water) NeighbourUpdateTick

func (Water) NeighbourUpdateTick(pos, _ world.BlockPos, wo *world.World)

NeighbourUpdateTick ...

func (Water) ReplaceableBy

func (Water) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (Water) ScheduledTick

func (w Water) ScheduledTick(pos world.BlockPos, wo *world.World)

ScheduledTick ...

func (Water) SpreadDecay

func (Water) SpreadDecay() int

SpreadDecay returns 1 - The amount of levels decreased upon spreading.

func (Water) WithDepth

func (w Water) WithDepth(depth int, falling bool) world.Liquid

WithDepth returns the water with the depth passed.

type WoodSlab

type WoodSlab struct {
	// Wood is the type of wood of the slabs. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
	// UpsideDown specifies if the slabs are upside down.
	UpsideDown bool
	// Double specifies if the slab is a double slab. These double slabs can be made by placing another slab
	// on an existing slab.
	Double bool
}

WoodSlab is a half block that allows entities to walk up blocks without jumping.

func (WoodSlab) AABB

AABB ...

func (WoodSlab) BreakInfo

func (s WoodSlab) BreakInfo() BreakInfo

BreakInfo ...

func (WoodSlab) CanDisplace

func (s WoodSlab) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (WoodSlab) EncodeBlock

func (s WoodSlab) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (WoodSlab) EncodeItem

func (s WoodSlab) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (WoodSlab) LightDiffusionLevel

func (s WoodSlab) LightDiffusionLevel() uint8

LightDiffusionLevel returns 0 if the slab is a half slab, or 15 if it is double.

func (WoodSlab) SideClosed

func (s WoodSlab) SideClosed(pos, side world.BlockPos, w *world.World) bool

SideClosed ...

func (WoodSlab) UseOnBlock

func (s WoodSlab) UseOnBlock(pos world.BlockPos, face world.Face, clickPos mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock handles the placement of slabs with relation to them being upside down or not and handles slabs being turned into double slabs.

type WoodStairs

type WoodStairs struct {
	// Wood is the type of wood of the stairs. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
	// UpsideDown specifies if the stairs are upside down. If set to true, the full side is at the top part
	// of the block.
	UpsideDown bool
	// Facing is the direction that the full side of the stairs is facing.
	Facing world.Direction
}

WoodStairs are blocks that allow entities to walk up blocks without jumping. They are crafted using planks.

func (WoodStairs) AABB

func (s WoodStairs) AABB(pos world.BlockPos, w *world.World) []physics.AABB

AABB ...

func (WoodStairs) BreakInfo

func (s WoodStairs) BreakInfo() BreakInfo

BreakInfo ...

func (WoodStairs) CanDisplace

func (WoodStairs) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (WoodStairs) EncodeBlock

func (s WoodStairs) EncodeBlock() (name string, properties map[string]interface{})

EncodeBlock ...

func (WoodStairs) EncodeItem

func (s WoodStairs) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (WoodStairs) LightDiffusionLevel

func (WoodStairs) LightDiffusionLevel() uint8

LightDiffusionLevel always returns 0.

func (WoodStairs) SideClosed

func (s WoodStairs) SideClosed(pos, side world.BlockPos, w *world.World) bool

SideClosed ...

func (WoodStairs) UseOnBlock

func (s WoodStairs) UseOnBlock(pos world.BlockPos, face world.Face, clickPos mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock handles the directional placing of stairs and makes sure they are properly placed upside down when needed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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