block

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 34 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 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 {
	// contains filtered or unexported fields
}

Air is the block present in otherwise empty space.

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) HasNBT added in v0.0.3

func (Air) HasNBT() bool

HasNBT ...

func (Air) Hash added in v0.0.3

func (Air) Hash() uint64

Hash ...

func (Air) LightDiffusionLevel

func (Air) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Air) Model added in v0.0.3

func (Air) Model() world.BlockModel

Model ...

func (Air) ReplaceableBy

func (Air) ReplaceableBy(world.Block) bool

ReplaceableBy ...

type AncientDebris added in v0.0.3

type AncientDebris struct {
	// contains filtered or unexported fields
}

AncientDebris is a rare ore found within The Nether.

func (AncientDebris) BreakInfo added in v0.0.3

func (a AncientDebris) BreakInfo() BreakInfo

BreakInfo ...

func (AncientDebris) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (AncientDebris) EncodeItem added in v0.0.3

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

EncodeItem ...

func (AncientDebris) HasNBT added in v0.0.3

func (AncientDebris) HasNBT() bool

HasNBT ...

func (AncientDebris) Hash added in v0.0.3

func (a AncientDebris) Hash() uint64

Hash ...

func (AncientDebris) Model added in v0.0.3

func (AncientDebris) Model() world.BlockModel

Model ...

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 ...

func (Andesite) Hash added in v0.0.3

func (a Andesite) Hash() uint64

Hash ...

type Beacon added in v0.0.2

type Beacon struct {

	// Primary and Secondary are the primary and secondary effects broadcast to nearby entities by the
	// beacon.
	Primary, Secondary effect.Effect
	// contains filtered or unexported fields
}

Beacon is a block that projects a light beam skyward, and can provide status effects such as Speed, Jump Boost, Haste, Regeneration, Resistance, or Strength to nearby players.

func (Beacon) Activate added in v0.0.3

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

Activate manages the opening of a beacon by activating it.

func (Beacon) BreakInfo added in v0.0.2

func (b Beacon) BreakInfo() BreakInfo

BreakInfo ...

func (Beacon) CanDisplace added in v0.0.3

func (b Beacon) CanDisplace(l world.Liquid) bool

CanDisplace ...

func (Beacon) DecodeNBT added in v0.0.3

func (b Beacon) DecodeNBT(data map[string]interface{}) interface{}

DecodeNBT ...

func (Beacon) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (Beacon) EncodeItem added in v0.0.2

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

EncodeItem ...

func (Beacon) EncodeNBT added in v0.0.3

func (b Beacon) EncodeNBT() map[string]interface{}

EncodeNBT ...

func (Beacon) HasNBT added in v0.0.3

func (Beacon) HasNBT() bool

HasNBT ...

func (Beacon) Hash added in v0.0.3

func (Beacon) Hash() uint64

Hash ...

func (Beacon) Level added in v0.0.3

func (b Beacon) Level() int

Level returns an integer 0-4 which defines the current pyramid level of the beacon.

func (Beacon) LightDiffusionLevel added in v0.0.3

func (Beacon) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Beacon) LightEmissionLevel added in v0.0.3

func (Beacon) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Beacon) Model added in v0.0.3

func (Beacon) Model() world.BlockModel

Model ...

func (Beacon) SideClosed added in v0.0.3

func (b Beacon) SideClosed(world.BlockPos, world.BlockPos, *world.World) bool

SideClosed ...

func (Beacon) Tick added in v0.0.3

func (b Beacon) Tick(currentTick int64, pos world.BlockPos, w *world.World)

Tick recalculates level, recalculates the active state of the beacon, and powers players, once every 80 ticks (4 seconds).

func (Beacon) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type BeaconSource added in v0.0.3

type BeaconSource interface {
	// PowersBeacon returns a bool which indicates whether this block can contribute to powering up a
	// beacon pyramid.
	PowersBeacon() bool
}

BeaconSource represents a block which is capable of contributing to powering a beacon pyramid.

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
	// contains filtered or unexported fields
}

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 ...

func (Bedrock) HasNBT added in v0.0.3

func (Bedrock) HasNBT() bool

HasNBT ...

func (Bedrock) Hash added in v0.0.3

func (b Bedrock) Hash() uint64

Hash ...

func (Bedrock) LightDiffusionLevel added in v0.0.3

func (Bedrock) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Bedrock) Model added in v0.0.3

func (Bedrock) Model() world.BlockModel

Model ...

type BeetrootSeeds added in v0.0.3

type BeetrootSeeds struct {
	// contains filtered or unexported fields
}

BeetrootSeeds are a crop that can be harvested to craft soup or red dye.

func (BeetrootSeeds) Bonemeal added in v0.0.3

func (b BeetrootSeeds) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (BeetrootSeeds) BreakInfo added in v0.0.3

func (b BeetrootSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (BeetrootSeeds) CalculateGrowthChance added in v0.0.3

func (c BeetrootSeeds) CalculateGrowthChance(pos world.BlockPos, w *world.World) float64

CalculateGrowthChance calculates the chance the crop will grow during a random tick.

func (BeetrootSeeds) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (BeetrootSeeds) EncodeItem added in v0.0.3

func (b BeetrootSeeds) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (BeetrootSeeds) GrowthStage added in v0.0.3

func (c BeetrootSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (BeetrootSeeds) HasLiquidDrops added in v0.0.3

func (c BeetrootSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (BeetrootSeeds) Hash added in v0.0.3

func (b BeetrootSeeds) Hash() uint64

Hash ...

func (BeetrootSeeds) NeighbourUpdateTick added in v0.0.3

func (c BeetrootSeeds) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (BeetrootSeeds) RandomTick added in v0.0.3

func (b BeetrootSeeds) RandomTick(pos world.BlockPos, w *world.World, _ *rand.Rand)

RandomTick ...

func (BeetrootSeeds) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type BoneBlock added in v0.0.3

type BoneBlock struct {

	// Axis is the axis which the bone block faces.
	Axis world.Axis
	// contains filtered or unexported fields
}

BoneBlock is a decorative block that can face different directions.

func (BoneBlock) BreakInfo added in v0.0.3

func (b BoneBlock) BreakInfo() BreakInfo

BreakInfo ...

func (BoneBlock) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (BoneBlock) EncodeItem added in v0.0.3

func (b BoneBlock) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (BoneBlock) HasNBT added in v0.0.3

func (BoneBlock) HasNBT() bool

HasNBT ...

func (BoneBlock) Hash added in v0.0.3

func (b BoneBlock) Hash() uint64

Hash ...

func (BoneBlock) Model added in v0.0.3

func (BoneBlock) Model() world.BlockModel

Model ...

func (BoneBlock) UseOnBlock added in v0.0.3

func (b BoneBlock) 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 bone blocks.

type BonemealAffected added in v0.0.3

type BonemealAffected interface {
	// Bonemeal attempts to affect the block.
	Bonemeal(pos world.BlockPos, w *world.World) bool
}

BonemealAffected represents a block that is affected when bonemeal is used on it.

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
	// XPDrops is the range of XP a block can drop when broken.
	XPDrops XPDropRange
}

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 Carpet added in v0.0.2

type Carpet struct {

	// Colour is the colour of the carpet.
	Colour colour.Colour
	// contains filtered or unexported fields
}

Carpet is a colourful block that can be obtained by killing/shearing sheep, or crafted using four string.

func (Carpet) BreakInfo added in v0.0.2

func (c Carpet) BreakInfo() BreakInfo

BreakInfo ...

func (Carpet) CanDisplace added in v0.0.2

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

CanDisplace ...

func (Carpet) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (Carpet) EncodeItem added in v0.0.2

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

EncodeItem ...

func (Carpet) HasLiquidDrops added in v0.0.2

func (Carpet) HasLiquidDrops() bool

HasLiquidDrops ...

func (Carpet) HasNBT added in v0.0.3

func (Carpet) HasNBT() bool

HasNBT ...

func (Carpet) Hash added in v0.0.3

func (c Carpet) Hash() uint64

Hash ...

func (Carpet) LightDiffusionLevel added in v0.0.3

func (Carpet) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Carpet) Model added in v0.0.3

func (Carpet) Model() world.BlockModel

Model ...

func (Carpet) NeighbourUpdateTick added in v0.0.2

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

NeighbourUpdateTick ...

func (Carpet) SideClosed added in v0.0.2

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

SideClosed ...

func (Carpet) UseOnBlock added in v0.0.2

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

UseOnBlock handles not placing carpets on top of air blocks.

type Carrot added in v0.0.3

type Carrot struct {
	// contains filtered or unexported fields
}

Carrot is a crop that can be consumed raw.

func (Carrot) AlwaysConsumable added in v0.0.3

func (c Carrot) AlwaysConsumable() bool

AlwaysConsumable ...

func (Carrot) Bonemeal added in v0.0.3

func (c Carrot) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (Carrot) BreakInfo added in v0.0.3

func (c Carrot) BreakInfo() BreakInfo

BreakInfo ...

func (Carrot) CalculateGrowthChance added in v0.0.3

func (c Carrot) CalculateGrowthChance(pos world.BlockPos, w *world.World) float64

CalculateGrowthChance calculates the chance the crop will grow during a random tick.

func (Carrot) Consume added in v0.0.3

func (c Carrot) Consume(_ *world.World, consumer item.Consumer) item.Stack

Consume ...

func (Carrot) ConsumeDuration added in v0.0.3

func (c Carrot) ConsumeDuration() time.Duration

ConsumeDuration ...

func (Carrot) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Carrot) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Carrot) GrowthStage added in v0.0.3

