block

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 36 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 FlammableBlock

func FlammableBlock(block world.Block) bool

FlammableBlock returns true if a block is flammable.

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) EncodeItem

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

EncodeItem ...

func (Air) HasLiquidDrops

func (Air) HasLiquidDrops() bool

HasLiquidDrops ...

func (Air) HasNBT

func (Air) HasNBT() bool

HasNBT ...

func (Air) LightDiffusionLevel

func (Air) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Air) Model

func (Air) Model() world.BlockModel

Model ...

func (Air) ReplaceableBy

func (Air) ReplaceableBy(world.Block) bool

ReplaceableBy ...

type AncientDebris

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

AncientDebris is a rare ore found within The Nether.

func (AncientDebris) BreakInfo

func (a AncientDebris) BreakInfo() BreakInfo

BreakInfo ...

func (AncientDebris) EncodeItem

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

EncodeItem ...

func (AncientDebris) HasNBT

func (AncientDebris) HasNBT() bool

HasNBT ...

func (AncientDebris) Model

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) EncodeItem

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

EncodeItem ...

type Barrier

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

Barrier is a transparent solid block used to create invisible boundaries.

func (Barrier) EncodeItem

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

EncodeItem ...

func (Barrier) HasNBT

func (Barrier) HasNBT() bool

HasNBT ...

func (Barrier) LightDiffusionLevel

func (Barrier) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Barrier) Model

func (Barrier) Model() world.BlockModel

Model ...

type Basalt

type Basalt struct {

	// Polished specifies if the basalt is its polished variant.
	Polished bool
	// Axis is the axis which the basalt faces.
	Axis world.Axis
	// contains filtered or unexported fields
}

Basalt is a type of igneous rock found in the Nether.

func (Basalt) BreakInfo

func (b Basalt) BreakInfo() BreakInfo

BreakInfo ...

func (Basalt) EncodeBlock

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

EncodeBlock ...

func (Basalt) EncodeItem

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

EncodeItem ...

func (Basalt) HasNBT

func (Basalt) HasNBT() bool

HasNBT ...

func (Basalt) Hash

func (b Basalt) Hash() uint64

Hash ...

func (Basalt) Instrument

func (Basalt) Instrument() instrument.Instrument

Instrument ...

func (Basalt) Model

func (Basalt) Model() world.BlockModel

Model ...

func (Basalt) UseOnBlock

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

UseOnBlock ...

type Beacon

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

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

func (b Beacon) BreakInfo() BreakInfo

BreakInfo ...

func (Beacon) CanDisplace

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

CanDisplace ...

func (Beacon) DecodeNBT

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

DecodeNBT ...

func (Beacon) EncodeItem

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

EncodeItem ...

func (Beacon) EncodeNBT

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

EncodeNBT ...

func (Beacon) HasNBT

func (Beacon) HasNBT() bool

HasNBT ...

func (Beacon) Instrument

func (Beacon) Instrument() instrument.Instrument

Instrument ...

func (Beacon) Level

func (b Beacon) Level() int

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

func (Beacon) LightDiffusionLevel

func (Beacon) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Beacon) LightEmissionLevel

func (Beacon) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Beacon) Model

func (Beacon) Model() world.BlockModel

Model ...

func (Beacon) SideClosed

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

SideClosed ...

func (Beacon) Tick

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

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

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

func (Bedrock) HasNBT() bool

HasNBT ...

func (Bedrock) Hash

func (b Bedrock) Hash() uint64

Hash ...

func (Bedrock) Instrument

func (Bedrock) Instrument() instrument.Instrument

Instrument ...

func (Bedrock) LightDiffusionLevel

func (Bedrock) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Bedrock) Model

func (Bedrock) Model() world.BlockModel

Model ...

type BeetrootSeeds

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

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

BoneMeal ...

func (BeetrootSeeds) BreakInfo

func (b BeetrootSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (BeetrootSeeds) CalculateGrowthChance

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

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

EncodeBlock ...

func (BeetrootSeeds) EncodeItem

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

EncodeItem ...

func (BeetrootSeeds) GrowthStage

func (c BeetrootSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (BeetrootSeeds) HasLiquidDrops

func (c BeetrootSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (BeetrootSeeds) Hash

func (b BeetrootSeeds) Hash() uint64

Hash ...

func (BeetrootSeeds) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (BeetrootSeeds) RandomTick

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

RandomTick ...

func (BeetrootSeeds) SameCrop

func (BeetrootSeeds) SameCrop(c Crop) bool

SameCrop ...

func (BeetrootSeeds) UseOnBlock

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

UseOnBlock ...

type BlueIce

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

BlueIce is a solid block similar to packed ice.

func (BlueIce) BreakInfo

func (b BlueIce) BreakInfo() BreakInfo

BreakInfo ...

func (BlueIce) EncodeItem

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

EncodeItem ...

func (BlueIce) HasNBT

func (BlueIce) HasNBT() bool

HasNBT ...

func (BlueIce) LightEmissionLevel

func (BlueIce) LightEmissionLevel() uint8

LightEmissionLevel ...

func (BlueIce) Model

func (BlueIce) Model() world.BlockModel

Model ...

type BoneBlock

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

func (b BoneBlock) BreakInfo() BreakInfo

BreakInfo ...

func (BoneBlock) EncodeBlock

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

EncodeBlock ...

func (BoneBlock) EncodeItem

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

EncodeItem ...

func (BoneBlock) HasNBT

func (BoneBlock) HasNBT() bool

HasNBT ...

func (BoneBlock) Hash

func (b BoneBlock) Hash() uint64

Hash ...

func (BoneBlock) Instrument

func (b BoneBlock) Instrument() instrument.Instrument

Instrument ...

func (BoneBlock) Model

func (BoneBlock) Model() world.BlockModel

Model ...

func (BoneBlock) UseOnBlock

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

type BoneMealAffected interface {
	// BoneMeal attempts to affect the block using a bone meal item.
	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 Bricks

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

Bricks are decorative building blocks.

func (Bricks) BreakInfo

func (b Bricks) BreakInfo() BreakInfo

BreakInfo ...

func (Bricks) EncodeItem

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

EncodeItem ...

func (Bricks) HasNBT

func (Bricks) HasNBT() bool

HasNBT ...

func (Bricks) Instrument

func (Bricks) Instrument() instrument.Instrument

Instrument ...

func (Bricks) Model

func (Bricks) Model() world.BlockModel

Model ...

type Cake

type Cake struct {

	// Bites is the amount of bites taken out of the cake.
	Bites int
	// contains filtered or unexported fields
}

Cake is an edible block.

func (Cake) Activate

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

Activate ...

func (Cake) BreakInfo

func (c Cake) BreakInfo() BreakInfo

BreakInfo ...

func (Cake) CanDisplace

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

CanDisplace ...

func (Cake) EncodeBlock

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

EncodeBlock ...

func (Cake) EncodeItem

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

EncodeItem ...

func (Cake) HasNBT

func (Cake) HasNBT() bool

HasNBT ...

func (Cake) Hash

func (c Cake) Hash() uint64

Hash ...

func (Cake) LightDiffusionLevel

func (Cake) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Cake) Model

func (c Cake) Model() world.BlockModel

Model ...

func (Cake) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Cake) SideClosed

func (c Cake) SideClosed(world.BlockPos, world.BlockPos, *world.World) bool

SideClosed ...

func (Cake) UseOnBlock

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

UseOnBlock ...

type Carpet

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

func (c Carpet) BreakInfo() BreakInfo

BreakInfo ...

func (Carpet) CanDisplace

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

CanDisplace ...

func (Carpet) EncodeBlock

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

EncodeBlock ...

func (Carpet) EncodeItem

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

EncodeItem ...

func (Carpet) FlammabilityInfo

func (c Carpet) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Carpet) HasLiquidDrops

func (Carpet) HasLiquidDrops() bool

HasLiquidDrops ...

func (Carpet) HasNBT

func (Carpet) HasNBT() bool

HasNBT ...

func (Carpet) Hash

func (c Carpet) Hash() uint64

Hash ...

func (Carpet) LightDiffusionLevel

func (Carpet) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Carpet) Model

func (Carpet) Model() world.BlockModel

Model ...

func (Carpet) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Carpet) SideClosed

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

SideClosed ...

func (Carpet) UseOnBlock

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

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

Carrot is a crop that can be consumed raw.

func (Carrot) AlwaysConsumable

func (c Carrot) AlwaysConsumable() bool

AlwaysConsumable ...

func (Carrot) BoneMeal

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

BoneMeal ...

func (Carrot) BreakInfo

func (c Carrot) BreakInfo() BreakInfo

BreakInfo ...

func (Carrot) CalculateGrowthChance

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

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

Consume ...

func (Carrot) ConsumeDuration

func (c Carrot) ConsumeDuration() time.Duration

ConsumeDuration ...

func (Carrot) EncodeBlock

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

EncodeBlock ...

func (Carrot) EncodeItem

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

EncodeItem ...

func (Carrot) GrowthStage

func (c Carrot) GrowthStage() int

GrowthStage returns the current stage of growth.

func (Carrot) HasLiquidDrops

func (c Carrot) HasLiquidDrops() bool

HasLiquidDrops ...

func (Carrot) Hash

func (c Carrot) Hash() uint64

Hash ...

func (Carrot) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Carrot) RandomTick

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

RandomTick ...

func (Carrot) SameCrop

func (Carrot) SameCrop(c Crop) bool

SameCrop ...

func (Carrot) UseOnBlock

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(). TODO: Redo inventory stuff in here. The inventory should be moved to a different place in world.World so

that this block can be hashed properly.

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) FlammabilityInfo

func (c Chest) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Chest) HasNBT

func (Chest) HasNBT() bool

HasNBT ...

func (Chest) Hash

func (c Chest) Hash() uint64

Hash ...

func (Chest) Instrument

func (Chest) Instrument() instrument.Instrument

Instrument ...

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

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

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

ChiseledQuartz is a mineral block used only for decoration.

func (ChiseledQuartz) BreakInfo

func (c ChiseledQuartz) BreakInfo() BreakInfo

BreakInfo ...

func (ChiseledQuartz) EncodeBlock

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

EncodeBlock ...

func (ChiseledQuartz) EncodeItem

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

EncodeItem ...

func (ChiseledQuartz) HasNBT

func (ChiseledQuartz) HasNBT() bool

HasNBT ...

func (ChiseledQuartz) Hash

func (ChiseledQuartz) Hash() uint64

Hash ...

func (ChiseledQuartz) Instrument

func (ChiseledQuartz) Instrument() instrument.Instrument

Instrument ...

func (ChiseledQuartz) Model

func (ChiseledQuartz) Model() world.BlockModel

Model ...

type Clay

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

Clay is a block that can be found underwater.

func (Clay) BreakInfo

func (c Clay) BreakInfo() BreakInfo

BreakInfo ...

func (Clay) EncodeBlock

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

EncodeBlock ...

func (Clay) EncodeItem

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

EncodeItem ...

func (Clay) HasNBT

func (Clay) HasNBT() bool

HasNBT ...

func (Clay) Hash

func (c Clay) Hash() uint64

Hash ...

func (Clay) Instrument

func (c Clay) Instrument() instrument.Instrument

Instrument ...

func (Clay) Model

func (Clay) Model() world.BlockModel

Model ...

type CoalBlock

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

CoalBlock is a precious mineral block made from 9 coal.

func (CoalBlock) BreakInfo

func (c CoalBlock) BreakInfo() BreakInfo

BreakInfo ...

func (CoalBlock) EncodeBlock

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

EncodeBlock ...

func (CoalBlock) EncodeItem

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

EncodeItem ...

func (CoalBlock) FlammabilityInfo

func (c CoalBlock) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (CoalBlock) HasNBT

func (CoalBlock) HasNBT() bool

HasNBT ...

func (CoalBlock) Hash

func (CoalBlock) Hash() uint64

Hash ...

func (CoalBlock) Instrument

func (CoalBlock) Instrument() instrument.Instrument

Instrument ...

func (CoalBlock) Model

func (CoalBlock) Model() world.BlockModel

Model ...

type CoalOre

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

CoalOre is a common ore.

func (CoalOre) BreakInfo

func (c CoalOre) BreakInfo() BreakInfo

BreakInfo ...

func (CoalOre) EncodeItem

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

EncodeItem ...

func (CoalOre) HasNBT

func (CoalOre) HasNBT() bool

HasNBT ...

func (CoalOre) Instrument

func (CoalOre) Instrument() instrument.Instrument

Instrument ...

func (CoalOre) Model

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) EncodeItem

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

EncodeItem ...

func (Cobblestone) HasNBT

func (Cobblestone) HasNBT() bool

HasNBT ...

func (Cobblestone) Instrument

func (Cobblestone) Instrument() instrument.Instrument

Instrument ...

func (Cobblestone) Model

func (Cobblestone) Model() world.BlockModel

Model ...

type CocoaBean

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

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

BoneMeal ...

func (CocoaBean) BreakInfo

func (c CocoaBean) BreakInfo() BreakInfo

BreakInfo ...

func (CocoaBean) EncodeBlock

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

EncodeBlock ...

func (CocoaBean) EncodeItem

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

EncodeItem ...

func (CocoaBean) HasLiquidDrops

func (c CocoaBean) HasLiquidDrops() bool

HasLiquidDrops ...

func (CocoaBean) HasNBT

func (CocoaBean) HasNBT() bool

HasNBT ...

func (CocoaBean) Hash

func (c CocoaBean) Hash() uint64

Hash ...

func (CocoaBean) LightDiffusionLevel

func (CocoaBean) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (CocoaBean) Model

func (c CocoaBean) Model() world.BlockModel

Model ...

func (CocoaBean) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (CocoaBean) RandomTick

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

RandomTick ...

func (CocoaBean) UseOnBlock

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

func (Concrete) HasNBT() bool

HasNBT ...

func (Concrete) Hash

func (c Concrete) Hash() uint64

Hash ...

func (Concrete) Instrument

func (Concrete) Instrument() instrument.Instrument

Instrument ...

func (Concrete) Model

func (Concrete) Model() world.BlockModel

Model ...

type ConcretePowder

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

func (c ConcretePowder) BreakInfo() BreakInfo

BreakInfo ...

func (ConcretePowder) CanSolidify

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