func (c Carrot) GrowthStage() int

GrowthStage returns the current stage of growth.

func (Carrot) HasLiquidDrops added in v0.0.3

func (c Carrot) HasLiquidDrops() bool

HasLiquidDrops ...

func (Carrot) Hash added in v0.0.3

func (c Carrot) Hash() uint64

Hash ...

func (Carrot) NeighbourUpdateTick added in v0.0.3

func (c Carrot) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (Carrot) RandomTick added in v0.0.3

func (c Carrot) RandomTick(pos world.BlockPos, w *world.World, _ *rand.Rand)

RandomTick ...

func (Carrot) UseOnBlock added in v0.0.3

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

UseOnBlock ...

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) 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) HasNBT added in v0.0.3

func (Chest) HasNBT() bool

HasNBT ...

func (Chest) Hash added in v0.0.3

func (c Chest) Hash() uint64

Hash ...

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) Model added in v0.0.3

func (Chest) Model() world.BlockModel

Model ...

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 ChiseledQuartz added in v0.0.3

type ChiseledQuartz struct {
	// contains filtered or unexported fields
}

ChiseledQuartz is a mineral block used only for decoration.

func (ChiseledQuartz) BreakInfo added in v0.0.3

func (c ChiseledQuartz) BreakInfo() BreakInfo

BreakInfo ...

func (ChiseledQuartz) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (ChiseledQuartz) EncodeItem added in v0.0.3

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

EncodeItem ...

func (ChiseledQuartz) HasNBT added in v0.0.3

func (ChiseledQuartz) HasNBT() bool

HasNBT ...

func (ChiseledQuartz) Hash added in v0.0.3

func (ChiseledQuartz) Hash() uint64

Hash ...

func (ChiseledQuartz) Model added in v0.0.3

func (ChiseledQuartz) Model() world.BlockModel

Model ...

type Clay added in v0.0.3

type Clay struct {
	// contains filtered or unexported fields
}

Clay is a block that can be found underwater.

func (Clay) BreakInfo added in v0.0.3

func (c Clay) BreakInfo() BreakInfo

BreakInfo ...

func (Clay) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Clay) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Clay) HasNBT added in v0.0.3

func (Clay) HasNBT() bool

HasNBT ...

func (Clay) Hash added in v0.0.3

func (c Clay) Hash() uint64

Hash ...

func (Clay) Model added in v0.0.3

func (Clay) Model() world.BlockModel

Model ...

type CoalBlock added in v0.0.3

type CoalBlock struct {
	// contains filtered or unexported fields
}

CoalBlock is a precious mineral block made from 9 coal.

func (CoalBlock) BreakInfo added in v0.0.3

func (c CoalBlock) BreakInfo() BreakInfo

BreakInfo ...

func (CoalBlock) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (CoalBlock) EncodeItem added in v0.0.3

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

EncodeItem ...

func (CoalBlock) HasNBT added in v0.0.3

func (CoalBlock) HasNBT() bool

HasNBT ...

func (CoalBlock) Hash added in v0.0.3

func (CoalBlock) Hash() uint64

Hash ...

func (CoalBlock) Model added in v0.0.3

func (CoalBlock) Model() world.BlockModel

Model ...

type CoalOre added in v0.0.3

type CoalOre struct {
	// contains filtered or unexported fields
}

CoalOre is a common ore.

func (CoalOre) BreakInfo added in v0.0.3

func (c CoalOre) BreakInfo() BreakInfo

BreakInfo ...

func (CoalOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (CoalOre) EncodeItem added in v0.0.3

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

EncodeItem ...

func (CoalOre) HasNBT added in v0.0.3

func (CoalOre) HasNBT() bool

HasNBT ...

func (CoalOre) Hash added in v0.0.3

func (c CoalOre) Hash() uint64

Hash ...

func (CoalOre) Model added in v0.0.3

func (CoalOre) Model() world.BlockModel

Model ...

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
	// contains filtered or unexported fields
}

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 ...

func (Cobblestone) HasNBT added in v0.0.3

func (Cobblestone) HasNBT() bool

HasNBT ...

func (Cobblestone) Hash added in v0.0.3

func (c Cobblestone) Hash() uint64

Hash ...

func (Cobblestone) Model added in v0.0.3

func (Cobblestone) Model() world.BlockModel

Model ...

type CocoaBean added in v0.0.3

type CocoaBean struct {

	// Facing is the direction from the cocoa bean to the log.
	Facing world.Direction
	// Age is the stage of the cocoa bean's growth. 2 is fully grown.
	Age int
	// contains filtered or unexported fields
}

CocoaBean is a crop block found in Jungle biomes.

func (CocoaBean) Bonemeal added in v0.0.3

func (c CocoaBean) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (CocoaBean) BreakInfo added in v0.0.3

func (c CocoaBean) BreakInfo() BreakInfo

BreakInfo ...

func (CocoaBean) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (CocoaBean) EncodeItem added in v0.0.3

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

EncodeItem ...

func (CocoaBean) HasLiquidDrops added in v0.0.3

func (c CocoaBean) HasLiquidDrops() bool

HasLiquidDrops ...

func (CocoaBean) HasNBT added in v0.0.3

func (CocoaBean) HasNBT() bool

HasNBT ...

func (CocoaBean) Hash added in v0.0.3

func (c CocoaBean) Hash() uint64

Hash ...

func (CocoaBean) LightDiffusionLevel added in v0.0.3

func (CocoaBean) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (CocoaBean) Model added in v0.0.3

func (c CocoaBean) Model() world.BlockModel

Model ...

func (CocoaBean) NeighbourUpdateTick added in v0.0.3

func (c CocoaBean) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (CocoaBean) RandomTick added in v0.0.3

func (c CocoaBean) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick ...

func (CocoaBean) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type Concrete

type Concrete struct {

	// Colour is the colour of the concrete block.
	Colour colour.Colour
	// contains filtered or unexported fields
}

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 ...

func (Concrete) HasNBT added in v0.0.3

func (Concrete) HasNBT() bool

HasNBT ...

func (Concrete) Hash added in v0.0.3

func (c Concrete) Hash() uint64

Hash ...

func (Concrete) Model added in v0.0.3

func (Concrete) Model() world.BlockModel

Model ...

type ConcretePowder added in v0.0.3

type ConcretePowder struct {

	// Colour is the colour of the concrete powder.
	Colour colour.Colour
	// contains filtered or unexported fields
}

ConcretePowder is a gravity affected block that comes in 16 different colours. When interacting with water, it becomes concrete.

func (ConcretePowder) BreakInfo added in v0.0.3

func (c ConcretePowder) BreakInfo() BreakInfo

BreakInfo ...

func (ConcretePowder) CanSolidify added in v0.0.3

func (c ConcretePowder) CanSolidify(pos world.BlockPos, w *world.World) bool

CanSolidify ...

func (ConcretePowder) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (ConcretePowder) EncodeItem added in v0.0.3

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

EncodeItem ...

func (ConcretePowder) HasNBT added in v0.0.3

func (ConcretePowder) HasNBT() bool

HasNBT ...

func (ConcretePowder) Hash added in v0.0.3

func (c ConcretePowder) Hash() uint64

Hash ...

func (ConcretePowder) Model added in v0.0.3

func (ConcretePowder) Model() world.BlockModel

Model ...

func (ConcretePowder) NeighbourUpdateTick added in v0.0.3

func (c ConcretePowder) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

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 Coral added in v0.0.3

type Coral struct {

	// Type is the type of coral of the block.
	Type coral.Coral
	// Dead is whether the coral is dead.
	Dead bool
	// contains filtered or unexported fields
}

Coral is a non solid block that comes in 5 variants.

func (Coral) BreakInfo added in v0.0.3

func (c Coral) BreakInfo() BreakInfo

BreakInfo ...

func (Coral) CanDisplace added in v0.0.3

func (c Coral) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (Coral) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Coral) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Coral) HasLiquidDrops added in v0.0.3

func (c Coral) HasLiquidDrops() bool

HasLiquidDrops ...

func (Coral) HasNBT added in v0.0.3

func (Coral) HasNBT() bool

HasNBT ...

func (Coral) Hash added in v0.0.3

func (c Coral) Hash() uint64

Hash ...

func (Coral) LightDiffusionLevel added in v0.0.3

func (Coral) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Coral) Model added in v0.0.3

func (Coral) Model() world.BlockModel

Model ...

func (Coral) NeighbourUpdateTick added in v0.0.3