CanSolidify ...

func (ConcretePowder) EncodeBlock

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

EncodeBlock ...

func (ConcretePowder) EncodeItem

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

EncodeItem ...

func (ConcretePowder) HasNBT

func (ConcretePowder) HasNBT() bool

HasNBT ...

func (ConcretePowder) Hash

func (c ConcretePowder) Hash() uint64

Hash ...

func (ConcretePowder) Instrument

func (ConcretePowder) Instrument() instrument.Instrument

Instrument ...

func (ConcretePowder) Model

func (ConcretePowder) Model() world.BlockModel

Model ...

func (ConcretePowder) NeighbourUpdateTick

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

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

func (c Coral) BreakInfo() BreakInfo

BreakInfo ...

func (Coral) CanDisplace

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

CanDisplace ...

func (Coral) EncodeBlock

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

EncodeBlock ...

func (Coral) EncodeItem

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

EncodeItem ...

func (Coral) HasLiquidDrops

func (c Coral) HasLiquidDrops() bool

HasLiquidDrops ...

func (Coral) HasNBT

func (Coral) HasNBT() bool

HasNBT ...

func (Coral) Hash

func (c Coral) Hash() uint64

Hash ...

func (Coral) Instrument

func (Coral) Instrument() instrument.Instrument

Instrument ...

func (Coral) LightDiffusionLevel

func (Coral) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Coral) Model

func (Coral) Model() world.BlockModel

Model ...

func (Coral) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Coral) ScheduledTick

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

ScheduledTick ...

func (Coral) SideClosed

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

SideClosed ...

func (Coral) UseOnBlock

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

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

func (c CoralBlock) BreakInfo() BreakInfo

BreakInfo ...

func (CoralBlock) EncodeBlock

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

EncodeBlock ...

func (CoralBlock) EncodeItem

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

EncodeItem ...

func (CoralBlock) HasNBT

func (CoralBlock) HasNBT() bool

HasNBT ...

func (CoralBlock) Hash

func (c CoralBlock) Hash() uint64

Hash ...

func (CoralBlock) Instrument

func (CoralBlock) Instrument() instrument.Instrument

Instrument ...

func (CoralBlock) Model

func (CoralBlock) Model() world.BlockModel

Model ...

func (CoralBlock) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (CoralBlock) ScheduledTick

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

ScheduledTick ...

type Crop

type Crop interface {
	// GrowthStage returns the crop's current stage of growth. The max value is 7.
	GrowthStage() int
	// SameCrop checks if two crops are of the same type.
	SameCrop(c Crop) bool
}

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

type CryingObsidian

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

CryingObsidian is a luminous variant of obsidian that can be used to craft a respawn anchor and produces purple particles when placed.

func (CryingObsidian) BreakInfo

func (c CryingObsidian) BreakInfo() BreakInfo

BreakInfo ...

func (CryingObsidian) EncodeItem

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

EncodeItem ...

func (CryingObsidian) HasNBT

func (CryingObsidian) HasNBT() bool

HasNBT ...

func (CryingObsidian) Instrument

func (CryingObsidian) Instrument() instrument.Instrument

Instrument ...

func (CryingObsidian) LightEmissionLevel

func (CryingObsidian) LightEmissionLevel() uint8

LightEmissionLevel ...

func (CryingObsidian) Model

func (CryingObsidian) Model() world.BlockModel

Model ...

type DiamondBlock

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

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

func (DiamondBlock) BreakInfo

func (d DiamondBlock) BreakInfo() BreakInfo

BreakInfo ...

func (DiamondBlock) EncodeItem

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

EncodeItem ...

func (DiamondBlock) HasNBT

func (DiamondBlock) HasNBT() bool

HasNBT ...

func (DiamondBlock) Model

func (DiamondBlock) Model() world.BlockModel

Model ...

func (DiamondBlock) PowersBeacon

func (DiamondBlock) PowersBeacon() bool

PowersBeacon ...

type DiamondOre

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

DiamondOre is a rare ore that generates underground.

func (DiamondOre) BreakInfo

func (d DiamondOre) BreakInfo() BreakInfo

BreakInfo ...

func (DiamondOre) EncodeItem

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

EncodeItem ...

func (DiamondOre) HasNBT

func (DiamondOre) HasNBT() bool

HasNBT ...

func (DiamondOre) Instrument

func (DiamondOre) Instrument() instrument.Instrument

Instrument ...

func (DiamondOre) Model

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) EncodeItem

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

EncodeItem ...

type Dirt

type Dirt struct {

	// Coarse specifies if the dirt should be off the coarse dirt variant. Grass blocks won't spread on
	// the block if set to true.
	Coarse bool
	// 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) EncodeItem

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

EncodeItem ...

func (Dirt) HasNBT

func (Dirt) HasNBT() bool

HasNBT ...

func (Dirt) Model

func (Dirt) Model() world.BlockModel

Model ...

type DragonEgg

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

DragonEgg is a decorative block or a "trophy item", and the rarest item in the game.

func (DragonEgg) Activate

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

Activate ...

func (DragonEgg) BreakInfo

func (d DragonEgg) BreakInfo() BreakInfo

BreakInfo ...

func (DragonEgg) CanDisplace

func (d DragonEgg) CanDisplace(b world.Liquid) bool

CanDisplace ...

func (DragonEgg) CanSolidify

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

CanSolidify ...

func (DragonEgg) EncodeItem

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

EncodeItem ...

func (DragonEgg) HasNBT

func (DragonEgg) HasNBT() bool

HasNBT ...

func (DragonEgg) LightDiffusionLevel

func (DragonEgg) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (DragonEgg) LightEmissionLevel

func (d DragonEgg) LightEmissionLevel() uint8

LightEmissionLevel ...

func (DragonEgg) Model

func (DragonEgg) Model() world.BlockModel

Model ...

func (DragonEgg) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (DragonEgg) Punch

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

Punch ...

func (DragonEgg) SideClosed

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

SideClosed ...

type EmeraldBlock

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

EmeraldBlock is a precious mineral block crafted using 9 emeralds.

func (EmeraldBlock) BreakInfo

func (e EmeraldBlock) BreakInfo() BreakInfo

BreakInfo ...

func (EmeraldBlock) EncodeItem

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

EncodeItem ...

func (EmeraldBlock) HasNBT

func (EmeraldBlock) HasNBT() bool

HasNBT ...

func (EmeraldBlock) Instrument

func (e EmeraldBlock) Instrument() instrument.Instrument

Instrument ...

func (EmeraldBlock) Model

func (EmeraldBlock) Model() world.BlockModel

Model ...

func (EmeraldBlock) PowersBeacon

func (EmeraldBlock) PowersBeacon() bool

PowersBeacon ...

type EmeraldOre

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

EmeraldOre is an ore generating exclusively under mountain biomes.

func (EmeraldOre) BreakInfo

func (e EmeraldOre) BreakInfo() BreakInfo

BreakInfo ...

func (EmeraldOre) EncodeItem

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

EncodeItem ...

func (EmeraldOre) HasNBT

func (EmeraldOre) HasNBT() bool

HasNBT ...

func (EmeraldOre) Instrument

func (EmeraldOre) Instrument() instrument.Instrument

Instrument ...

func (EmeraldOre) Model

func (EmeraldOre) Model() world.BlockModel

Model ...

type EndBrickStairs

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

func (s EndBrickStairs) BreakInfo() BreakInfo

BreakInfo ...

func (EndBrickStairs) CanDisplace

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

CanDisplace ...

func (EndBrickStairs) EncodeBlock

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

EncodeBlock ...

func (EndBrickStairs) EncodeItem

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

EncodeItem ...

func (EndBrickStairs) HasNBT

func (EndBrickStairs) HasNBT() bool

HasNBT ...

func (EndBrickStairs) Hash

func (s EndBrickStairs) Hash() uint64

Hash ...

func (EndBrickStairs) LightDiffusionLevel

func (EndBrickStairs) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (EndBrickStairs) Model

func (s EndBrickStairs) Model() world.BlockModel

Model ...

func (EndBrickStairs) SideClosed

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

SideClosed ...

func (EndBrickStairs) UseOnBlock

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

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

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

func (EndBricks) BreakInfo

func (c EndBricks) BreakInfo() BreakInfo

BreakInfo ...

func (EndBricks) EncodeItem

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

EncodeItem ...

func (EndBricks) HasNBT

func (EndBricks) HasNBT() bool

HasNBT ...

func (EndBricks) Instrument

func (EndBricks) Instrument() instrument.Instrument

Instrument ...

func (EndBricks) Model

func (EndBricks) Model() world.BlockModel

Model ...

type EndStone

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

EndStone is a block found in The End.

func (EndStone) BreakInfo

func (e EndStone) BreakInfo() BreakInfo

BreakInfo ...

func (EndStone) EncodeItem

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

EncodeItem ...

func (EndStone) HasNBT

func (EndStone) HasNBT() bool

HasNBT ...

func (EndStone) Instrument

func (EndStone) Instrument() instrument.Instrument

Instrument ...

func (EndStone) Model

func (EndStone) Model() world.BlockModel

Model ...

type EntityCollider

type EntityCollider interface {
	// EntityCollide is called on entity collision.
	EntityCollide(e world.Entity)
}

EntityCollider is an interface for blocks with special behaviors on entity collision.

type Farmland

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
	// decreases 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

func (f Farmland) BreakInfo() BreakInfo

BreakInfo ...

func (Farmland) EncodeBlock

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

EncodeBlock ...

func (Farmland) HasNBT

func (Farmland) HasNBT() bool

HasNBT ...

func (Farmland) Hash

func (f Farmland) Hash() uint64

Hash ...

func (Farmland) Model

func (Farmland) Model() world.BlockModel

Model ...

func (Farmland) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Farmland) RandomTick

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

RandomTick ...

type Fire

type Fire struct {

	// Type is the type of fire.
	Type fire.Fire
	// Age affects how fire extinguishes. Newly placed fire starts at 0 and the value has a 1/3 chance of incrementing
	// each block tick.
	Age int
	// contains filtered or unexported fields
}

Fire is a non-solid block that can spread to nearby flammable blocks.

func (Fire) EncodeBlock

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

EncodeBlock ...

func (Fire) EntityCollide

func (f Fire) EntityCollide(e world.Entity)

EntityCollide ...

func (Fire) HasLiquidDrops

func (f Fire) HasLiquidDrops() bool

HasLiquidDrops ...

func (Fire) HasNBT

func (Fire) HasNBT() bool

HasNBT ...

func (Fire) Hash

func (f Fire) Hash() uint64

Hash ...

func (Fire) LightDiffusionLevel

func (Fire) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Fire) LightEmissionLevel

func (f Fire) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Fire) Model

func (Fire) Model() world.BlockModel

Model ...

func (Fire) NeighbourUpdateTick

func (f Fire) NeighbourUpdateTick(pos, neighbour world.BlockPos, w *world.World)

NeighbourUpdateTick ...

func (Fire) RandomTick

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

RandomTick ...

func (Fire) ReplaceableBy

func (Fire) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (Fire) ScheduledTick

func (f Fire) ScheduledTick(pos world.BlockPos, w *world.World)

ScheduledTick ...

type FlammabilityInfo

type FlammabilityInfo struct {
	// Encouragement is the chance a block will catch on fire during attempted fire spread.
	Encouragement,

	Flammability int
	// LavaFlammable returns whether it can catch on fire from lava.
	LavaFlammable bool
}

FlammabilityInfo contains values related to block behaviors involving fire.

type Flammable

type Flammable interface {
	// FlammabilityInfo returns information about a blocks behavior involving fire.
	FlammabilityInfo() FlammabilityInfo
}

Flammable is an interface for blocks that can catch on fire.

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 GildedBlackstone

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

GildedBlackstone is a variant of blackstone that can drop itself or gold nuggets when mined.

func (GildedBlackstone) BreakInfo

func (b GildedBlackstone) BreakInfo() BreakInfo

BreakInfo ...

func (GildedBlackstone) EncodeItem

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

EncodeItem ...

func (GildedBlackstone) HasNBT

func (GildedBlackstone) HasNBT() bool

HasNBT ...

func (GildedBlackstone) Model

func (GildedBlackstone) Model() world.BlockModel

Model ...

type Glass

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

func (g Glass) BreakInfo() BreakInfo

BreakInfo ...

func (Glass) EncodeItem

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

EncodeItem ...

func (Glass) HasNBT

func (Glass) HasNBT() bool

HasNBT ...

func (Glass) Instrument

func (Glass) Instrument() instrument.Instrument

Instrument ...

func (Glass) LightDiffusionLevel

func (Glass) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Glass) Model

func (Glass) Model() world.BlockModel

Model ...

type GlassPane

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

func (p GlassPane) BreakInfo() BreakInfo

BreakInfo ...

func (GlassPane) CanDisplace

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

CanDisplace ...

func (GlassPane) EncodeItem

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

EncodeItem ...

func (GlassPane) HasNBT

func (GlassPane) HasNBT() bool

HasNBT ...

func (GlassPane) Instrument

func (GlassPane) Instrument() instrument.Instrument

Instrument ...

func (GlassPane) LightDiffusionLevel

func (GlassPane) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (GlassPane) Model

func (GlassPane) Model() world.BlockModel

Model ...

func (GlassPane) SideClosed

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

SideClosed ...

type GlazedTerracotta

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

func (t GlazedTerracotta) BreakInfo() BreakInfo

BreakInfo ...

func (GlazedTerracotta) EncodeBlock

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

EncodeBlock ...

func (GlazedTerracotta) EncodeItem

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

EncodeItem ...

func (GlazedTerracotta) HasNBT

func (GlazedTerracotta) HasNBT() bool

HasNBT ...

func (GlazedTerracotta) Hash

func (t GlazedTerracotta) Hash() uint64

Hash ...

func (GlazedTerracotta) Instrument

func (GlazedTerracotta) Instrument() instrument.Instrument

Instrument ...

func (GlazedTerracotta) Model

func (GlazedTerracotta) Model() world.BlockModel

Model ...

func (GlazedTerracotta) UseOnBlock

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

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

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

func (Glowstone) BreakInfo

func (g Glowstone) BreakInfo() BreakInfo

BreakInfo ...

func (Glowstone) EncodeItem

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

EncodeItem ...