func (c Coral) NeighbourUpdateTick(pos, changedNeighbour world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (Coral) ScheduledTick added in v0.0.3

func (c Coral) ScheduledTick(pos world.BlockPos, w *world.World)

ScheduledTick ...

func (Coral) SideClosed added in v0.0.3

func (c Coral) SideClosed(pos, side world.BlockPos, w *world.World) bool

SideClosed ...

func (Coral) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type CoralBlock added in v0.0.3

type CoralBlock struct {

	// Type is the type of coral of the block.
	Type coral.Coral
	// Dead is whether the coral block is dead.
	Dead bool
	// contains filtered or unexported fields
}

CoralBlock is a solid block that comes in 5 variants.

func (CoralBlock) BreakInfo added in v0.0.3

func (c CoralBlock) BreakInfo() BreakInfo

BreakInfo ...

func (CoralBlock) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (CoralBlock) EncodeItem added in v0.0.3

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

EncodeItem ...

func (CoralBlock) HasNBT added in v0.0.3

func (CoralBlock) HasNBT() bool

HasNBT ...

func (CoralBlock) Hash added in v0.0.3

func (c CoralBlock) Hash() uint64

Hash ...

func (CoralBlock) Model added in v0.0.3

func (CoralBlock) Model() world.BlockModel

Model ...

func (CoralBlock) NeighbourUpdateTick added in v0.0.3

func (c CoralBlock) NeighbourUpdateTick(pos, changedNeighbour world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (CoralBlock) ScheduledTick added in v0.0.3

func (c CoralBlock) ScheduledTick(pos world.BlockPos, w *world.World)

ScheduledTick ...

type Crop added in v0.0.3

type Crop interface {
	// GrowthStage returns the crop's current stage of growth. The max value is 7.
	GrowthStage() int
}

Crop is an interface for all crops that are grown on farmland. A crop has a random chance to grow during random ticks.

type DiamondBlock added in v0.0.2

type DiamondBlock struct {
	// contains filtered or unexported fields
}

DiamondBlock is a block which can only be gained by crafting it.

func (DiamondBlock) BreakInfo added in v0.0.2

func (d DiamondBlock) BreakInfo() BreakInfo

BreakInfo ...

func (DiamondBlock) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (DiamondBlock) EncodeItem added in v0.0.2

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

EncodeItem ...

func (DiamondBlock) HasNBT added in v0.0.3

func (DiamondBlock) HasNBT() bool

HasNBT ...

func (DiamondBlock) Hash added in v0.0.3

func (d DiamondBlock) Hash() uint64

Hash ...

func (DiamondBlock) Model added in v0.0.3

func (DiamondBlock) Model() world.BlockModel

Model ...

func (DiamondBlock) PowersBeacon added in v0.0.3

func (DiamondBlock) PowersBeacon() bool

PowersBeacon ...

type DiamondOre added in v0.0.3

type DiamondOre struct {
	// contains filtered or unexported fields
}

DiamondOre is a rare ore that generates underground.

func (DiamondOre) BreakInfo added in v0.0.3

func (d DiamondOre) BreakInfo() BreakInfo

BreakInfo ...

func (DiamondOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (DiamondOre) EncodeItem added in v0.0.3

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

EncodeItem ...

func (DiamondOre) HasNBT added in v0.0.3

func (DiamondOre) HasNBT() bool

HasNBT ...

func (DiamondOre) Hash added in v0.0.3

func (d DiamondOre) Hash() uint64

Hash ...

func (DiamondOre) Model added in v0.0.3

func (DiamondOre) Model() world.BlockModel

Model ...

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 ...

func (Diorite) Hash added in v0.0.3

func (d Diorite) Hash() uint64

Hash ...

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
	// contains filtered or unexported fields
}

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 ...

func (Dirt) HasNBT added in v0.0.3

func (Dirt) HasNBT() bool

HasNBT ...

func (Dirt) Hash added in v0.0.3

func (d Dirt) Hash() uint64

Hash ...

func (Dirt) Model added in v0.0.3

func (Dirt) Model() world.BlockModel

Model ...

type EmeraldBlock added in v0.0.2

type EmeraldBlock struct {
	// contains filtered or unexported fields
}

EmeraldBlock is a precious mineral block crafted using 9 emeralds.

func (EmeraldBlock) BreakInfo added in v0.0.2

func (e EmeraldBlock) BreakInfo() BreakInfo

BreakInfo ...

func (EmeraldBlock) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (EmeraldBlock) EncodeItem added in v0.0.2

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

EncodeItem ...

func (EmeraldBlock) HasNBT added in v0.0.3

func (EmeraldBlock) HasNBT() bool

HasNBT ...

func (EmeraldBlock) Hash added in v0.0.3

func (EmeraldBlock) Hash() uint64

Hash ...

func (EmeraldBlock) Model added in v0.0.3

func (EmeraldBlock) Model() world.BlockModel

Model ...

func (EmeraldBlock) PowersBeacon added in v0.0.3

func (EmeraldBlock) PowersBeacon() bool

PowersBeacon ...

type EmeraldOre added in v0.0.3

type EmeraldOre struct {
	// contains filtered or unexported fields
}

EmeraldOre is an ore generating exclusively under mountain biomes.

func (EmeraldOre) BreakInfo added in v0.0.3

func (e EmeraldOre) BreakInfo() BreakInfo

BreakInfo ...

func (EmeraldOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (EmeraldOre) EncodeItem added in v0.0.3

func (e EmeraldOre) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (EmeraldOre) HasNBT added in v0.0.3

func (EmeraldOre) HasNBT() bool

HasNBT ...

func (EmeraldOre) Hash added in v0.0.3

func (e EmeraldOre) Hash() uint64

Hash ...

func (EmeraldOre) Model added in v0.0.3

func (EmeraldOre) Model() world.BlockModel

Model ...

type EndBrickStairs added in v0.0.3

type EndBrickStairs struct {

	// 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
	// contains filtered or unexported fields
}

EndBrickStairs are blocks that allow entities to walk up blocks without jumping. They are crafted using end bricks.

func (EndBrickStairs) BreakInfo added in v0.0.3

func (s EndBrickStairs) BreakInfo() BreakInfo

BreakInfo ...

func (EndBrickStairs) CanDisplace added in v0.0.3

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

CanDisplace ...

func (EndBrickStairs) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (EndBrickStairs) EncodeItem added in v0.0.3

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

EncodeItem ...

func (EndBrickStairs) HasNBT added in v0.0.3

func (EndBrickStairs) HasNBT() bool

HasNBT ...

func (EndBrickStairs) Hash added in v0.0.3

func (s EndBrickStairs) Hash() uint64

Hash ...

func (EndBrickStairs) LightDiffusionLevel added in v0.0.3

func (EndBrickStairs) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (EndBrickStairs) Model added in v0.0.3

func (s EndBrickStairs) Model() world.BlockModel

Model ...

func (EndBrickStairs) SideClosed added in v0.0.3

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

SideClosed ...

func (EndBrickStairs) UseOnBlock added in v0.0.3

func (s EndBrickStairs) 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.

type EndBricks added in v0.0.3

type EndBricks struct {
	// contains filtered or unexported fields
}

EndBricks is a block made from combining four endstone blocks together.

func (EndBricks) BreakInfo added in v0.0.3

func (c EndBricks) BreakInfo() BreakInfo

BreakInfo ...

func (EndBricks) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (EndBricks) EncodeItem added in v0.0.3

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

EncodeItem ...

func (EndBricks) HasNBT added in v0.0.3

func (EndBricks) HasNBT() bool

HasNBT ...

func (EndBricks) Hash added in v0.0.3

func (c EndBricks) Hash() uint64

Hash ...

func (EndBricks) Model added in v0.0.3

func (EndBricks) Model() world.BlockModel

Model ...

type EndStone added in v0.0.3

type EndStone struct {
	// contains filtered or unexported fields
}

EndStone is a block found in The End.

func (EndStone) BreakInfo added in v0.0.3

func (e EndStone) BreakInfo() BreakInfo

BreakInfo ...

func (EndStone) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (EndStone) EncodeItem added in v0.0.3

func (e EndStone) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (EndStone) HasNBT added in v0.0.3

func (EndStone) HasNBT() bool

HasNBT ...

func (EndStone) Hash added in v0.0.3

func (e EndStone) Hash() uint64

Hash ...

func (EndStone) Model added in v0.0.3

func (EndStone) Model() world.BlockModel

Model ...

type Farmland added in v0.0.3

type Farmland struct {

	// Hydration is how much moisture the farmland block has. Hydration starts at 0 & caps at 7. During a random tick
	// update, if there is water within 4 blocks from the farmland block, hydration is set to 7. Otherwise, it
	// decrements until it turns into dirt.
	Hydration int
	// contains filtered or unexported fields
}

Farmland is a block that crops are grown on. Farmland is created by interacting with a grass or dirt block using a hoe. Farmland can be hydrated by nearby water, with no hydration resulting in it turning into a dirt block.

func (Farmland) BreakInfo added in v0.0.3

func (f Farmland) BreakInfo() BreakInfo

BreakInfo ...

func (Farmland) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Farmland) HasNBT added in v0.0.3

func (Farmland) HasNBT() bool

HasNBT ...

func (Farmland) Hash added in v0.0.3

func (f Farmland) Hash() uint64

Hash ...

func (Farmland) Model added in v0.0.3

func (Farmland) Model() world.BlockModel

Model ...

func (Farmland) NeighbourUpdateTick added in v0.0.3

func (f Farmland) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (Farmland) RandomTick added in v0.0.3

func (f Farmland) RandomTick(pos world.BlockPos, w *world.World, _ *rand.Rand)

RandomTick ...

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 Glass added in v0.0.2

type Glass struct {
	// contains filtered or unexported fields
}

Glass is a decorative, fully transparent solid block that can be dyed into stained glass.

func (Glass) BreakInfo added in v0.0.2

func (g Glass) BreakInfo() BreakInfo

BreakInfo ...

func (Glass) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (Glass) EncodeItem added in v0.0.2

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

EncodeItem ...

func (Glass) HasNBT added in v0.0.3

func (Glass) HasNBT() bool

HasNBT ...

func (Glass) Hash added in v0.0.3

func (Glass) Hash() uint64

Hash ...

func (Glass) LightDiffusionLevel added in v0.0.3

func (Glass) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Glass) Model added in v0.0.3

func (Glass) Model() world.BlockModel

Model ...

type GlassPane added in v0.0.3

type GlassPane struct {
	// contains filtered or unexported fields
}

GlassPane is a transparent block that can be used as a more efficient alternative to glass blocks.

func (GlassPane) BreakInfo added in v0.0.3

func (p GlassPane) BreakInfo() BreakInfo

BreakInfo ...

func (GlassPane) CanDisplace added in v0.0.3

func (p GlassPane) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (GlassPane) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (GlassPane) EncodeItem added in v0.0.3

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

EncodeItem ...

func (GlassPane) HasNBT added in v0.0.3

func (GlassPane) HasNBT() bool

HasNBT ...

func (GlassPane) Hash added in v0.0.3

func (p GlassPane) Hash() uint64

Hash ...

func (GlassPane) LightDiffusionLevel added in v0.0.3

func (GlassPane) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (GlassPane) Model added in v0.0.3

func (GlassPane) Model() world.BlockModel

Model ...

func (GlassPane) SideClosed added in v0.0.3

func (p GlassPane) SideClosed(world.BlockPos, world.BlockPos, *world.World) bool

SideClosed ...

type GlazedTerracotta added in v0.0.2

type GlazedTerracotta struct {

	// Colour specifies the colour of the block.
	Colour colour.Colour
	// Facing specifies the face of the block.
	Facing world.Direction
	// contains filtered or unexported fields
}

GlazedTerracotta is a vibrant solid block that comes in the 16 regular dye colours.

func (GlazedTerracotta) BreakInfo added in v0.0.2

func (t GlazedTerracotta) BreakInfo() BreakInfo

BreakInfo ...

func (GlazedTerracotta) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (GlazedTerracotta) EncodeItem added in v0.0.2

func (t GlazedTerracotta) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (GlazedTerracotta) HasNBT added in v0.0.3

func (GlazedTerracotta) HasNBT() bool

HasNBT ...

func (GlazedTerracotta) Hash added in v0.0.3

func (t GlazedTerracotta) Hash() uint64

Hash ...

func (GlazedTerracotta) Model added in v0.0.3

func (GlazedTerracotta) Model() world.BlockModel

Model ...

func (GlazedTerracotta) UseOnBlock added in v0.0.2

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

UseOnBlock ensures the proper facing is used when placing a glazed terracotta block, by using the opposite of the player.

type Glowstone added in v0.0.3

type Glowstone struct {
	// contains filtered or unexported fields
}

Glowstone is commonly found on the ceiling of the nether dimension.

func (Glowstone) BreakInfo added in v0.0.3

func (g Glowstone) BreakInfo() BreakInfo

BreakInfo ...

func (Glowstone) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Glowstone) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Glowstone) HasNBT added in v0.0.3

func (Glowstone) HasNBT() bool

HasNBT ...

func (Glowstone) Hash added in v0.0.3

func (Glowstone) Hash() uint64

Hash ...

func (Glowstone) LightEmissionLevel added in v0.0.3

func (Glowstone) LightEmissionLevel() uint8

LightEmissionLevel returns 15.

func (Glowstone) Model added in v0.0.3

func (Glowstone) Model() world.BlockModel

Model ...

type GoldBlock added in v0.0.2

type GoldBlock struct {
	// contains filtered or unexported fields
}

GoldBlock is a precious metal block crafted from 9 gold ingots.

func (GoldBlock) BreakInfo added in v0.0.2

func (g GoldBlock) BreakInfo() BreakInfo

BreakInfo ...

func (GoldBlock) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (GoldBlock) EncodeItem added in v0.0.2

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

EncodeItem ...

func (GoldBlock) HasNBT added in v0.0.3

func (GoldBlock) HasNBT() bool

HasNBT ...

func (GoldBlock) Hash added in v0.0.3

func (GoldBlock) Hash() uint64

Hash ...

func (GoldBlock) Model added in v0.0.3

func (GoldBlock) Model() world.BlockModel

Model ...

func (GoldBlock) PowersBeacon added in v0.0.3

func (GoldBlock) PowersBeacon() bool

PowersBeacon ...

type GoldOre added in v0.0.3

type GoldOre struct {
	// contains filtered or unexported fields
}

GoldOre is a rare mineral block found underground.

func (GoldOre) BreakInfo added in v0.0.3

func (g GoldOre) BreakInfo() BreakInfo

BreakInfo ...

func (GoldOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (GoldOre) EncodeItem added in v0.0.3

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

EncodeItem ...

func (GoldOre) HasNBT added in v0.0.3

func (GoldOre) HasNBT() bool

HasNBT ...

func (GoldOre) Hash added in v0.0.3

func (g GoldOre) Hash() uint64

Hash ...

func (GoldOre) Model added in v0.0.3

func (GoldOre) Model() world.BlockModel

Model ...

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 ...

func (Granite) Hash added in v0.0.3

func (g Granite) Hash() uint64

Hash ...

type Grass

type Grass struct {
	// contains filtered or unexported fields
}

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) HasNBT added in v0.0.3

func (Grass) HasNBT() bool

HasNBT ...

func (Grass) Hash added in v0.0.3

func (g Grass) Hash() uint64

Hash ...

func (Grass) Model added in v0.0.3

func (Grass) Model() world.BlockModel

Model ...

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 GrassPath added in v0.0.3

type GrassPath struct {
	// contains filtered or unexported fields
}

GrassPath is a decorative block that can be created by using a shovel on a grass block.

func (GrassPath) BreakInfo added in v0.0.3

func (p GrassPath) BreakInfo() BreakInfo

BreakInfo ...

func (GrassPath) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (GrassPath) EncodeItem added in v0.0.3

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

EncodeItem ...

func (GrassPath) HasNBT added in v0.0.3

func (GrassPath) HasNBT() bool

HasNBT ...

func (GrassPath) Hash added in v0.0.3

func (p GrassPath) Hash() uint64

Hash ...

func (GrassPath) LightDiffusionLevel added in v0.0.3

func (GrassPath) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (GrassPath) Model added in v0.0.3

func (GrassPath) Model() world.BlockModel

Model ...

func (GrassPath) NeighbourUpdateTick added in v0.0.3

func (p GrassPath) 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.

type Gravel added in v0.0.3

type Gravel struct {
	// contains filtered or unexported fields
}

Gravel is a block affected by gravity. It has a 10% chance of dropping flint instead of itself on break.

func (Gravel) BreakInfo added in v0.0.3

func (g Gravel) BreakInfo() BreakInfo

BreakInfo ...

func (Gravel) CanSolidify added in v0.0.3

func (g Gravel) CanSolidify(world.BlockPos, *world.World) bool

CanSolidify ...

func (Gravel) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Gravel) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Gravel) HasNBT added in v0.0.3

func (Gravel) HasNBT() bool

HasNBT ...

func (Gravel) Hash added in v0.0.3

func (g Gravel) Hash() uint64

Hash ...

func (Gravel) Model added in v0.0.3

func (Gravel) Model() world.BlockModel

Model ...

func (Gravel) NeighbourUpdateTick added in v0.0.3

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

NeighbourUpdateTick ...

type GravityAffected added in v0.0.3

type GravityAffected interface {
	// CanSolidify returns whether the falling block can return back to a normal block without being on the ground.
	CanSolidify(pos world.BlockPos, w *world.World) bool
}

GravityAffected represents blocks affected by gravity.

type IronBars added in v0.0.3

type IronBars struct {
	// contains filtered or unexported fields
}

IronBars are blocks that serve a similar purpose to glass panes, but made of iron instead of glass.

func (IronBars) BreakInfo added in v0.0.3

func (i IronBars) BreakInfo() BreakInfo

BreakInfo ...

func (IronBars) CanDisplace added in v0.0.3

func (i IronBars) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (IronBars) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (IronBars) EncodeItem added in v0.0.3

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

EncodeItem ...

func (IronBars) HasNBT added in v0.0.3

func (IronBars) HasNBT() bool

HasNBT ...

func (IronBars) Hash added in v0.0.3

func (i IronBars) Hash() uint64

Hash ...

func (IronBars) LightDiffusionLevel added in v0.0.3

func (IronBars) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (IronBars) Model added in v0.0.3

func (IronBars) Model() world.BlockModel

Model ...

func (IronBars) SideClosed added in v0.0.3