func (Glowstone) HasNBT

func (Glowstone) HasNBT() bool

HasNBT ...

func (Glowstone) Instrument

func (g Glowstone) Instrument() instrument.Instrument

Instrument ...

func (Glowstone) LightEmissionLevel

func (Glowstone) LightEmissionLevel() uint8

LightEmissionLevel returns 15.

func (Glowstone) Model

func (Glowstone) Model() world.BlockModel

Model ...

type GoldBlock

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

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

func (GoldBlock) BreakInfo

func (g GoldBlock) BreakInfo() BreakInfo

BreakInfo ...

func (GoldBlock) EncodeItem

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

EncodeItem ...

func (GoldBlock) HasNBT

func (GoldBlock) HasNBT() bool

HasNBT ...

func (GoldBlock) Instrument

func (g GoldBlock) Instrument() instrument.Instrument

Instrument ...

func (GoldBlock) Model

func (GoldBlock) Model() world.BlockModel

Model ...

func (GoldBlock) PowersBeacon

func (GoldBlock) PowersBeacon() bool

PowersBeacon ...

type GoldOre

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

GoldOre is a rare mineral block found underground.

func (GoldOre) BreakInfo

func (g GoldOre) BreakInfo() BreakInfo

BreakInfo ...

func (GoldOre) EncodeItem

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

EncodeItem ...

func (GoldOre) HasNBT

func (GoldOre) HasNBT() bool

HasNBT ...

func (GoldOre) Instrument

func (GoldOre) Instrument() instrument.Instrument

Instrument ...

func (GoldOre) Model

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) EncodeItem

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

EncodeItem ...

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) EncodeItem

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

EncodeItem ...

func (Grass) HasNBT

func (Grass) HasNBT() bool

HasNBT ...

func (Grass) Model

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

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

func (p GrassPath) BreakInfo() BreakInfo

BreakInfo ...

func (GrassPath) EncodeItem

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

EncodeItem ...

func (GrassPath) HasNBT

func (GrassPath) HasNBT() bool

HasNBT ...

func (GrassPath) LightDiffusionLevel

func (GrassPath) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (GrassPath) Model

func (GrassPath) Model() world.BlockModel

Model ...

func (GrassPath) NeighbourUpdateTick

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

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

func (g Gravel) BreakInfo() BreakInfo

BreakInfo ...

func (Gravel) CanSolidify

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

CanSolidify ...

func (Gravel) EncodeItem

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

EncodeItem ...

func (Gravel) HasNBT

func (Gravel) HasNBT() bool

HasNBT ...

func (Gravel) Instrument

func (Gravel) Instrument() instrument.Instrument

Instrument ...

func (Gravel) Model

func (Gravel) Model() world.BlockModel

Model ...

func (Gravel) NeighbourUpdateTick

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

NeighbourUpdateTick ...

type GravityAffected

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 InstrumentBlock

type InstrumentBlock interface {
	// Instrument returns the instrument used.
	Instrument() instrument.Instrument
}

InstrumentBlock represents a block that creates a note block sound other than the piano.

type InvisibleBedrock

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

InvisibleBedrock is an indestructible, solid block, similar to bedrock and has the appearance of air. It shares many of its properties with barriers.

func (InvisibleBedrock) EncodeItem

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

EncodeItem ...

func (InvisibleBedrock) HasNBT

func (InvisibleBedrock) HasNBT() bool

HasNBT ...

func (InvisibleBedrock) LightDiffusionLevel

func (InvisibleBedrock) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (InvisibleBedrock) Model

func (InvisibleBedrock) Model() world.BlockModel

Model ...

type IronBars

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

func (i IronBars) BreakInfo() BreakInfo

BreakInfo ...

func (IronBars) CanDisplace

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

CanDisplace ...

func (IronBars) EncodeItem

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

EncodeItem ...

func (IronBars) HasNBT

func (IronBars) HasNBT() bool

HasNBT ...

func (IronBars) LightDiffusionLevel

func (IronBars) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (IronBars) Model

func (IronBars) Model() world.BlockModel

Model ...

func (IronBars) SideClosed

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

SideClosed ...

type IronBlock

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

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

func (IronBlock) BreakInfo

func (i IronBlock) BreakInfo() BreakInfo

BreakInfo ...

func (IronBlock) EncodeItem

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

EncodeItem ...

func (IronBlock) HasNBT

func (IronBlock) HasNBT() bool

HasNBT ...

func (IronBlock) Instrument

func (i IronBlock) Instrument() instrument.Instrument

Instrument ...

func (IronBlock) Model

func (IronBlock) Model() world.BlockModel

Model ...

func (IronBlock) PowersBeacon

func (IronBlock) PowersBeacon() bool

PowersBeacon ...

type IronOre

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

IronOre is a mineral block found underground.

func (IronOre) BreakInfo

func (i IronOre) BreakInfo() BreakInfo

BreakInfo ...

func (IronOre) EncodeItem

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

EncodeItem ...

func (IronOre) HasNBT

func (IronOre) HasNBT() bool

HasNBT ...

func (IronOre) Instrument

func (IronOre) Instrument() instrument.Instrument

Instrument ...

func (IronOre) Model

func (IronOre) Model() world.BlockModel

Model ...

type Kelp

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

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

BoneMeal ...

func (Kelp) BreakInfo

func (k Kelp) BreakInfo() BreakInfo

BreakInfo ...

func (Kelp) CanDisplace

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

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

func (Kelp) EncodeBlock

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

EncodeBlock ...

func (Kelp) EncodeItem

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

EncodeItem ...

func (Kelp) HasNBT

func (Kelp) HasNBT() bool

HasNBT ...

func (Kelp) Hash

func (k Kelp) Hash() uint64

Hash ...

func (Kelp) LightDiffusionLevel

func (Kelp) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Kelp) Model

func (Kelp) Model() world.BlockModel

Model ...

func (Kelp) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Kelp) RandomTick

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

RandomTick ...

func (Kelp) SideClosed

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

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

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

func (l Lantern) BreakInfo() BreakInfo

BreakInfo ...

func (Lantern) EncodeBlock

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

EncodeBlock ...

func (Lantern) EncodeItem

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

EncodeItem ...

func (Lantern) HasLiquidDrops

func (l Lantern) HasLiquidDrops() bool

HasLiquidDrops ...

func (Lantern) HasNBT

func (Lantern) HasNBT() bool

HasNBT ...

func (Lantern) Hash

func (l Lantern) Hash() uint64

Hash ...

func (Lantern) LightDiffusionLevel

func (Lantern) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Lantern) LightEmissionLevel

func (l Lantern) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Lantern) Model

func (l Lantern) Model() world.BlockModel

Model ...

func (Lantern) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Lantern) UseOnBlock

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

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

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

func (LapisBlock) BreakInfo

func (l LapisBlock) BreakInfo() BreakInfo

BreakInfo ...

func (LapisBlock) EncodeItem

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

EncodeItem ...

func (LapisBlock) HasNBT

func (LapisBlock) HasNBT() bool

HasNBT ...

func (LapisBlock) Model

func (LapisBlock) Model() world.BlockModel

Model ...

type LapisOre

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

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

func (LapisOre) BreakInfo

func (l LapisOre) BreakInfo() BreakInfo

BreakInfo ...

func (LapisOre) EncodeItem

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

EncodeItem ...

func (LapisOre) HasNBT

func (LapisOre) HasNBT() bool

HasNBT ...

func (LapisOre) Instrument

func (LapisOre) Instrument() instrument.Instrument

Instrument ...

func (LapisOre) Model

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

AABB returns no boxes.

func (Lava) EncodeBlock

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

EncodeBlock ...

func (Lava) EntityCollide

func (l Lava) EntityCollide(e world.Entity)

EntityCollide ...

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

func (Lava) HasNBT() bool

HasNBT ...

func (Lava) Hash

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

func (Lava) Model() world.BlockModel

Model ...

func (Lava) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Lava) RandomTick

func (l Lava) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick ...

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) FlammabilityInfo

func (l Leaves) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Leaves) HasNBT

func (Leaves) HasNBT() bool

HasNBT ...

func (Leaves) Hash

func (l Leaves) Hash() uint64

Hash ...

func (Leaves) LightDiffusionLevel

func (Leaves) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Leaves) Model

func (Leaves) Model() world.BlockModel

Model ...

func (Leaves) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Leaves) RandomTick

func (l Leaves) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick ...

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

func (Light) HasNBT() bool

HasNBT ...

func (Light) Hash

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

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

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

func (l LitPumpkin) BreakInfo() BreakInfo

BreakInfo ...

func (LitPumpkin) EncodeBlock

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

EncodeBlock ...

func (LitPumpkin) EncodeItem

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

EncodeItem ...

func (LitPumpkin) HasNBT

func (LitPumpkin) HasNBT() bool

HasNBT ...

func (LitPumpkin) Hash

func (l LitPumpkin) Hash() uint64

Hash ...

func (LitPumpkin) LightEmissionLevel

func (l LitPumpkin) LightEmissionLevel() uint8

LightEmissionLevel ...

func (LitPumpkin) Model

func (LitPumpkin) Model() world.BlockModel

Model ...

func (LitPumpkin) UseOnBlock

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) FlammabilityInfo

func (l Log) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Log) HasNBT

func (Log) HasNBT() bool

HasNBT ...

func (Log) Hash

func (l Log) Hash() uint64

Hash ...

func (Log) Instrument

func (Log) Instrument() instrument.Instrument

Instrument ...

func (Log) Model

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

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

Melon is a fruit block that grows from melon stems.

func (Melon) BreakInfo

func (m Melon) BreakInfo() BreakInfo

BreakInfo ...

func (Melon) EncodeItem

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

EncodeItem ...

func (Melon) HasNBT

func (Melon) HasNBT() bool

HasNBT ...

func (Melon) Model

func (Melon) Model() world.BlockModel

Model ...

type MelonSeeds

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

MelonSeeds grow melon blocks.

func (MelonSeeds) BoneMeal

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

BoneMeal ...

func (MelonSeeds) BreakInfo

func (m MelonSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (MelonSeeds) CalculateGrowthChance

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

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

EncodeBlock ...

func (MelonSeeds) EncodeItem

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

EncodeItem ...

func (MelonSeeds) GrowthStage

func (c MelonSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (MelonSeeds) HasLiquidDrops

func (c MelonSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (MelonSeeds) Hash

func (m MelonSeeds) Hash() uint64

Hash ...

func (MelonSeeds) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (MelonSeeds) RandomTick

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

RandomTick ...

func (MelonSeeds) SameCrop

func (MelonSeeds) SameCrop(c Crop) bool

SameCrop ...

func (MelonSeeds) UseOnBlock

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

UseOnBlock ...

type NetherBrickFence

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

NetherBrickFence is the nether brick variant of the fence block.

func (NetherBrickFence) BreakInfo

func (n NetherBrickFence) BreakInfo() BreakInfo

BreakInfo ...

func (NetherBrickFence) CanDisplace

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

CanDisplace ...

func (NetherBrickFence) EncodeItem

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

EncodeItem ...

func (NetherBrickFence) HasNBT

func (NetherBrickFence) HasNBT() bool

HasNBT ...

func (NetherBrickFence) LightDiffusionLevel

func (NetherBrickFence) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (NetherBrickFence) Model

func (n NetherBrickFence) Model() world.BlockModel

Model ...

func (NetherBrickFence) SideClosed

SideClosed ...

type NetherGoldOre

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

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

func (NetherGoldOre) BreakInfo

func (n NetherGoldOre) BreakInfo() BreakInfo

BreakInfo ...

func (NetherGoldOre) EncodeItem

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

EncodeItem ...

func (NetherGoldOre) HasNBT

func (NetherGoldOre) HasNBT() bool

HasNBT ...

func (NetherGoldOre) Model

func (NetherGoldOre) Model() world.BlockModel

Model ...

type NetherQuartzOre

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

NetherQuartzOre is ore found in the Nether.

func (NetherQuartzOre) BreakInfo

func (q NetherQuartzOre) BreakInfo() BreakInfo

BreakInfo ...

func (NetherQuartzOre) EncodeItem

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

EncodeItem ...

func (NetherQuartzOre) HasNBT

func (NetherQuartzOre) HasNBT() bool

HasNBT ...

func (NetherQuartzOre) Instrument

func (NetherQuartzOre) Instrument() instrument.Instrument

Instrument ...

func (NetherQuartzOre) Model

func (NetherQuartzOre) Model() world.BlockModel

Model ...

type NetherWart

type NetherWart struct {

	// Age is the age of the nether wart block. 3 is fully grown.
	Age int
	// contains filtered or unexported fields
}

NetherWart is a fungus found in the Nether that is vital in the creation of potions.

func (NetherWart) BreakInfo

func (n NetherWart) BreakInfo() BreakInfo

BreakInfo ...

func (NetherWart) EncodeBlock

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

EncodeBlock ...

func (NetherWart) EncodeItem

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

EncodeItem ...

func (NetherWart) HasLiquidDrops

func (n NetherWart) HasLiquidDrops() bool

HasLiquidDrops ...

func (NetherWart) HasNBT

func (NetherWart) HasNBT() bool

HasNBT ...

func (NetherWart) Hash

func (n NetherWart) Hash() uint64

Hash ...

func (NetherWart) LightDiffusionLevel

func (NetherWart) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (NetherWart) Model

func (NetherWart) Model() world.BlockModel

Model ...

func (NetherWart) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (NetherWart) RandomTick

func (n NetherWart) RandomTick(pos world.BlockPos, w *world.World, r *rand.Rand)

RandomTick ...

func (NetherWart) UseOnBlock

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

UseOnBlock ...

type NetheriteBlock

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

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

func (NetheriteBlock) BreakInfo

func (n NetheriteBlock) BreakInfo() BreakInfo

BreakInfo ...

func (NetheriteBlock) EncodeItem

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

EncodeItem ...

func (NetheriteBlock) HasNBT

func (NetheriteBlock) HasNBT() bool

HasNBT ...

func (NetheriteBlock) Instrument

func (NetheriteBlock) Instrument() instrument.Instrument

Instrument ...

func (NetheriteBlock) Model

func (NetheriteBlock) Model() world.BlockModel

Model ...

func (NetheriteBlock) PowersBeacon

func (NetheriteBlock) PowersBeacon() bool

PowersBeacon ...

type Netherrack

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

Netherrack is a block found in The Nether.

func (Netherrack) BreakInfo

func (e Netherrack) BreakInfo() BreakInfo

BreakInfo ...

func (Netherrack) EncodeItem

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

EncodeItem ...

func (Netherrack) HasNBT

func (Netherrack) HasNBT() bool

HasNBT ...

func (Netherrack) Instrument

func (Netherrack) Instrument() instrument.Instrument

Instrument ...

func (Netherrack) Model

func (Netherrack) Model() world.BlockModel

Model ...

type NoteBlock

type NoteBlock struct {

	// Pitch is the current pitch the note block is set to. Value ranges from 0-24.
	Pitch int
	// contains filtered or unexported fields
}

NoteBlock is a musical block that emits sounds when powered with redstone.

func (NoteBlock) Activate

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

Activate ...

func (NoteBlock) BreakInfo

func (n NoteBlock) BreakInfo() BreakInfo

BreakInfo ...

func (NoteBlock) DecodeNBT

func (n NoteBlock) DecodeNBT(data map[string]interface{}) interface{}

DecodeNBT ...

func (NoteBlock) EncodeItem

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

EncodeItem ...

func (NoteBlock) EncodeNBT

func (n NoteBlock) EncodeNBT() map[string]interface{}

EncodeNBT ...

func (NoteBlock) HasNBT

func (NoteBlock) HasNBT() bool

HasNBT ...

func (NoteBlock) Instrument

func (NoteBlock) Instrument() instrument.Instrument

Instrument ...

func (NoteBlock) Model

func (NoteBlock) Model() world.BlockModel

Model ...

func (NoteBlock) Punch

func (n NoteBlock) Punch(pos world.BlockPos, _ world.Face, w *world.World, u item.User)

Punch ...

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) EncodeItem

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

EncodeItem ...

func (Obsidian) HasNBT

func (Obsidian) HasNBT() bool

HasNBT ...

func (Obsidian) Instrument

func (Obsidian) Instrument() instrument.Instrument

Instrument ...

func (Obsidian) Model

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) FlammabilityInfo

func (p Planks) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Planks) HasNBT