func (i IronBars) SideClosed(world.BlockPos, world.BlockPos, *world.World) bool

SideClosed ...

type IronBlock added in v0.0.2

type IronBlock struct {
	// contains filtered or unexported fields
}

IronBlock is a precious metal block made from 9 iron ingots.

func (IronBlock) BreakInfo added in v0.0.2

func (i IronBlock) BreakInfo() BreakInfo

BreakInfo ...

func (IronBlock) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (IronBlock) EncodeItem added in v0.0.2

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

EncodeItem ...

func (IronBlock) HasNBT added in v0.0.3

func (IronBlock) HasNBT() bool

HasNBT ...

func (IronBlock) Hash added in v0.0.3

func (IronBlock) Hash() uint64

Hash ...

func (IronBlock) Model added in v0.0.3

func (IronBlock) Model() world.BlockModel

Model ...

func (IronBlock) PowersBeacon added in v0.0.3

func (IronBlock) PowersBeacon() bool

PowersBeacon ...

type IronOre added in v0.0.3

type IronOre struct {
	// contains filtered or unexported fields
}

IronOre is a mineral block found underground.

func (IronOre) BreakInfo added in v0.0.3

func (i IronOre) BreakInfo() BreakInfo

BreakInfo ...

func (IronOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (IronOre) EncodeItem added in v0.0.3

func (i IronOre) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (IronOre) HasNBT added in v0.0.3

func (IronOre) HasNBT() bool

HasNBT ...

func (IronOre) Hash added in v0.0.3

func (i IronOre) Hash() uint64

Hash ...

func (IronOre) Model added in v0.0.3

func (IronOre) Model() world.BlockModel

Model ...

type Kelp added in v0.0.3

type Kelp struct {

	// Age is the age of the kelp block which can be 0-25. If age is 25, kelp won't grow any further.
	Age int
	// contains filtered or unexported fields
}

Kelp is an underwater block which can grow on top of solids underwater.

func (Kelp) Bonemeal added in v0.0.3

func (k Kelp) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (Kelp) BreakInfo added in v0.0.3

func (k Kelp) BreakInfo() BreakInfo

BreakInfo ...

func (Kelp) CanDisplace added in v0.0.3

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

CanDisplace will return true if the liquid is Water, since kelp can waterlog.

func (Kelp) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Kelp) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Kelp) HasNBT added in v0.0.3

func (Kelp) HasNBT() bool

HasNBT ...

func (Kelp) Hash added in v0.0.3

func (k Kelp) Hash() uint64

Hash ...

func (Kelp) LightDiffusionLevel added in v0.0.3

func (Kelp) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Kelp) Model added in v0.0.3

func (Kelp) Model() world.BlockModel

Model ...

func (Kelp) NeighbourUpdateTick added in v0.0.3

func (k Kelp) NeighbourUpdateTick(pos, changed world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (Kelp) RandomTick added in v0.0.3

func (k Kelp) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick ...

func (Kelp) SideClosed added in v0.0.3

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

SideClosed will always return false since kelp doesn't close any side.

func (Kelp) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type Lantern added in v0.0.3

type Lantern struct {

	// Hanging determines if a lantern is hanging off a block.
	Hanging bool
	// Type of fire lighting the lantern.
	Type fire.Fire
	// contains filtered or unexported fields
}

Lantern is a light emitting block.

func (Lantern) BreakInfo added in v0.0.3

func (l Lantern) BreakInfo() BreakInfo

BreakInfo ...

func (Lantern) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Lantern) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Lantern) HasLiquidDrops added in v0.0.3

func (l Lantern) HasLiquidDrops() bool

HasLiquidDrops ...

func (Lantern) HasNBT added in v0.0.3

func (Lantern) HasNBT() bool

HasNBT ...

func (Lantern) Hash added in v0.0.3

func (l Lantern) Hash() uint64

Hash ...

func (Lantern) LightDiffusionLevel added in v0.0.3

func (Lantern) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Lantern) LightEmissionLevel added in v0.0.3

func (l Lantern) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Lantern) Model added in v0.0.3

func (l Lantern) Model() world.BlockModel

Model ...

func (Lantern) NeighbourUpdateTick added in v0.0.3

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

NeighbourUpdateTick ...

func (Lantern) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type LapisBlock added in v0.0.3

type LapisBlock struct {
	// contains filtered or unexported fields
}

LapisBlock is a decorative mineral block that is crafted from lapis lazuli.

func (LapisBlock) BreakInfo added in v0.0.3

func (l LapisBlock) BreakInfo() BreakInfo

BreakInfo ...

func (LapisBlock) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (LapisBlock) EncodeItem added in v0.0.3

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

EncodeItem ...

func (LapisBlock) HasNBT added in v0.0.3

func (LapisBlock) HasNBT() bool

HasNBT ...

func (LapisBlock) Hash added in v0.0.3

func (l LapisBlock) Hash() uint64

Hash ...

func (LapisBlock) Model added in v0.0.3

func (LapisBlock) Model() world.BlockModel

Model ...

type LapisOre added in v0.0.3

type LapisOre struct {
	// contains filtered or unexported fields
}

LapisOre is an ore block from which lapis lazuli is obtained.

func (LapisOre) BreakInfo added in v0.0.3

func (l LapisOre) BreakInfo() BreakInfo

BreakInfo ...

func (LapisOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (LapisOre) EncodeItem added in v0.0.3

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

EncodeItem ...

func (LapisOre) HasNBT added in v0.0.3

func (LapisOre) HasNBT() bool

HasNBT ...

func (LapisOre) Hash added in v0.0.3

func (l LapisOre) Hash() uint64

Hash ...

func (LapisOre) Model added in v0.0.3

func (LapisOre) Model() world.BlockModel

Model ...

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
	// contains filtered or unexported fields
}

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

func (Lava) AABB added in v0.0.2

AABB returns no boxes.

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) HasNBT added in v0.0.3

func (Lava) HasNBT() bool

HasNBT ...

func (Lava) Hash added in v0.0.3

func (l Lava) Hash() uint64

Hash ...

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) Model added in v0.0.3

func (Lava) Model() world.BlockModel

Model ...

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) HasNBT added in v0.0.3

func (Leaves) HasNBT() bool

HasNBT ...

func (Leaves) Hash added in v0.0.3

func (l Leaves) Hash() uint64

Hash ...

func (Leaves) LightDiffusionLevel

func (Leaves) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Leaves) Model added in v0.0.3

func (Leaves) Model() world.BlockModel

Model ...

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
	// contains filtered or unexported fields
}

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) HasNBT added in v0.0.3

func (Light) HasNBT() bool

HasNBT ...

func (Light) Hash added in v0.0.3

func (l Light) Hash() uint64

Hash ...

func (Light) LightDiffusionLevel

func (Light) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Light) LightEmissionLevel

func (l Light) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Light) Model added in v0.0.3

func (Light) Model() world.BlockModel

Model ...

func (Light) ReplaceableBy

func (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 blocks, such as leaves, have this behaviour. A diffusion level of 15 means that all
	// light will be completely blocked when it 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 LitPumpkin added in v0.0.3

type LitPumpkin struct {

	// Facing is the direction the pumpkin is facing.
	Facing world.Direction
	// contains filtered or unexported fields
}

LitPumpkin is a decorative light emitting block crafted with a Carved Pumpkin & Torch

func (LitPumpkin) BreakInfo added in v0.0.3

func (l LitPumpkin) BreakInfo() BreakInfo

BreakInfo ...

func (LitPumpkin) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (LitPumpkin) EncodeItem added in v0.0.3

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

EncodeItem ...

func (LitPumpkin) HasNBT added in v0.0.3

func (LitPumpkin) HasNBT() bool

HasNBT ...

func (LitPumpkin) Hash added in v0.0.3

func (l LitPumpkin) Hash() uint64

Hash ...

func (LitPumpkin) LightEmissionLevel added in v0.0.3

func (l LitPumpkin) LightEmissionLevel() uint8

LightEmissionLevel ...

func (LitPumpkin) Model added in v0.0.3

func (LitPumpkin) Model() world.BlockModel

Model ...

func (LitPumpkin) UseOnBlock added in v0.0.3

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

UseOnBlock ...

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
	// contains filtered or unexported fields
}

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) HasNBT added in v0.0.3

func (Log) HasNBT() bool

HasNBT ...

func (Log) Hash added in v0.0.3

func (l Log) Hash() uint64

Hash ...

func (Log) Model added in v0.0.3

func (Log) Model() world.BlockModel

Model ...

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 Melon added in v0.0.3

type Melon struct {
	// contains filtered or unexported fields
}

Melon is a fruit block that grows from melon stems.

func (Melon) BreakInfo added in v0.0.3

func (m Melon) BreakInfo() BreakInfo

BreakInfo ...

func (Melon) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Melon) EncodeItem added in v0.0.3

func (m Melon) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Melon) HasNBT added in v0.0.3

func (Melon) HasNBT() bool

HasNBT ...

func (Melon) Hash added in v0.0.3

func (m Melon) Hash() uint64

Hash ...

func (Melon) Model added in v0.0.3

func (Melon) Model() world.BlockModel

Model ...

type MelonSeeds added in v0.0.3