func (Planks) HasNBT() bool

HasNBT ...

func (Planks) Hash

func (p Planks) Hash() uint64

Hash ...

func (Planks) Instrument

func (Planks) Instrument() instrument.Instrument

Instrument ...

func (Planks) Model

func (Planks) Model() world.BlockModel

Model ...

type Potato

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

func (p Potato) AlwaysConsumable() bool

AlwaysConsumable ...

func (Potato) BoneMeal

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

BoneMeal ...

func (Potato) BreakInfo

func (p Potato) BreakInfo() BreakInfo

BreakInfo ...

func (Potato) CalculateGrowthChance

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

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

Consume ...

func (Potato) ConsumeDuration

func (p Potato) ConsumeDuration() time.Duration

ConsumeDuration ...

func (Potato) EncodeBlock

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

EncodeBlock ...

func (Potato) EncodeItem

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

EncodeItem ...

func (Potato) GrowthStage

func (c Potato) GrowthStage() int

GrowthStage returns the current stage of growth.

func (Potato) HasLiquidDrops

func (c Potato) HasLiquidDrops() bool

HasLiquidDrops ...

func (Potato) Hash

func (p Potato) Hash() uint64

Hash ...

func (Potato) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Potato) RandomTick

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

RandomTick ...

func (Potato) SameCrop

func (Potato) SameCrop(c Crop) bool

SameCrop ...

func (Potato) UseOnBlock

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

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

func (p Pumpkin) BreakInfo() BreakInfo

BreakInfo ...

func (Pumpkin) EncodeBlock

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

EncodeBlock ...

func (Pumpkin) EncodeItem

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

EncodeItem ...

func (Pumpkin) HasNBT

func (Pumpkin) HasNBT() bool

HasNBT ...

func (Pumpkin) Hash

func (p Pumpkin) Hash() uint64

Hash ...

func (Pumpkin) Instrument

func (p Pumpkin) Instrument() instrument.Instrument

Instrument ...

func (Pumpkin) Model

func (Pumpkin) Model() world.BlockModel

Model ...

func (Pumpkin) UseOnBlock

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

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

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

BoneMeal ...

func (PumpkinSeeds) BreakInfo