type MelonSeeds struct {

	// Direction is the direction from the stem to the melon.
	Direction world.Face
	// contains filtered or unexported fields
}

MelonSeeds grow melon blocks.

func (MelonSeeds) Bonemeal added in v0.0.3

func (m MelonSeeds) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (MelonSeeds) BreakInfo added in v0.0.3

func (m MelonSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (MelonSeeds) CalculateGrowthChance added in v0.0.3

func (c MelonSeeds) CalculateGrowthChance(pos world.BlockPos, w *world.World) float64

CalculateGrowthChance calculates the chance the crop will grow during a random tick.

func (MelonSeeds) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (MelonSeeds) EncodeItem added in v0.0.3

func (m MelonSeeds) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (MelonSeeds) GrowthStage added in v0.0.3

func (c MelonSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (MelonSeeds) HasLiquidDrops added in v0.0.3

func (c MelonSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (MelonSeeds) Hash added in v0.0.3

func (m MelonSeeds) Hash() uint64

Hash ...

func (MelonSeeds) NeighbourUpdateTick added in v0.0.3

func (m MelonSeeds) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (MelonSeeds) RandomTick added in v0.0.3

func (m MelonSeeds) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick ...

func (MelonSeeds) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type NetherGoldOre added in v0.0.3

type NetherGoldOre struct {
	// contains filtered or unexported fields
}

NetherGoldOre is a variant of gold ore found exclusively in The Nether.

func (NetherGoldOre) BreakInfo added in v0.0.3

func (n NetherGoldOre) BreakInfo() BreakInfo

BreakInfo ...

func (NetherGoldOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (NetherGoldOre) EncodeItem added in v0.0.3

func (n NetherGoldOre) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (NetherGoldOre) HasNBT added in v0.0.3

func (NetherGoldOre) HasNBT() bool

HasNBT ...

func (NetherGoldOre) Hash added in v0.0.3

func (n NetherGoldOre) Hash() uint64

Hash ...

func (NetherGoldOre) Model added in v0.0.3

func (NetherGoldOre) Model() world.BlockModel

Model ...

type NetherQuartzOre added in v0.0.3

type NetherQuartzOre struct {
	// contains filtered or unexported fields
}

NetherQuartzOre is ore found in the Nether.

func (NetherQuartzOre) BreakInfo added in v0.0.3

func (q NetherQuartzOre) BreakInfo() BreakInfo

BreakInfo ...

func (NetherQuartzOre) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (NetherQuartzOre) EncodeItem added in v0.0.3

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

EncodeItem ...

func (NetherQuartzOre) HasNBT added in v0.0.3

func (NetherQuartzOre) HasNBT() bool

HasNBT ...

func (NetherQuartzOre) Hash added in v0.0.3

func (NetherQuartzOre) Hash() uint64

Hash ...

func (NetherQuartzOre) Model added in v0.0.3

func (NetherQuartzOre) Model() world.BlockModel

Model ...

type NetheriteBlock added in v0.0.3

type NetheriteBlock struct {
	// contains filtered or unexported fields
}

NetheriteBlock is a precious mineral block made from 9 netherite ingots.

func (NetheriteBlock) BreakInfo added in v0.0.3

func (n NetheriteBlock) BreakInfo() BreakInfo

BreakInfo ...

func (NetheriteBlock) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (NetheriteBlock) EncodeItem added in v0.0.3

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

EncodeItem ...

func (NetheriteBlock) HasNBT added in v0.0.3

func (NetheriteBlock) HasNBT() bool

HasNBT ...

func (NetheriteBlock) Hash added in v0.0.3

func (NetheriteBlock) Hash() uint64

Hash ...

func (NetheriteBlock) Model added in v0.0.3

func (NetheriteBlock) Model() world.BlockModel

Model ...

func (NetheriteBlock) PowersBeacon added in v0.0.3

func (NetheriteBlock) PowersBeacon() bool

PowersBeacon ...

type Netherrack added in v0.0.3

type Netherrack struct {
	// contains filtered or unexported fields
}

Netherrack is a block found in The Nether.

func (Netherrack) BreakInfo added in v0.0.3

func (e Netherrack) BreakInfo() BreakInfo

BreakInfo ...

func (Netherrack) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Netherrack) EncodeItem added in v0.0.3

func (e Netherrack) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Netherrack) HasNBT added in v0.0.3

func (Netherrack) HasNBT() bool

HasNBT ...

func (Netherrack) Hash added in v0.0.3

func (e Netherrack) Hash() uint64

Hash ...

func (Netherrack) Model added in v0.0.3

func (Netherrack) Model() world.BlockModel

Model ...

type Obsidian

type Obsidian struct {
	// contains filtered or unexported fields
}

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 ...

func (Obsidian) HasNBT added in v0.0.3

func (Obsidian) HasNBT() bool

HasNBT ...

func (Obsidian) Hash added in v0.0.3

func (Obsidian) Hash() uint64

Hash ...

func (Obsidian) Model added in v0.0.3

func (Obsidian) Model() world.BlockModel

Model ...

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
	// contains filtered or unexported fields
}

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 ...

func (Planks) HasNBT added in v0.0.3

func (Planks) HasNBT() bool

HasNBT ...

func (Planks) Hash added in v0.0.3

func (p Planks) Hash() uint64

Hash ...

func (Planks) Model added in v0.0.3

func (Planks) Model() world.BlockModel

Model ...

type Potato added in v0.0.3

type Potato struct {
	// contains filtered or unexported fields
}

Potato is a crop that can be consumed raw or cooked to make baked potatoes.

func (Potato) AlwaysConsumable added in v0.0.3

func (p Potato) AlwaysConsumable() bool

AlwaysConsumable ...

func (Potato) Bonemeal added in v0.0.3

func (p Potato) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (Potato) BreakInfo added in v0.0.3

func (p Potato) BreakInfo() BreakInfo

BreakInfo ...

func (Potato) CalculateGrowthChance added in v0.0.3

func (c Potato) CalculateGrowthChance(pos world.BlockPos, w *world.World) float64

CalculateGrowthChance calculates the chance the crop will grow during a random tick.

func (Potato) Consume added in v0.0.3

func (p Potato) Consume(_ *world.World, c item.Consumer) item.Stack

Consume ...

func (Potato) ConsumeDuration added in v0.0.3

func (p Potato) ConsumeDuration() time.Duration

ConsumeDuration ...

func (Potato) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Potato) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Potato) GrowthStage added in v0.0.3

func (c Potato) GrowthStage() int

GrowthStage returns the current stage of growth.

func (Potato) HasLiquidDrops added in v0.0.3

func (c Potato) HasLiquidDrops() bool

HasLiquidDrops ...

func (Potato) Hash added in v0.0.3

func (p Potato) Hash() uint64

Hash ...

func (Potato) NeighbourUpdateTick added in v0.0.3

func (c Potato) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (Potato) RandomTick added in v0.0.3

func (p Potato) RandomTick(pos world.BlockPos, w *world.World, _ *rand.Rand)

RandomTick ...

func (Potato) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type Pumpkin added in v0.0.3

type Pumpkin struct {

	// Carved is whether the pumpkin is carved.
	Carved bool
	// Facing is the direction the pumpkin is facing.
	Facing world.Direction
	// contains filtered or unexported fields
}

Pumpkin is a crop block. Interacting with shears results in the carved variant.

func (Pumpkin) BreakInfo added in v0.0.3

func (p Pumpkin) BreakInfo() BreakInfo

BreakInfo ...

func (Pumpkin) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Pumpkin) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Pumpkin) HasNBT added in v0.0.3

func (Pumpkin) HasNBT() bool

HasNBT ...

func (Pumpkin) Hash added in v0.0.3

func (p Pumpkin) Hash() uint64

Hash ...

func (Pumpkin) Model added in v0.0.3

func (Pumpkin) Model() world.BlockModel

Model ...

func (Pumpkin) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type PumpkinSeeds added in v0.0.3

type PumpkinSeeds struct {

	// Direction is the direction from the stem to the pumpkin.
	Direction world.Face
	// contains filtered or unexported fields
}

PumpkinSeeds grow pumpkin blocks.

func (PumpkinSeeds) Bonemeal added in v0.0.3

func (p PumpkinSeeds) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (PumpkinSeeds) BreakInfo added in v0.0.3

func (p PumpkinSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (PumpkinSeeds) CalculateGrowthChance added in v0.0.3

func (c PumpkinSeeds) CalculateGrowthChance(pos world.BlockPos, w *world.World) float64

CalculateGrowthChance calculates the chance the crop will grow during a random tick.

func (PumpkinSeeds) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (PumpkinSeeds) EncodeItem added in v0.0.3

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

EncodeItem ...

func (PumpkinSeeds) GrowthStage added in v0.0.3

func (c PumpkinSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (PumpkinSeeds) HasLiquidDrops added in v0.0.3

func (c PumpkinSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (PumpkinSeeds) Hash added in v0.0.3

func (p PumpkinSeeds) Hash() uint64

Hash ...

func (PumpkinSeeds) NeighbourUpdateTick added in v0.0.3

func (p PumpkinSeeds) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (PumpkinSeeds) RandomTick added in v0.0.3

func (p PumpkinSeeds) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick ...

func (PumpkinSeeds) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type Quartz added in v0.0.3

type Quartz struct {

	// Smooth specifies if the quartz block is smooth or not.
	Smooth bool
	// contains filtered or unexported fields
}

Quartz is a mineral block used only for decoration.

func (Quartz) BreakInfo added in v0.0.3

func (q Quartz) BreakInfo() BreakInfo

BreakInfo ...

func (Quartz) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Quartz) EncodeItem added in v0.0.3

func (q Quartz) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Quartz) HasNBT added in v0.0.3

func (Quartz) HasNBT() bool

HasNBT ...

func (Quartz) Hash added in v0.0.3

func (q Quartz) Hash() uint64

Hash ...

func (Quartz) Model added in v0.0.3

func (Quartz) Model() world.BlockModel

Model ...

type QuartzBricks added in v0.0.3

type QuartzBricks struct {
	// contains filtered or unexported fields
}

QuartzBricks is a mineral block used only for decoration.

func (QuartzBricks) BreakInfo added in v0.0.3

func (q QuartzBricks) BreakInfo() BreakInfo

BreakInfo ...

func (QuartzBricks) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (QuartzBricks) EncodeItem added in v0.0.3

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

EncodeItem ...

func (QuartzBricks) HasNBT added in v0.0.3

func (QuartzBricks) HasNBT() bool

HasNBT ...

func (QuartzBricks) Hash added in v0.0.3

func (QuartzBricks) Hash() uint64

Hash ...

func (QuartzBricks) Model added in v0.0.3

func (QuartzBricks) Model() world.BlockModel

Model ...

type QuartzPillar added in v0.0.3

type QuartzPillar struct {

	// Axis is the axis which the quartz pillar block faces.
	Axis world.Axis
	// contains filtered or unexported fields
}

QuartzPillar is a mineral block used only for decoration.

func (QuartzPillar) BreakInfo added in v0.0.3

func (q QuartzPillar) BreakInfo() BreakInfo

BreakInfo ...

func (QuartzPillar) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (QuartzPillar) EncodeItem added in v0.0.3

func (q QuartzPillar) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (QuartzPillar) HasNBT added in v0.0.3

func (QuartzPillar) HasNBT() bool

HasNBT ...

func (QuartzPillar) Hash added in v0.0.3

func (q QuartzPillar) Hash() uint64

Hash ...

func (QuartzPillar) Model added in v0.0.3

func (QuartzPillar) Model() world.BlockModel

Model ...

func (QuartzPillar) UseOnBlock added in v0.0.3

func (q QuartzPillar) 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 quartz pillar blocks.

type Replaceable

type Replaceable interface {
	// ReplaceableBy returns a bool which indicates if the block is replaceableWith 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 Sand added in v0.0.3

type Sand struct {

	// Red toggles the red sand variant.
	Red bool
	// contains filtered or unexported fields
}

Sand is a block affected by gravity. It can come in a red variant.

func (Sand) BreakInfo added in v0.0.3

func (s Sand) BreakInfo() BreakInfo

BreakInfo ...

func (Sand) CanSolidify added in v0.0.3

func (g Sand) CanSolidify(world.BlockPos, *world.World) bool

CanSolidify ...

func (Sand) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (Sand) EncodeItem added in v0.0.3

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

EncodeItem ...

func (Sand) HasNBT added in v0.0.3

func (Sand) HasNBT() bool

HasNBT ...

func (Sand) Hash added in v0.0.3

func (s Sand) Hash() uint64

Hash ...

func (Sand) Model added in v0.0.3

func (Sand) Model() world.BlockModel

Model ...

func (Sand) NeighbourUpdateTick added in v0.0.3

func (s Sand) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

type Sponge added in v0.0.2

type Sponge struct {

	// Wet specifies whether the dry or the wet variant of the block is used.
	Wet bool
	// contains filtered or unexported fields
}

Sponge is a block that can be used to remove water around itself when placed, turning into a wet sponge in the process.

func (Sponge) BreakInfo added in v0.0.2

func (s Sponge) BreakInfo() BreakInfo

BreakInfo ...

func (Sponge) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (Sponge) EncodeItem added in v0.0.2

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

EncodeItem ...

func (Sponge) HasNBT added in v0.0.3

func (Sponge) HasNBT() bool

HasNBT ...

func (Sponge) Hash added in v0.0.3

func (s Sponge) Hash() uint64

Hash ...

func (Sponge) Model added in v0.0.3

func (Sponge) Model() world.BlockModel

Model ...

func (Sponge) NeighbourUpdateTick added in v0.0.2

func (s Sponge) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick checks for nearby water flow. If water could be found and the sponge is dry, it will absorb the water and be flagged as wet.

func (Sponge) UseOnBlock added in v0.0.2

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

UseOnBlock places the sponge, absorbs nearby water if it's still dry and flags it as wet if any water has been absorbed.

type StainedGlass added in v0.0.3

type StainedGlass struct {

	// Colour specifies the colour of the block.
	Colour colour.Colour
	// contains filtered or unexported fields
}

StainedGlass is a decorative, fully transparent solid block that is dyed into a different colour.

func (StainedGlass) BreakInfo added in v0.0.3

func (g StainedGlass) BreakInfo() BreakInfo

BreakInfo ...

func (StainedGlass) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (StainedGlass) EncodeItem added in v0.0.3

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

EncodeItem ...

func (StainedGlass) HasNBT added in v0.0.3

func (StainedGlass) HasNBT() bool

HasNBT ...

func (StainedGlass) Hash added in v0.0.3

func (g StainedGlass) Hash() uint64

Hash ...

func (StainedGlass) LightDiffusionLevel added in v0.0.3

func (StainedGlass) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (StainedGlass) Model added in v0.0.3

func (StainedGlass) Model() world.BlockModel

Model ...

type StainedGlassPane added in v0.0.3

type StainedGlassPane struct {

	// Colour specifies the colour of the block.
	Colour colour.Colour
	// contains filtered or unexported fields
}

StainedGlassPane is a transparent block that can be used as a more efficient alternative to glass blocks.

func (StainedGlassPane) BreakInfo added in v0.0.3

func (p StainedGlassPane) BreakInfo() BreakInfo

BreakInfo ...

func (StainedGlassPane) CanDisplace added in v0.0.3

func (p StainedGlassPane) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (StainedGlassPane) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (StainedGlassPane) EncodeItem added in v0.0.3

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

EncodeItem ...

func (StainedGlassPane) HasNBT added in v0.0.3

func (StainedGlassPane) HasNBT() bool

HasNBT ...

func (StainedGlassPane) Hash added in v0.0.3

func (p StainedGlassPane) Hash() uint64

Hash ...

func (StainedGlassPane) LightDiffusionLevel added in v0.0.3

func (StainedGlassPane) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (StainedGlassPane) Model added in v0.0.3

func (StainedGlassPane) Model() world.BlockModel

Model ...

func (StainedGlassPane) SideClosed added in v0.0.3

SideClosed ...

type StainedTerracotta added in v0.0.2

type StainedTerracotta struct {

	// Colour specifies the colour of the block.
	Colour colour.Colour
	// contains filtered or unexported fields
}

StainedTerracotta is a block formed from clay, with a hardness and blast resistance comparable to stone. In contrast to Terracotta, t can be coloured in the same 16 colours that wool can be dyed, but more dulled and earthen.

func (StainedTerracotta) BreakInfo added in v0.0.2

func (t StainedTerracotta) BreakInfo() BreakInfo

BreakInfo ...

func (StainedTerracotta) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (StainedTerracotta) EncodeItem added in v0.0.2

func (t StainedTerracotta) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (StainedTerracotta) HasNBT added in v0.0.3

func (StainedTerracotta) HasNBT() bool

HasNBT ...

func (StainedTerracotta) Hash added in v0.0.3

func (t StainedTerracotta) Hash() uint64

Hash ...

func (StainedTerracotta) Model added in v0.0.3

func (StainedTerracotta) Model() world.BlockModel

Model ...

type Stone

type Stone struct {
	// contains filtered or unexported fields
}

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 ...

func (Stone) HasNBT added in v0.0.3

func (Stone) HasNBT() bool

HasNBT ...

func (Stone) Hash added in v0.0.3

func (Stone) Hash() uint64

Hash ...

func (Stone) Model added in v0.0.3

func (Stone) Model() world.BlockModel

Model ...

type Terracotta added in v0.0.2

type Terracotta struct {
	// contains filtered or unexported fields
}

Terracotta is a block formed from clay, with a hardness and blast resistance comparable to stone. For colouring it, take a look at StainedTerracotta.

func (Terracotta) BreakInfo added in v0.0.2

func (t Terracotta) BreakInfo() BreakInfo

BreakInfo ...

func (Terracotta) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (Terracotta) EncodeItem added in v0.0.2

func (t Terracotta) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Terracotta) HasNBT added in v0.0.3

func (Terracotta) HasNBT() bool

HasNBT ...

func (Terracotta) Hash added in v0.0.3

func (t Terracotta) Hash() uint64

Hash ...

func (Terracotta) Model added in v0.0.3

func (Terracotta) Model() world.BlockModel

Model ...

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
	// contains filtered or unexported fields
}

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) HasNBT added in v0.0.3