func (p PumpkinSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (PumpkinSeeds) CalculateGrowthChance

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

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

EncodeBlock ...

func (PumpkinSeeds) EncodeItem

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

EncodeItem ...

func (PumpkinSeeds) GrowthStage

func (c PumpkinSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (PumpkinSeeds) HasLiquidDrops

func (c PumpkinSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (PumpkinSeeds) Hash

func (p PumpkinSeeds) Hash() uint64

Hash ...

func (PumpkinSeeds) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (PumpkinSeeds) RandomTick

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

RandomTick ...

func (PumpkinSeeds) SameCrop

func (PumpkinSeeds) SameCrop(c Crop) bool

SameCrop ...

func (PumpkinSeeds) UseOnBlock

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

UseOnBlock ...

type Punchable

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

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

type Quartz

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

func (q Quartz) BreakInfo() BreakInfo

BreakInfo ...

func (Quartz) EncodeBlock

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

EncodeBlock ...

func (Quartz) EncodeItem

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

EncodeItem ...

func (Quartz) HasNBT

func (Quartz) HasNBT() bool

HasNBT ...

func (Quartz) Hash

func (q Quartz) Hash() uint64

Hash ...

func (Quartz) Instrument

func (Quartz) Instrument() instrument.Instrument

Instrument ...

func (Quartz) Model

func (Quartz) Model() world.BlockModel

Model ...

type QuartzBricks

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

QuartzBricks is a mineral block used only for decoration.

func (QuartzBricks) BreakInfo

func (q QuartzBricks) BreakInfo() BreakInfo

BreakInfo ...

func (QuartzBricks) EncodeItem

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

EncodeItem ...

func (QuartzBricks) HasNBT

func (QuartzBricks) HasNBT() bool

HasNBT ...

func (QuartzBricks) Instrument

func (QuartzBricks) Instrument() instrument.Instrument

Instrument ...

func (QuartzBricks) Model

func (QuartzBricks) Model() world.BlockModel

Model ...

type QuartzPillar

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

func (q QuartzPillar) BreakInfo() BreakInfo

BreakInfo ...

func (QuartzPillar) EncodeBlock

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

EncodeBlock ...

func (QuartzPillar) EncodeItem

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

EncodeItem ...

func (QuartzPillar) HasNBT

func (QuartzPillar) HasNBT() bool

HasNBT ...

func (QuartzPillar) Hash

func (q QuartzPillar) Hash() uint64

Hash ...

func (QuartzPillar) Instrument

func (QuartzPillar) Instrument() instrument.Instrument

Instrument ...

func (QuartzPillar) Model

func (QuartzPillar) Model() world.BlockModel

Model ...

func (QuartzPillar) UseOnBlock

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

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

func (s Sand) BreakInfo() BreakInfo

BreakInfo ...

func (Sand) CanSolidify

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

CanSolidify ...

func (Sand) EncodeItem

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

EncodeItem ...

func (Sand) HasNBT

func (Sand) HasNBT() bool

HasNBT ...

func (Sand) Instrument

func (Sand) Instrument() instrument.Instrument

Instrument ...

func (Sand) Model

func (Sand) Model() world.BlockModel

Model ...

func (Sand) NeighbourUpdateTick

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

NeighbourUpdateTick ...

type SeaLantern

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

SeaLantern is an underwater light sources that appear in ocean monuments and underwater ruins.

func (SeaLantern) BreakInfo

func (s SeaLantern) BreakInfo() BreakInfo

BreakInfo ...

func (SeaLantern) EncodeItem

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

EncodeItem ...

func (SeaLantern) HasNBT

func (SeaLantern) HasNBT() bool

HasNBT ...

func (SeaLantern) Instrument

func (SeaLantern) Instrument() instrument.Instrument

Instrument ...

func (SeaLantern) LightDiffusionLevel

func (SeaLantern) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (SeaLantern) LightEmissionLevel

func (SeaLantern) LightEmissionLevel() uint8

LightEmissionLevel ...

func (SeaLantern) Model

func (SeaLantern) Model() world.BlockModel

Model ...

type Shroomlight

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

Shroomlight are light-emitting blocks that generate in huge fungi.

func (Shroomlight) BreakInfo

func (s Shroomlight) BreakInfo() BreakInfo

BreakInfo ...

func (Shroomlight) EncodeItem

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

EncodeItem ...

func (Shroomlight) HasNBT

func (Shroomlight) HasNBT() bool

HasNBT ...

func (Shroomlight) LightEmissionLevel

func (Shroomlight) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Shroomlight) Model

func (Shroomlight) Model() world.BlockModel

Model ...

type SoulSand

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

SoulSand is a block found naturally only in the Nether. SoulSand slows movement of mobs & players.

func (SoulSand) BreakInfo

func (s SoulSand) BreakInfo() BreakInfo

BreakInfo ...

func (SoulSand) EncodeItem

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

EncodeItem ...

func (SoulSand) HasNBT

func (SoulSand) HasNBT() bool

HasNBT ...

func (SoulSand) Instrument

func (s SoulSand) Instrument() instrument.Instrument

Instrument ...

func (SoulSand) Model

func (SoulSand) Model() world.BlockModel

Model ...

type SoulSoil

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

SoulSoil is a block naturally found only in the soul sand valley.

func (SoulSoil) BreakInfo

func (s SoulSoil) BreakInfo() BreakInfo

BreakInfo ...

func (SoulSoil) EncodeItem

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

EncodeItem ...

func (SoulSoil) HasNBT

func (SoulSoil) HasNBT() bool

HasNBT ...

func (SoulSoil) Model

func (SoulSoil) Model() world.BlockModel

Model ...

type Sponge

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

func (s Sponge) BreakInfo() BreakInfo

BreakInfo ...

func (Sponge) EncodeItem

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

EncodeItem ...

func (Sponge) HasNBT

func (Sponge) HasNBT() bool

HasNBT ...

func (Sponge) Model

func (Sponge) Model() world.BlockModel

Model ...

func (Sponge) NeighbourUpdateTick

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

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

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

func (g StainedGlass) BreakInfo() BreakInfo

BreakInfo ...

func (StainedGlass) EncodeBlock

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

EncodeBlock ...

func (StainedGlass) EncodeItem

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

EncodeItem ...

func (StainedGlass) HasNBT

func (StainedGlass) HasNBT() bool

HasNBT ...

func (StainedGlass) Hash

func (g StainedGlass) Hash() uint64

Hash ...

func (StainedGlass) Instrument

func (StainedGlass) Instrument() instrument.Instrument

Instrument ...

func (StainedGlass) LightDiffusionLevel

func (StainedGlass) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (StainedGlass) Model

func (StainedGlass) Model() world.BlockModel

Model ...

type StainedGlassPane

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

func (p StainedGlassPane) BreakInfo() BreakInfo

BreakInfo ...

func (StainedGlassPane) CanDisplace

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

CanDisplace ...

func (StainedGlassPane) EncodeBlock

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

EncodeBlock ...

func (StainedGlassPane) EncodeItem

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

EncodeItem ...

func (StainedGlassPane) HasNBT

func (StainedGlassPane) HasNBT() bool

HasNBT ...

func (StainedGlassPane) Hash

func (p StainedGlassPane) Hash() uint64

Hash ...

func (StainedGlassPane) Instrument

func (StainedGlassPane) Instrument() instrument.Instrument

Instrument ...

func (StainedGlassPane) LightDiffusionLevel

func (StainedGlassPane) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (StainedGlassPane) Model

func (StainedGlassPane) Model() world.BlockModel

Model ...

func (StainedGlassPane) SideClosed

SideClosed ...

type StainedTerracotta

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

func (t StainedTerracotta) BreakInfo() BreakInfo

BreakInfo ...

func (StainedTerracotta) EncodeBlock

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

EncodeBlock ...

func (StainedTerracotta) EncodeItem

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

EncodeItem ...

func (StainedTerracotta) HasNBT

func (StainedTerracotta) HasNBT() bool

HasNBT ...

func (StainedTerracotta) Hash

func (t StainedTerracotta) Hash() uint64

Hash ...

func (StainedTerracotta) Instrument

func (StainedTerracotta) Instrument() instrument.Instrument

Instrument ...

func (StainedTerracotta) Model

func (StainedTerracotta) Model() world.BlockModel

Model ...

type Stone

type Stone struct {

	// Smooth specifies if the stone is its smooth variant.
	Smooth bool
	// 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) EncodeItem

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

EncodeItem ...

func (Stone) HasNBT

func (Stone) HasNBT() bool

HasNBT ...

func (Stone) Instrument

func (Stone) Instrument() instrument.Instrument

Instrument ...

func (Stone) Model

func (Stone) Model() world.BlockModel

Model ...

type Terracotta

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

func (t Terracotta) BreakInfo() BreakInfo

BreakInfo ...

func (Terracotta) EncodeItem

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

EncodeItem ...

func (Terracotta) HasNBT

func (Terracotta) HasNBT() bool

HasNBT ...

func (Terracotta) Instrument

func (Terracotta) Instrument() instrument.Instrument

Instrument ...

func (Terracotta) Model

func (Terracotta) Model() world.BlockModel

Model ...

type Torch

type Torch struct {

	// Facing is the direction from the torch to the block.
	Facing world.Face
	// Type is the type of fire lighting the torch.
	Type fire.Fire
	// contains filtered or unexported fields
}

Torch are non-solid blocks that emit light.

func (Torch) EncodeBlock

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

EncodeBlock ...

func (Torch) EncodeItem

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

EncodeItem ...

func (Torch) HasLiquidDrops

func (t Torch) HasLiquidDrops() bool

HasLiquidDrops ...

func (Torch) HasNBT

func (Torch) HasNBT() bool

HasNBT ...

func (Torch) Hash

func (t Torch) Hash() uint64

Hash ...

func (Torch) LightDiffusionLevel

func (Torch) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Torch) LightEmissionLevel

func (t Torch) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Torch) Model

func (Torch) Model() world.BlockModel

Model ...

func (Torch) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Torch) UseOnBlock

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

UseOnBlock ...

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