func (Water) HasNBT() bool

HasNBT ...

func (Water) Hash added in v0.0.3

func (w Water) Hash() uint64

Hash ...

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) Model added in v0.0.3

func (Water) Model() world.BlockModel

Model ...

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 WheatSeeds added in v0.0.3

type WheatSeeds struct {
	// contains filtered or unexported fields
}

WheatSeeds are a crop that can be harvested to craft bread, cake, & cookies.

func (WheatSeeds) Bonemeal added in v0.0.3

func (s WheatSeeds) Bonemeal(pos world.BlockPos, w *world.World) bool

Bonemeal ...

func (WheatSeeds) BreakInfo added in v0.0.3

func (s WheatSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (WheatSeeds) CalculateGrowthChance added in v0.0.3

func (c WheatSeeds) CalculateGrowthChance(pos world.BlockPos, w *world.World) float64

CalculateGrowthChance calculates the chance the crop will grow during a random tick.

func (WheatSeeds) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (WheatSeeds) EncodeItem added in v0.0.3

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

EncodeItem ...

func (WheatSeeds) GrowthStage added in v0.0.3

func (c WheatSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (WheatSeeds) HasLiquidDrops added in v0.0.3

func (c WheatSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (WheatSeeds) Hash added in v0.0.3

func (s WheatSeeds) Hash() uint64

Hash ...

func (WheatSeeds) NeighbourUpdateTick added in v0.0.3

func (c WheatSeeds) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (WheatSeeds) RandomTick added in v0.0.3

func (s WheatSeeds) RandomTick(pos world.BlockPos, w *world.World, _ *rand.Rand)

RandomTick ...

func (WheatSeeds) UseOnBlock added in v0.0.3

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

UseOnBlock ...

type WoodDoor added in v0.0.3

type WoodDoor struct {

	// Wood is the type of wood of the door. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
	// Facing is the direction the door is facing.
	Facing world.Direction
	// Open is whether or not the door is open.
	Open bool
	// Top is whether the block is the top or bottom half of a door
	Top bool
	// Right is whether the door hinge is on the right side
	Right bool
	// contains filtered or unexported fields
}

WoodDoor is a block that can be used as an openable 1x2 barrier.

func (WoodDoor) Activate added in v0.0.3

func (d WoodDoor) Activate(pos world.BlockPos, _ world.Face, w *world.World, _ item.User)

Activate ...

func (WoodDoor) BreakInfo added in v0.0.3

func (d WoodDoor) BreakInfo() BreakInfo

BreakInfo ...

func (WoodDoor) CanDisplace added in v0.0.3

func (d WoodDoor) CanDisplace(l world.Liquid) bool

CanDisplace ...

func (WoodDoor) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (WoodDoor) EncodeItem added in v0.0.3

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

EncodeItem ...

func (WoodDoor) HasNBT added in v0.0.3

func (WoodDoor) HasNBT() bool

HasNBT ...

func (WoodDoor) Hash added in v0.0.3

func (d WoodDoor) Hash() uint64

Hash ...

func (WoodDoor) LightDiffusionLevel added in v0.0.3

func (WoodDoor) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodDoor) Model added in v0.0.3

func (d WoodDoor) Model() world.BlockModel

Model ...

func (WoodDoor) NeighbourUpdateTick added in v0.0.3

func (d WoodDoor) NeighbourUpdateTick(pos, _ world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (WoodDoor) SideClosed added in v0.0.3

func (d WoodDoor) SideClosed(world.BlockPos, world.BlockPos, *world.World) bool

SideClosed ...

func (WoodDoor) UseOnBlock added in v0.0.3

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

UseOnBlock handles the directional placing of doors

type WoodFenceGate added in v0.0.3

type WoodFenceGate struct {

	// Wood is the type of wood of the fence gate. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
	// Facing is the direction the fence gate swings open.
	Facing world.Direction
	// Open is whether the fence gate is open.
	Open bool
	// Lowered lowers the fence gate by 3 pixels and is set when placed next to wall blocks.
	Lowered bool
	// contains filtered or unexported fields
}

WoodFenceGate is a block that can be used as an openable 1x1 barrier.

func (WoodFenceGate) Activate added in v0.0.3

func (f WoodFenceGate) Activate(pos world.BlockPos, clickedFace world.Face, w *world.World, u item.User)

Activate ...

func (WoodFenceGate) CanDisplace added in v0.0.3

func (f WoodFenceGate) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (WoodFenceGate) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (WoodFenceGate) EncodeItem added in v0.0.3

func (f WoodFenceGate) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (WoodFenceGate) HasNBT added in v0.0.3

func (WoodFenceGate) HasNBT() bool

HasNBT ...

func (WoodFenceGate) Hash added in v0.0.3

func (f WoodFenceGate) Hash() uint64

Hash ...

func (WoodFenceGate) LightDiffusionLevel added in v0.0.3

func (WoodFenceGate) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodFenceGate) Model added in v0.0.3

func (f WoodFenceGate) Model() world.BlockModel

Model ...

func (WoodFenceGate) SideClosed added in v0.0.3

func (f WoodFenceGate) SideClosed(pos, side world.BlockPos, w *world.World) bool

SideClosed ...

func (WoodFenceGate) UseOnBlock added in v0.0.3

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

UseOnBlock ...

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
	// Top specifies if the slab is in the top part of the block.
	Top 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
	// contains filtered or unexported fields
}

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) HasNBT added in v0.0.3

func (WoodSlab) HasNBT() bool

HasNBT ...

func (WoodSlab) Hash added in v0.0.3

func (s WoodSlab) Hash() uint64

Hash ...

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) Model added in v0.0.3

func (s WoodSlab) Model() world.BlockModel

Model ...

func (WoodSlab) SideClosed

func (s WoodSlab) SideClosed(pos, side world.BlockPos, _ *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
	// contains filtered or unexported fields
}

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

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) HasNBT added in v0.0.3

func (WoodStairs) HasNBT() bool

HasNBT ...

func (WoodStairs) Hash added in v0.0.3

func (s WoodStairs) Hash() uint64

Hash ...

func (WoodStairs) LightDiffusionLevel

func (WoodStairs) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodStairs) Model added in v0.0.3

func (s WoodStairs) Model() world.BlockModel

Model ...

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.

type WoodTrapdoor added in v0.0.3

type WoodTrapdoor struct {

	// Wood is the type of wood of the trapdoor. This field must have one of the values found in the material
	// package.
	Wood wood.Wood
	// Facing is the direction the trapdoor is facing.
	Facing world.Direction
	// Open is whether or not the trapdoor is open.
	Open bool
	// Top is whether the trapdoor occupies the top or bottom part of a block.
	Top bool
	// contains filtered or unexported fields
}

WoodTrapdoor is a block that can be used as an openable 1x1 barrier.

func (WoodTrapdoor) Activate added in v0.0.3

func (t WoodTrapdoor) Activate(pos world.BlockPos, _ world.Face, w *world.World, _ item.User)

Activate ...

func (WoodTrapdoor) BreakInfo added in v0.0.3

func (t WoodTrapdoor) BreakInfo() BreakInfo

BreakInfo ...

func (WoodTrapdoor) CanDisplace added in v0.0.3

func (t WoodTrapdoor) CanDisplace(l world.Liquid) bool

CanDisplace ...

func (WoodTrapdoor) EncodeBlock added in v0.0.3

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

EncodeBlock ...

func (WoodTrapdoor) EncodeItem added in v0.0.3

func (t WoodTrapdoor) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (WoodTrapdoor) HasNBT added in v0.0.3

func (WoodTrapdoor) HasNBT() bool

HasNBT ...

func (WoodTrapdoor) Hash added in v0.0.3

func (t WoodTrapdoor) Hash() uint64

Hash ...

func (WoodTrapdoor) LightDiffusionLevel added in v0.0.3

func (WoodTrapdoor) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodTrapdoor) Model added in v0.0.3

func (t WoodTrapdoor) Model() world.BlockModel

Model ...

func (WoodTrapdoor) SideClosed added in v0.0.3

SideClosed ...

func (WoodTrapdoor) UseOnBlock added in v0.0.3

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

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

type Wool added in v0.0.2

type Wool struct {

	// Colour is the colour of the wool.
	Colour colour.Colour
	// contains filtered or unexported fields
}

Wool is a colourful block that can be obtained by killing/shearing sheep, or crafted using four string.

func (Wool) BreakInfo added in v0.0.2

func (w Wool) BreakInfo() BreakInfo

BreakInfo ...

func (Wool) EncodeBlock added in v0.0.2

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

EncodeBlock ...

func (Wool) EncodeItem added in v0.0.2

func (w Wool) EncodeItem() (id int32, meta int16)

EncodeItem ...

func (Wool) HasNBT added in v0.0.3

func (Wool) HasNBT() bool

HasNBT ...

func (Wool) Hash added in v0.0.3

func (w Wool) Hash() uint64

Hash ...

func (Wool) Model added in v0.0.3

func (Wool) Model() world.BlockModel

Model ...

type XPDropRange added in v0.0.3

type XPDropRange [2]int

XPDropRange holds the min & max XP drop amounts of blocks.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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