block

package
v0.9.19 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 26 Imported by: 52

Documentation

Overview

Package block exports implementations of the Block interface found in the server/world package. The blocks implemented in this package are automatically registered in the server/world package using the world.RegisterBlock and world.RegisterItem functions through an init function, so that methods in server/world that return blocks and items are able to return them by the respective types implemented here.

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 NextHash added in v0.9.12

func NextHash() uint64

NextHash returns the next free hash for custom blocks.

func SlabBlocks added in v0.8.0

func SlabBlocks() []world.Block

SlabBlocks returns a list of all possible blocks for a slab.

func StairsBlocks added in v0.8.0

func StairsBlocks() []world.Block

StairsBlocks returns a list of all possible blocks for stairs.

func WallBlocks added in v0.8.0

func WallBlocks() []world.Block

WallBlocks returns a list of all possible blocks for a wall.

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 returns a bool indicating if activating the block was used successfully.
	Activate(pos cube.Pos, clickedFace cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool
}

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

func (Air) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Air) EncodeItem

func (Air) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Air) HasLiquidDrops

func (Air) HasLiquidDrops() bool

HasLiquidDrops ...

func (Air) Hash

func (Air) Hash() (uint64, uint64)

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 Amethyst added in v0.7.3

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

Amethyst is a decorative block crafted from four amethyst shards.

func (Amethyst) BreakInfo added in v0.7.3

func (a Amethyst) BreakInfo() BreakInfo

BreakInfo ...

func (Amethyst) EncodeBlock added in v0.7.3

func (Amethyst) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Amethyst) EncodeItem added in v0.7.3

func (Amethyst) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Amethyst) Hash added in v0.7.3

func (Amethyst) Hash() (uint64, uint64)

func (Amethyst) Model added in v0.7.3

func (Amethyst) Model() world.BlockModel

Model ...

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

func (AncientDebris) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (AncientDebris) EncodeItem

func (AncientDebris) EncodeItem() (name string, meta int16)

EncodeItem ...

func (AncientDebris) Hash

func (AncientDebris) Hash() (uint64, uint64)

func (AncientDebris) Model

func (AncientDebris) Model() world.BlockModel

Model ...

func (AncientDebris) SmeltInfo added in v0.8.0

func (AncientDebris) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type Andesite

type Andesite polishable

Andesite is a type of igneous rock.

func (Andesite) BreakInfo

func (a Andesite) BreakInfo() BreakInfo

BreakInfo ...

func (Andesite) EncodeBlock

func (a Andesite) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Andesite) EncodeItem

func (a Andesite) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Andesite) Hash

func (a Andesite) Hash() (uint64, uint64)

type Anvil added in v0.7.3

type Anvil struct {

	// Type is the type of anvil.
	Type AnvilType
	// Facing is the direction that the anvil is facing.
	Facing cube.Direction
	// contains filtered or unexported fields
}

Anvil is a block that allows players to repair items, rename items, and combine enchantments.

func (Anvil) Activate added in v0.7.3

func (Anvil) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Anvil) Break added in v0.7.3

func (a Anvil) Break() world.Block

Break breaks the anvil and moves it to the next damage stage. If the anvil is at the last damage stage, it will be destroyed.

func (Anvil) BreakInfo added in v0.7.3

func (a Anvil) BreakInfo() BreakInfo

BreakInfo ...

func (Anvil) Damage added in v0.7.3

func (Anvil) Damage() (damagePerBlock, maxDamage float64)

Damage returns the damage per block fallen of the anvil and the maximum damage the anvil can deal.

func (Anvil) EncodeBlock added in v0.7.3

func (a Anvil) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Anvil) EncodeItem added in v0.7.3

func (a Anvil) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Anvil) Hash added in v0.7.3

func (a Anvil) Hash() (uint64, uint64)

func (Anvil) Landed added in v0.7.3

func (Anvil) Landed(w *world.World, pos cube.Pos)

Landed is called when a falling anvil hits the ground, used to, for example, play a sound.

func (Anvil) LightDiffusionLevel added in v0.7.3

func (Anvil) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Anvil) Model added in v0.7.3

func (a Anvil) Model() world.BlockModel

Model ...

func (Anvil) NeighbourUpdateTick added in v0.7.3

func (a Anvil) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Anvil) Solidifies added in v0.7.3

func (g Anvil) Solidifies(cube.Pos, *world.World) bool

Solidifies ...

func (Anvil) UseOnBlock added in v0.7.3

func (a Anvil) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

type AnvilType added in v0.7.3

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

AnvilType represents a type of anvil, such as undamaged, slightly damaged, or very damaged.

func AnvilTypes added in v0.7.3

func AnvilTypes() []AnvilType

AnvilTypes returns all anvil types.

func SlightlyDamagedAnvil added in v0.7.3

func SlightlyDamagedAnvil() AnvilType

SlightlyDamagedAnvil returns the slightly damaged anvil type.

func UndamagedAnvil added in v0.7.3

func UndamagedAnvil() AnvilType

UndamagedAnvil returns the undamaged anvil type.

func VeryDamagedAnvil added in v0.7.3

func VeryDamagedAnvil() AnvilType

VeryDamagedAnvil returns the very damaged anvil type.

func (AnvilType) String added in v0.7.3

func (a AnvilType) String() string

String returns the anvil type as a string.

func (AnvilType) Uint8 added in v0.7.3

func (a AnvilType) Uint8() uint8

Uint8 returns the anvil type as a uint8.

type Attachment added in v0.2.0

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

Attachment describes the attachment of a block to another block. It is either of the type WallAttachment, which can only have 90 degree facing values, or StandingAttachment, which has more freedom using a cube.Orientation.

func StandingAttachment added in v0.2.0

func StandingAttachment(o cube.Orientation) Attachment

StandingAttachment returns an Attachment to the ground with an orientation.

func WallAttachment added in v0.2.0

func WallAttachment(facing cube.Direction) Attachment

WallAttachment returns an Attachment to a wall with a facing direction.

func (Attachment) FaceUint8 added in v0.6.0

func (a Attachment) FaceUint8() uint8

FaceUint8 returns the facing of the Attachment as a uint8.

func (Attachment) RotateLeft added in v0.2.0

func (a Attachment) RotateLeft() Attachment

RotateLeft rotates the Attachment the left way around by 90 degrees.

func (Attachment) RotateRight added in v0.2.0

func (a Attachment) RotateRight() Attachment

RotateRight rotates the Attachment the right way around by 90 degrees.

func (Attachment) Rotation added in v0.9.7

func (a Attachment) Rotation() cube.Rotation

Rotation returns the rotation of the Attachment, based on the orientation if it's a StandingAttachment, or the facing direction if it is a WallAttachment.

func (Attachment) Uint8 added in v0.2.0

func (a Attachment) Uint8() uint8

Uint8 returns the Attachment as a uint8.

type Banner struct {

	// Colour is the colour of the banner.
	Colour item.Colour
	// Attach is the attachment of the Banner. It is either of the type WallAttachment or StandingAttachment.
	Attach Attachment
	// Patterns represents the patterns the Banner should show when rendering.
	Patterns []BannerPatternLayer
	// Illager returns true if the banner is an illager banner.
	Illager bool
	// contains filtered or unexported fields
}

Banner is a tall decorative block that can be customized.

func (Banner) BreakInfo added in v0.8.0

func (b Banner) BreakInfo() BreakInfo

BreakInfo ...

func (Banner) DecodeNBT added in v0.8.0

func (b Banner) DecodeNBT(m map[string]any) any

DecodeNBT ...

func (Banner) EncodeBlock added in v0.8.0

func (b Banner) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Banner) EncodeItem added in v0.8.0

func (b Banner) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Banner) EncodeNBT added in v0.8.0

func (b Banner) EncodeNBT() map[string]any

EncodeNBT ...

func (Banner) FuelInfo added in v0.8.0

func (Banner) FuelInfo() item.FuelInfo

FuelInfo ...

func (Banner) Hash added in v0.8.0

func (b Banner) Hash() (uint64, uint64)

func (Banner) LightDiffusionLevel added in v0.8.0

func (Banner) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Banner) MaxCount added in v0.8.0

func (Banner) MaxCount() int

MaxCount ...

func (Banner) Model added in v0.8.0

func (Banner) Model() world.BlockModel

Model ...

func (Banner) NeighbourUpdateTick added in v0.8.0

func (b Banner) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Banner) UseOnBlock added in v0.8.0

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

UseOnBlock ...

type BannerPatternLayer added in v0.8.0

type BannerPatternLayer struct {
	// Type represents the type of banner pattern.
	Type BannerPatternType
	// Colour is the colour the pattern should be rendered in.
	Colour item.Colour
}

BannerPatternLayer is a wrapper over BannerPatternType with a colour property.

func (BannerPatternLayer) DecodeNBT added in v0.8.0

func (b BannerPatternLayer) DecodeNBT(data map[string]any) any

DecodeNBT decodes the given NBT map into a BannerPatternLayer and returns it.

func (BannerPatternLayer) EncodeNBT added in v0.8.0

func (b BannerPatternLayer) EncodeNBT() map[string]any

EncodeNBT encodes the given BannerPatternLayer into an NBT map.

type BannerPatternType added in v0.8.0

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

BannerPatternType represents a type of banner pattern, used to customize banners.

func BannerPatternByID added in v0.8.0

func BannerPatternByID(id string) BannerPatternType

BannerPatternByID returns a banner pattern by the ID it was registered with.

func BannerPatternTypes added in v0.8.0

func BannerPatternTypes() []BannerPatternType

BannerPatternTypes returns all the available banner pattern types.

func BorderBannerPattern added in v0.8.0

func BorderBannerPattern() BannerPatternType

BorderBannerPattern represents the 'Border' banner pattern type.

func BricksBannerPattern added in v0.8.0

func BricksBannerPattern() BannerPatternType

BricksBannerPattern represents the 'Bricks' banner pattern type.

func CircleBannerPattern added in v0.8.0

func CircleBannerPattern() BannerPatternType

CircleBannerPattern represents the 'Circle' banner pattern type.

func CreeperBannerPattern added in v0.8.0

func CreeperBannerPattern() BannerPatternType

CreeperBannerPattern represents the 'Creeper' banner pattern type.

func CrossBannerPattern added in v0.8.0

func CrossBannerPattern() BannerPatternType

CrossBannerPattern represents the 'Cross' banner pattern type.

func CurlyBorderBannerPattern added in v0.8.0

func CurlyBorderBannerPattern() BannerPatternType

CurlyBorderBannerPattern represents the 'Curly Border' banner pattern type.

func DiagonalLeftBannerPattern added in v0.8.0

func DiagonalLeftBannerPattern() BannerPatternType

DiagonalLeftBannerPattern represents the 'Diagonal Left' banner pattern type.

func DiagonalRightBannerPattern added in v0.8.0

func DiagonalRightBannerPattern() BannerPatternType

DiagonalRightBannerPattern represents the 'Diagonal Right' banner pattern type.

func DiagonalUpLeftBannerPattern added in v0.8.0

func DiagonalUpLeftBannerPattern() BannerPatternType

DiagonalUpLeftBannerPattern represents the 'Diagonal Up Left' banner pattern type.

func DiagonalUpRightBannerPattern added in v0.8.0

func DiagonalUpRightBannerPattern() BannerPatternType

DiagonalUpRightBannerPattern represents the 'Diagonal Up Right' banner pattern type.

func FlowBannerPattern added in v0.9.16

func FlowBannerPattern() BannerPatternType

FlowBannerPattern represents the 'Flow' banner pattern type.

func FlowerBannerPattern added in v0.8.0

func FlowerBannerPattern() BannerPatternType

FlowerBannerPattern represents the 'Flower' banner pattern type.

func GlobeBannerPattern added in v0.8.0

func GlobeBannerPattern() BannerPatternType

GlobeBannerPattern represents the 'Globe' banner pattern type.

func GradientBannerPattern added in v0.8.0

func GradientBannerPattern() BannerPatternType

GradientBannerPattern represents the 'Gradient' banner pattern type.

func GradientUpBannerPattern added in v0.8.0

func GradientUpBannerPattern() BannerPatternType

GradientUpBannerPattern represents the 'Gradient Up' banner pattern type.

func GusterBannerPattern added in v0.9.16

func GusterBannerPattern() BannerPatternType

GusterBannerPattern represents the 'Guster' banner pattern type.

func HalfHorizontalBannerPattern added in v0.8.0

func HalfHorizontalBannerPattern() BannerPatternType

HalfHorizontalBannerPattern represents the 'Half Horizontal' banner pattern type.

func HalfHorizontalBottomBannerPattern added in v0.8.0

func HalfHorizontalBottomBannerPattern() BannerPatternType

HalfHorizontalBottomBannerPattern represents the 'Half Horizontal Bottom' banner pattern type.

func HalfVerticalBannerPattern added in v0.8.0

func HalfVerticalBannerPattern() BannerPatternType

HalfVerticalBannerPattern represents the 'Half Vertical' banner pattern type.

func HalfVerticalRightBannerPattern added in v0.8.0

func HalfVerticalRightBannerPattern() BannerPatternType

HalfVerticalRightBannerPattern represents the 'Half Vertical Right' banner pattern type.

func MojangBannerPattern added in v0.8.0

func MojangBannerPattern() BannerPatternType

MojangBannerPattern represents the 'Mojang' banner pattern type.

func PiglinBannerPattern added in v0.8.0

func PiglinBannerPattern() BannerPatternType

PiglinBannerPattern represents the 'Piglin' banner pattern type.

func RhombusBannerPattern added in v0.8.0

func RhombusBannerPattern() BannerPatternType

RhombusBannerPattern represents the 'Rhombus' banner pattern type.

func SkullBannerPattern added in v0.8.0

func SkullBannerPattern() BannerPatternType

SkullBannerPattern represents the 'Skull' banner pattern type.

func SmallStripesBannerPattern added in v0.8.0

func SmallStripesBannerPattern() BannerPatternType

SmallStripesBannerPattern represents the 'Small Stripes' banner pattern type.

func SquareBottomLeftBannerPattern added in v0.8.0

func SquareBottomLeftBannerPattern() BannerPatternType

SquareBottomLeftBannerPattern represents the 'Square Bottom Left' banner pattern type.

func SquareBottomRightBannerPattern added in v0.8.0

func SquareBottomRightBannerPattern() BannerPatternType

SquareBottomRightBannerPattern represents the 'Square Bottom Right' banner pattern type.

func SquareTopLeftBannerPattern added in v0.8.0

func SquareTopLeftBannerPattern() BannerPatternType

SquareTopLeftBannerPattern represents the 'Square Top Left' banner pattern type.

func SquareTopRightBannerPattern added in v0.8.0

func SquareTopRightBannerPattern() BannerPatternType

SquareTopRightBannerPattern represents the 'Square Top Right' banner pattern type.

func StraightCrossBannerPattern added in v0.8.0

func StraightCrossBannerPattern() BannerPatternType

StraightCrossBannerPattern represents the 'Straight Cross' banner pattern type.

func StripeBottomBannerPattern added in v0.8.0

func StripeBottomBannerPattern() BannerPatternType

StripeBottomBannerPattern represents the 'Stripe Bottom' banner pattern type.

func StripeCenterBannerPattern added in v0.8.0

func StripeCenterBannerPattern() BannerPatternType

StripeCenterBannerPattern represents the 'Stripe Center' banner pattern type.

func StripeDownLeftBannerPattern added in v0.8.0

func StripeDownLeftBannerPattern() BannerPatternType

StripeDownLeftBannerPattern represents the 'Stripe Down Left' banner pattern type.

func StripeDownRightBannerPattern added in v0.8.0

func StripeDownRightBannerPattern() BannerPatternType

StripeDownRightBannerPattern represents the 'Stripe Down Right' banner pattern type.

func StripeLeftBannerPattern added in v0.8.0

func StripeLeftBannerPattern() BannerPatternType

StripeLeftBannerPattern represents the 'Stripe Left' banner pattern type.

func StripeMiddleBannerPattern added in v0.8.0

func StripeMiddleBannerPattern() BannerPatternType

StripeMiddleBannerPattern represents the 'Stripe Middle' banner pattern type.

func StripeRightBannerPattern added in v0.8.0

func StripeRightBannerPattern() BannerPatternType

StripeRightBannerPattern represents the 'Stripe Right' banner pattern type.

func StripeTopBannerPattern added in v0.8.0

func StripeTopBannerPattern() BannerPatternType

StripeTopBannerPattern represents the 'Stripe Top' banner pattern type.

func TriangleBottomBannerPattern added in v0.8.0

func TriangleBottomBannerPattern() BannerPatternType

TriangleBottomBannerPattern represents the 'Triangle Bottom' banner pattern type.

func TriangleTopBannerPattern added in v0.8.0

func TriangleTopBannerPattern() BannerPatternType

TriangleTopBannerPattern represents the 'Triangle Top' banner pattern type.

func TrianglesBottomBannerPattern added in v0.8.0

func TrianglesBottomBannerPattern() BannerPatternType

TrianglesBottomBannerPattern represents the 'Triangles Bottom' banner pattern type.

func TrianglesTopBannerPattern added in v0.8.0

func TrianglesTopBannerPattern() BannerPatternType

TrianglesTopBannerPattern represents the 'Triangles Top' banner pattern type.

func (BannerPatternType) Item added in v0.8.0

func (b BannerPatternType) Item() (item.BannerPatternType, bool)

Item returns the equivalent item type for the pattern. If none exists, false is returned.

func (BannerPatternType) String added in v0.8.0

func (b BannerPatternType) String() string

String returns the bannerPatternType as a string.

func (BannerPatternType) Uint8 added in v0.8.0

func (b BannerPatternType) Uint8() uint8

Uint8 returns the bannerPatternType as a uint8.

type Barrel added in v0.1.0

type Barrel struct {

	// Facing is the direction that the barrel is facing.
	Facing cube.Face
	// Open is whether the barrel is open or not.
	Open bool
	// CustomName is the custom name of the barrel. This name is displayed when the barrel is opened, and may
	// include colour codes.
	CustomName string
	// contains filtered or unexported fields
}

Barrel is a fisherman's job site block, used to store items. It functions like a single chest, although it requires no airspace above it to be opened.

func NewBarrel added in v0.1.0

func NewBarrel() Barrel

NewBarrel creates a new initialised barrel. The inventory is properly initialised.

func (Barrel) Activate added in v0.1.0

func (b Barrel) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Barrel) AddViewer added in v0.1.0

func (b Barrel) AddViewer(v ContainerViewer, w *world.World, pos cube.Pos)

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

func (Barrel) BreakInfo added in v0.1.0

func (b Barrel) BreakInfo() BreakInfo

BreakInfo ...

func (Barrel) DecodeNBT added in v0.1.0

func (b Barrel) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Barrel) EncodeBlock added in v0.1.0

func (b Barrel) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Barrel) EncodeItem added in v0.1.0

func (b Barrel) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Barrel) EncodeNBT added in v0.1.0

func (b Barrel) EncodeNBT() map[string]any

EncodeNBT ...

func (Barrel) FlammabilityInfo added in v0.1.0

func (b Barrel) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Barrel) FuelInfo added in v0.8.0

func (Barrel) FuelInfo() item.FuelInfo

FuelInfo ...

func (Barrel) Hash added in v0.1.0

func (b Barrel) Hash() (uint64, uint64)

func (Barrel) Instrument added in v0.1.0

func (Barrel) Instrument() sound.Instrument

Instrument ...

func (Barrel) Inventory added in v0.1.0

func (b Barrel) Inventory(*world.World, cube.Pos) *inventory.Inventory

Inventory returns the inventory of the barrel. The size of the inventory will be 27.

func (Barrel) Model added in v0.1.0

func (Barrel) Model() world.BlockModel

Model ...

func (Barrel) RemoveViewer added in v0.1.0

func (b Barrel) RemoveViewer(v ContainerViewer, w *world.World, pos cube.Pos)

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

func (Barrel) UseOnBlock added in v0.1.0

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

UseOnBlock ...

func (Barrel) WithName added in v0.1.0

func (b Barrel) WithName(a ...any) world.Item

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

type Barrier

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

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

func (Barrier) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Barrier) EncodeBlock

func (Barrier) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Barrier) EncodeItem

func (Barrier) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Barrier) Hash

func (Barrier) Hash() (uint64, uint64)

func (Barrier) LightDiffusionLevel

func (Barrier) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Barrier) Model

func (Barrier) Model() world.BlockModel

Model ...

func (Barrier) SideClosed

func (Barrier) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

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 cube.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]any)

EncodeBlock ...

func (Basalt) EncodeItem

func (b Basalt) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Basalt) Hash

func (b Basalt) Hash() (uint64, uint64)

func (Basalt) Instrument

func (Basalt) Instrument() sound.Instrument

Instrument ...

func (Basalt) Model

func (Basalt) Model() world.BlockModel

Model ...

func (Basalt) UseOnBlock

func (b Basalt) UseOnBlock(pos cube.Pos, face cube.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.LastingType
	// 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 cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate manages the opening of a beacon by activating it.

func (Beacon) BreakInfo

func (b Beacon) BreakInfo() BreakInfo

BreakInfo ...

func (Beacon) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Beacon) DecodeNBT

func (b Beacon) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Beacon) EncodeBlock

func (Beacon) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Beacon) EncodeItem

func (Beacon) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Beacon) EncodeNBT

func (b Beacon) EncodeNBT() map[string]any

EncodeNBT ...

func (Beacon) Hash

func (Beacon) Hash() (uint64, uint64)

func (Beacon) Instrument

func (Beacon) Instrument() sound.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(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Beacon) Tick

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

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

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]any)

EncodeBlock ...

func (Bedrock) EncodeItem

func (Bedrock) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Bedrock) Hash

func (b Bedrock) Hash() (uint64, uint64)

func (Bedrock) Instrument

func (Bedrock) Instrument() sound.Instrument

Instrument ...

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 cube.Pos, w *world.World) bool

BoneMeal ...

func (BeetrootSeeds) BreakInfo

func (b BeetrootSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (BeetrootSeeds) CalculateGrowthChance

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

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

func (BeetrootSeeds) CompostChance added in v0.8.2

func (BeetrootSeeds) CompostChance() float64

CompostChance ...

func (BeetrootSeeds) EncodeBlock

func (b BeetrootSeeds) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (BeetrootSeeds) EncodeItem

func (b BeetrootSeeds) EncodeItem() (name string, 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, uint64)

func (BeetrootSeeds) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (BeetrootSeeds) RandomTick

func (b BeetrootSeeds) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

RandomTick ...

func (BeetrootSeeds) SameCrop

func (BeetrootSeeds) SameCrop(c Crop) bool

SameCrop ...

func (BeetrootSeeds) UseOnBlock

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

UseOnBlock ...

type Blackstone added in v0.8.0

type Blackstone struct {

	// Type is the type of blackstone of the block.
	Type BlackstoneType
	// contains filtered or unexported fields
}

Blackstone is a naturally generating block in the nether that can be used to craft stone tools, brewing stands and furnaces. Gilded blackstone also has a 10% chance to drop 2-6 golden nuggets.

func (Blackstone) BreakInfo added in v0.8.0

func (b Blackstone) BreakInfo() BreakInfo

BreakInfo ...

func (Blackstone) EncodeBlock added in v0.8.0

func (b Blackstone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Blackstone) EncodeItem added in v0.8.0

func (b Blackstone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Blackstone) Hash added in v0.8.0

func (b Blackstone) Hash() (uint64, uint64)

func (Blackstone) Instrument added in v0.8.0

func (Blackstone) Instrument() sound.Instrument

Instrument ...

func (Blackstone) Model added in v0.8.0

func (Blackstone) Model() world.BlockModel

Model ...

type BlackstoneType added in v0.8.0

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

BlackstoneType represents a type of blackstone.

func BlackstoneTypes added in v0.8.0

func BlackstoneTypes() []BlackstoneType

BlackstoneTypes ...

func ChiseledPolishedBlackstone added in v0.8.0

func ChiseledPolishedBlackstone() BlackstoneType

ChiseledPolishedBlackstone is the chiseled polished variant of blackstone.

func GildedBlackstone

func GildedBlackstone() BlackstoneType

GildedBlackstone is the gilded variant of blackstone.

func NormalBlackstone added in v0.8.0

func NormalBlackstone() BlackstoneType

NormalBlackstone is the normal variant of blackstone.

func PolishedBlackstone added in v0.8.0

func PolishedBlackstone() BlackstoneType

PolishedBlackstone is the polished variant of blackstone.

func (BlackstoneType) Name added in v0.8.0

func (s BlackstoneType) Name() string

Name ...

func (BlackstoneType) String added in v0.8.0

func (s BlackstoneType) String() string

String ...

func (BlackstoneType) Uint8 added in v0.8.0

func (s BlackstoneType) Uint8() uint8

Uint8 returns the blackstone type as a uint8.

type BlastFurnace added in v0.8.0

type BlastFurnace struct {

	// Facing is the direction the blast furnace is facing.
	Facing cube.Direction
	// Lit is true if the blast furnace is lit.
	Lit bool
	// contains filtered or unexported fields
}

BlastFurnace is a block that smelts ores, raw metals, iron and gold armor and tools, similar to a furnace, but at twice the speed. It also serves as an armorer's job site block. The empty value of BlastFurnace is not valid. It must be created using block.NewBlastFurnace(cube.Face).

func NewBlastFurnace added in v0.8.0

func NewBlastFurnace(face cube.Direction) BlastFurnace

NewBlastFurnace creates a new initialised blast furnace. The smelter is properly initialised.

func (BlastFurnace) Activate added in v0.8.0

func (b BlastFurnace) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (BlastFurnace) AddViewer added in v0.8.0

func (s BlastFurnace) AddViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (BlastFurnace) BreakInfo added in v0.8.0

func (b BlastFurnace) BreakInfo() BreakInfo

BreakInfo ...

func (BlastFurnace) DecodeNBT added in v0.8.0

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

DecodeNBT ...

func (BlastFurnace) Durations added in v0.8.0

func (s BlastFurnace) Durations() (remaining time.Duration, max time.Duration, cook time.Duration)

Durations returns the remaining, maximum, and cook durations of the smelter.

func (BlastFurnace) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (BlastFurnace) EncodeItem added in v0.8.0

func (b BlastFurnace) EncodeItem() (name string, meta int16)

EncodeItem ...

func (BlastFurnace) EncodeNBT added in v0.8.0

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

EncodeNBT ...

func (BlastFurnace) Experience added in v0.8.0

func (s BlastFurnace) Experience() int

Experience returns the collected experience of the smelter.

func (BlastFurnace) ExtractItem added in v0.9.18

func (s BlastFurnace) ExtractItem(h Hopper, pos cube.Pos, w *world.World) bool

ExtractItem ...

func (BlastFurnace) Hash added in v0.8.0

func (b BlastFurnace) Hash() (uint64, uint64)

func (BlastFurnace) InsertItem added in v0.9.18

func (s BlastFurnace) InsertItem(h Hopper, pos cube.Pos, w *world.World) bool

InsertItem ...

func (BlastFurnace) Instrument added in v0.8.0

func (BlastFurnace) Instrument() sound.Instrument

Instrument ...

func (BlastFurnace) Inventory added in v0.8.0

func (s BlastFurnace) Inventory(*world.World, cube.Pos) *inventory.Inventory

Inventory returns the inventory of the furnace.

func (BlastFurnace) Model added in v0.8.0

func (BlastFurnace) Model() world.BlockModel

Model ...

func (BlastFurnace) RemoveViewer added in v0.8.0

func (s BlastFurnace) RemoveViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (BlastFurnace) ResetExperience added in v0.8.0

func (s BlastFurnace) ResetExperience() int

ResetExperience resets the collected experience of the smelter, and returns the amount of experience that was reset.

func (BlastFurnace) Tick added in v0.8.0

func (b BlastFurnace) Tick(_ int64, pos cube.Pos, w *world.World)

Tick is called to check if the blast furnace should update and start or stop smelting.

func (BlastFurnace) UseOnBlock added in v0.8.0

func (b BlastFurnace) UseOnBlock(pos cube.Pos, face cube.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) EncodeBlock

func (BlueIce) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (BlueIce) EncodeItem

func (BlueIce) EncodeItem() (name string, meta int16)

EncodeItem ...

func (BlueIce) Friction added in v0.4.0

func (b BlueIce) Friction() float64

Friction ...

func (BlueIce) Hash

func (BlueIce) Hash() (uint64, uint64)

func (BlueIce) Model

func (BlueIce) Model() world.BlockModel

Model ...

type Bone added in v0.7.3

type Bone struct {

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

Bone is a decorative block that can face different directions.

func (Bone) BreakInfo added in v0.7.3

func (b Bone) BreakInfo() BreakInfo

BreakInfo ...

func (Bone) EncodeBlock added in v0.7.3

func (b Bone) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Bone) EncodeItem added in v0.7.3

func (b Bone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Bone) Hash added in v0.7.3

func (b Bone) Hash() (uint64, uint64)

func (Bone) Instrument added in v0.7.3

func (b Bone) Instrument() sound.Instrument

Instrument ...

func (Bone) Model added in v0.7.3

func (Bone) Model() world.BlockModel

Model ...

func (Bone) UseOnBlock added in v0.7.3

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

UseOnBlock handles the rotational placing of bone blocks.

type Bookshelf added in v0.5.0

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

Bookshelf is a decorative block that primarily serves to enhance enchanting with an enchanting table.

func (Bookshelf) BreakInfo added in v0.5.0

func (b Bookshelf) BreakInfo() BreakInfo

BreakInfo ...

func (Bookshelf) EncodeBlock added in v0.5.0

func (Bookshelf) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Bookshelf) EncodeItem added in v0.5.0

func (Bookshelf) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Bookshelf) FlammabilityInfo added in v0.8.0

func (Bookshelf) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Bookshelf) FuelInfo added in v0.8.0

func (Bookshelf) FuelInfo() item.FuelInfo

FuelInfo ...

func (Bookshelf) Hash added in v0.5.0

func (Bookshelf) Hash() (uint64, uint64)

func (Bookshelf) Instrument added in v0.5.0

func (Bookshelf) Instrument() sound.Instrument

Instrument ...

func (Bookshelf) Model added in v0.5.0

func (Bookshelf) Model() world.BlockModel

Model ...

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.ToolNone is passed.
	Harvestable func(t item.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 item.Tool) bool
	// Drops is a function called to get the drops of the block if it is broken using the item passed.
	Drops func(t item.Tool, enchantments []item.Enchantment) []item.Stack
	// BreakHandler is called after the block has broken.
	BreakHandler func(pos cube.Pos, w *world.World, u item.User)
	// XPDrops is the range of XP a block can drop when broken.
	XPDrops XPDropRange
	// BlastResistance is the blast resistance of the block, which influences the block's ability to withstand an
	// explosive blast.
	BlastResistance float64
}

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 BrewingStand added in v0.9.19

type BrewingStand struct {

	// LeftSlot is true if the left slot is filled.
	LeftSlot bool
	// MiddleSlot is true if the middle slot is filled.
	MiddleSlot bool
	// RightSlot is true if the right slot is filled.
	RightSlot bool
	// contains filtered or unexported fields
}

BrewingStand is a block used for brewing potions, splash potions, and lingering potions. It also serves as a cleric's job site block generated in village churches.

func NewBrewingStand added in v0.9.19

func NewBrewingStand() BrewingStand

NewBrewingStand creates a new initialised brewing stand. The inventory is properly initialised.

func (BrewingStand) Activate added in v0.9.19

func (b BrewingStand) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (BrewingStand) AddViewer added in v0.9.19

func (b BrewingStand) AddViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (BrewingStand) BreakInfo added in v0.9.19

func (b BrewingStand) BreakInfo() BreakInfo

BreakInfo ...

func (BrewingStand) CanDisplace added in v0.9.19

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (BrewingStand) DecodeNBT added in v0.9.19

func (b BrewingStand) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (BrewingStand) Duration added in v0.9.19

func (b BrewingStand) Duration() time.Duration

Duration returns the remaining duration of the brewing process.

func (BrewingStand) EncodeBlock added in v0.9.19

func (b BrewingStand) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (BrewingStand) EncodeItem added in v0.9.19

func (b BrewingStand) EncodeItem() (name string, meta int16)

EncodeItem ...

func (BrewingStand) EncodeNBT added in v0.9.19

func (b BrewingStand) EncodeNBT() map[string]any

EncodeNBT ...

func (BrewingStand) ExtractItem added in v0.9.19

func (b BrewingStand) ExtractItem(h Hopper, pos cube.Pos, w *world.World) bool

ExtractItem ...

func (BrewingStand) Fuel added in v0.9.19

func (b BrewingStand) Fuel() (fuel, maxFuel int32)

Fuel returns the fuel and maximum fuel of the brewer.

func (BrewingStand) Hash added in v0.9.19

func (b BrewingStand) Hash() (uint64, uint64)

func (BrewingStand) InsertItem added in v0.9.19

func (b BrewingStand) InsertItem(h Hopper, pos cube.Pos, w *world.World) bool

InsertItem ...

func (BrewingStand) Inventory added in v0.9.19

func (b BrewingStand) Inventory(*world.World, cube.Pos) *inventory.Inventory

Inventory returns the inventory of the brewer.

func (BrewingStand) LightDiffusionLevel added in v0.9.19

func (BrewingStand) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (BrewingStand) Model added in v0.9.19

func (b BrewingStand) Model() world.BlockModel

Model ...

func (BrewingStand) RemoveViewer added in v0.9.19

func (b BrewingStand) RemoveViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (BrewingStand) SideClosed added in v0.9.19

func (b BrewingStand) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (BrewingStand) Tick added in v0.9.19

func (b BrewingStand) Tick(_ int64, pos cube.Pos, w *world.World)

Tick is called to check if the brewing stand should update and start or stop brewing.

func (BrewingStand) UseOnBlock added in v0.9.19

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

UseOnBlock ...

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

func (Bricks) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Bricks) EncodeItem

func (Bricks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Bricks) Hash

func (Bricks) Hash() (uint64, uint64)

func (Bricks) Instrument

func (Bricks) Instrument() sound.Instrument

Instrument ...

func (Bricks) Model

func (Bricks) Model() world.BlockModel

Model ...

type Cactus added in v0.7.0

type Cactus struct {

	// Age is the growth state of cactus. Values range from 0 to 15.
	Age int
	// contains filtered or unexported fields
}

Cactus is a plant block that generates naturally in dry areas and causes damage.

func (Cactus) BreakInfo added in v0.7.0

func (c Cactus) BreakInfo() BreakInfo

BreakInfo ...

func (Cactus) CompostChance added in v0.8.2

func (Cactus) CompostChance() float64

CompostChance ...

func (Cactus) EncodeBlock added in v0.7.0

func (c Cactus) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Cactus) EncodeItem added in v0.7.0

func (c Cactus) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Cactus) EntityInside added in v0.7.0

func (c Cactus) EntityInside(_ cube.Pos, _ *world.World, e world.Entity)

EntityInside ...

func (Cactus) Hash added in v0.7.0

func (c Cactus) Hash() (uint64, uint64)

func (Cactus) LightDiffusionLevel added in v0.7.0

func (Cactus) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Cactus) Model added in v0.7.0

func (c Cactus) Model() world.BlockModel

Model ...

func (Cactus) NeighbourUpdateTick added in v0.7.0

func (c Cactus) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Cactus) RandomTick added in v0.7.0

func (c Cactus) RandomTick(pos cube.Pos, w *world.World, _ *rand.Rand)

RandomTick ...

func (Cactus) UseOnBlock added in v0.7.0

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

UseOnBlock handles making sure the neighbouring blocks are air.

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 cube.Pos, _ cube.Face, w *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Cake) BreakInfo

func (c Cake) BreakInfo() BreakInfo

BreakInfo ...

func (Cake) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Cake) EncodeBlock

func (c Cake) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Cake) EncodeItem

func (c Cake) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Cake) Hash

func (c Cake) Hash() (uint64, uint64)

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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Cake) SideClosed

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

SideClosed ...

func (Cake) UseOnBlock

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

UseOnBlock ...

type Calcite added in v0.1.0

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

Calcite is a carbonate mineral found as part of amethyst geodes.

func (Calcite) BreakInfo added in v0.1.0

func (c Calcite) BreakInfo() BreakInfo

BreakInfo ...

func (Calcite) EncodeBlock added in v0.1.0

func (c Calcite) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Calcite) EncodeItem added in v0.1.0

func (c Calcite) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Calcite) Hash added in v0.1.0

func (Calcite) Hash() (uint64, uint64)

func (Calcite) Instrument added in v0.1.0

func (Calcite) Instrument() sound.Instrument

Instrument ...

func (Calcite) Model added in v0.1.0

func (Calcite) Model() world.BlockModel

Model ...

type Campfire added in v0.9.18

type Campfire struct {

	// Items represents the items in the campfire that are being cooked.
	Items [4]CampfireItem
	// Facing represents the direction that the campfire is facing.
	Facing cube.Direction
	// Extinguished is true if the campfire was extinguished by a water source.
	Extinguished bool
	// Type represents the type of Campfire, currently there are Normal and Soul campfires.
	Type FireType
	// contains filtered or unexported fields
}

Campfire is a block that can be used to cook food, pacify bees, act as a spread-proof light source, smoke signal or damaging trap block.

func (Campfire) Activate added in v0.9.18

func (c Campfire) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool

Activate ...

func (Campfire) BreakInfo added in v0.9.18

func (c Campfire) BreakInfo() BreakInfo

BreakInfo ...

func (Campfire) CanDisplace added in v0.9.18

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Campfire) DecodeNBT added in v0.9.18

func (c Campfire) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Campfire) EncodeBlock added in v0.9.18

func (c Campfire) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Campfire) EncodeItem added in v0.9.18

func (c Campfire) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Campfire) EncodeNBT added in v0.9.18

func (c Campfire) EncodeNBT() map[string]any

EncodeNBT ...

func (Campfire) EntityInside added in v0.9.18

func (c Campfire) EntityInside(pos cube.Pos, w *world.World, e world.Entity)

EntityInside ...

func (Campfire) Hash added in v0.9.18

func (c Campfire) Hash() (uint64, uint64)

func (Campfire) Ignite added in v0.9.18

func (c Campfire) Ignite(pos cube.Pos, w *world.World, _ world.Entity) bool

Ignite ...

func (Campfire) Instrument added in v0.9.18

func (Campfire) Instrument() sound.Instrument

Instrument ...

func (Campfire) LightDiffusionLevel added in v0.9.18

func (Campfire) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Campfire) LightEmissionLevel added in v0.9.18

func (c Campfire) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Campfire) Model added in v0.9.18

func (Campfire) Model() world.BlockModel

Model ...

func (Campfire) NeighbourUpdateTick added in v0.9.18

func (c Campfire) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Campfire) SideClosed added in v0.9.18

func (Campfire) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Campfire) Splash added in v0.9.18

func (c Campfire) Splash(w *world.World, pos cube.Pos)

Splash ...

func (Campfire) Tick added in v0.9.18

func (c Campfire) Tick(_ int64, pos cube.Pos, w *world.World)

Tick is called to cook the items within the campfire.

func (Campfire) UseOnBlock added in v0.9.18

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

UseOnBlock ...

type CampfireItem added in v0.9.18

type CampfireItem struct {
	// Item is a specific item being cooked on top of the campfire.
	Item item.Stack
	// Time is the countdown of ticks until the food item is cooked (when 0).
	Time time.Duration
}

CampfireItem holds data about the items in the campfire.

type Carpet

type Carpet struct {

	// Colour is the colour of the carpet.
	Colour item.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 (s Carpet) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Carpet) EncodeBlock

func (c Carpet) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Carpet) EncodeItem

func (c Carpet) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Carpet) FlammabilityInfo

func (c Carpet) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Carpet) HasLiquidDrops

func (Carpet) HasLiquidDrops() bool

HasLiquidDrops ...

func (Carpet) Hash

func (c Carpet) Hash() (uint64, uint64)

func (Carpet) LightDiffusionLevel

func (Carpet) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Carpet) Model

func (Carpet) Model() world.BlockModel

Model ...

func (Carpet) NeighbourUpdateTick

func (c Carpet) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Carpet) SideClosed

func (Carpet) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Carpet) UseOnBlock

func (c Carpet) UseOnBlock(pos cube.Pos, face cube.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 cube.Pos, w *world.World) bool

BoneMeal ...

func (Carrot) BreakInfo

func (c Carrot) BreakInfo() BreakInfo

BreakInfo ...

func (Carrot) CalculateGrowthChance

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

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

func (Carrot) CompostChance added in v0.8.2

func (Carrot) CompostChance() float64

CompostChance ...

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]any)

EncodeBlock ...

func (Carrot) EncodeItem

func (c Carrot) EncodeItem() (name string, 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, uint64)

func (Carrot) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Carrot) RandomTick

func (c Carrot) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

RandomTick ...

func (Carrot) SameCrop

func (Carrot) SameCrop(c Crop) bool

SameCrop ...

func (Carrot) UseOnBlock

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

UseOnBlock ...

type Chain added in v0.5.0

type Chain struct {

	// Axis is the axis which the chain faces.
	Axis cube.Axis
	// contains filtered or unexported fields
}

Chain is a metallic decoration block.

func (Chain) BreakInfo added in v0.5.0

func (c Chain) BreakInfo() BreakInfo

BreakInfo ...

func (Chain) CanDisplace added in v0.5.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Chain) EncodeBlock added in v0.5.0

func (c Chain) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Chain) EncodeItem added in v0.5.0

func (Chain) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Chain) Hash added in v0.5.0

func (c Chain) Hash() (uint64, uint64)

func (Chain) LightDiffusionLevel added in v0.5.0

func (Chain) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Chain) Model added in v0.5.0

func (c Chain) Model() world.BlockModel

Model ...

func (Chain) SideClosed added in v0.5.0

func (Chain) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Chain) UseOnBlock added in v0.5.0

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

UseOnBlock ...

type Chest

type Chest struct {

	// Facing is the direction that the chest is facing.
	Facing cube.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 block.NewChest().

func NewChest

func NewChest() Chest

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

func (Chest) Activate

func (c Chest) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Chest) AddViewer

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

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 (s Chest) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Chest) DecodeNBT

func (c Chest) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Chest) EncodeBlock

func (c Chest) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Chest) EncodeItem

func (Chest) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Chest) EncodeNBT

func (c Chest) EncodeNBT() map[string]any

EncodeNBT ...

func (Chest) FlammabilityInfo

func (c Chest) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Chest) FuelInfo added in v0.8.0

func (Chest) FuelInfo() item.FuelInfo

FuelInfo ...

func (Chest) Hash

func (c Chest) Hash() (uint64, uint64)

func (Chest) Instrument

func (Chest) Instrument() sound.Instrument

Instrument ...

func (Chest) Inventory

func (c Chest) Inventory(w *world.World, pos cube.Pos) *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) Paired added in v0.9.18

func (c Chest) Paired() bool

Paired returns whether the chest is paired with another chest.

func (Chest) RemoveViewer

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

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(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Chest) UseOnBlock

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

UseOnBlock ...

func (Chest) WithName

func (c Chest) WithName(a ...any) 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]any)

EncodeBlock ...

func (ChiseledQuartz) EncodeItem

func (c ChiseledQuartz) EncodeItem() (name string, meta int16)

EncodeItem ...

func (ChiseledQuartz) Hash

func (ChiseledQuartz) Hash() (uint64, uint64)

func (ChiseledQuartz) Instrument

func (ChiseledQuartz) Instrument() sound.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]any)

EncodeBlock ...

func (Clay) EncodeItem

func (c Clay) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Clay) Hash

func (Clay) Hash() (uint64, uint64)

func (Clay) Instrument

func (c Clay) Instrument() sound.Instrument

Instrument ...

func (Clay) Model

func (Clay) Model() world.BlockModel

Model ...

func (Clay) SmeltInfo added in v0.8.0

func (Clay) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type CloseAction added in v0.6.0

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

CloseAction is a world.BlockAction to close a block at a position, complementary to the OpenAction action.

func (CloseAction) BlockAction added in v0.6.0

func (CloseAction) BlockAction()

BlockAction serves to implement the world.BlockAction interface.

type Coal added in v0.7.3

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

Coal is a precious mineral block made from 9 coal.

func (Coal) BreakInfo added in v0.7.3

func (c Coal) BreakInfo() BreakInfo

BreakInfo ...

func (Coal) EncodeBlock added in v0.7.3

func (Coal) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Coal) EncodeItem added in v0.7.3

func (Coal) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Coal) FlammabilityInfo added in v0.7.3

func (Coal) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Coal) FuelInfo added in v0.8.0

func (Coal) FuelInfo() item.FuelInfo

FuelInfo ...

func (Coal) Hash added in v0.7.3

func (Coal) Hash() (uint64, uint64)

func (Coal) Instrument added in v0.7.3

func (Coal) Instrument() sound.Instrument

Instrument ...

func (Coal) Model added in v0.7.3

func (Coal) Model() world.BlockModel

Model ...

type CoalOre

type CoalOre struct {

	// Type is the type of coal ore.
	Type OreType
	// contains filtered or unexported fields
}

CoalOre is a common ore.

func (CoalOre) BreakInfo

func (c CoalOre) BreakInfo() BreakInfo

BreakInfo ...

func (CoalOre) EncodeBlock

func (c CoalOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (CoalOre) EncodeItem

func (c CoalOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CoalOre) Hash

func (c CoalOre) Hash() (uint64, uint64)

func (CoalOre) Instrument

func (CoalOre) Instrument() sound.Instrument

Instrument ...

func (CoalOre) Model

func (CoalOre) Model() world.BlockModel

Model ...

func (CoalOre) SmeltInfo added in v0.8.0

func (CoalOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type Cobblestone

type Cobblestone struct {

	// Mossy specifies if the cobblestone is mossy. This variant of cobblestone is typically found in
	// dungeons or in small clusters in the giant tree taiga biome.
	Mossy bool
	// contains filtered or unexported fields
}

Cobblestone is a common block, obtained from mining stone.

func (Cobblestone) BreakInfo

func (c Cobblestone) BreakInfo() BreakInfo

BreakInfo ...

func (Cobblestone) EncodeBlock

func (c Cobblestone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Cobblestone) EncodeItem

func (c Cobblestone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Cobblestone) Hash

func (c Cobblestone) Hash() (uint64, uint64)

func (Cobblestone) Instrument

func (Cobblestone) Instrument() sound.Instrument

Instrument ...

func (Cobblestone) Model

func (Cobblestone) Model() world.BlockModel

Model ...

func (Cobblestone) RepairsStoneTools added in v0.7.3

func (c Cobblestone) RepairsStoneTools() bool

RepairsStoneTools ...

func (Cobblestone) SmeltInfo added in v0.8.0

func (Cobblestone) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type CocoaBean

type CocoaBean struct {

	// Facing is the direction from the cocoa bean to the log.
	Facing cube.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 cube.Pos, w *world.World) bool

BoneMeal ...

func (CocoaBean) BreakInfo

func (c CocoaBean) BreakInfo() BreakInfo

BreakInfo ...

func (CocoaBean) CompostChance added in v0.8.2

func (CocoaBean) CompostChance() float64

CompostChance ...

func (CocoaBean) EncodeBlock

func (c CocoaBean) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (CocoaBean) EncodeItem

func (c CocoaBean) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CocoaBean) HasLiquidDrops

func (c CocoaBean) HasLiquidDrops() bool

HasLiquidDrops ...

func (CocoaBean) Hash

func (c CocoaBean) Hash() (uint64, uint64)

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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (CocoaBean) RandomTick

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

RandomTick ...

func (CocoaBean) UseOnBlock

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

UseOnBlock ...

type Composter added in v0.8.2

type Composter struct {

	// Level is the level of compost inside the composter. At level 8 it can be collected in the form of bone meal.
	Level int
	// contains filtered or unexported fields
}

Composter is a block that can turn biological matter in to compost which can then produce bone meal. It is also the work station for a farming villager.

func (Composter) Activate added in v0.8.2

func (c Composter) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool

Activate ...

func (Composter) BreakInfo added in v0.8.2

func (c Composter) BreakInfo() BreakInfo

BreakInfo ...

func (Composter) CanDisplace added in v0.8.2

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Composter) EncodeBlock added in v0.8.2

func (c Composter) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Composter) EncodeItem added in v0.8.2

func (c Composter) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Composter) ExtractItem added in v0.9.18

func (c Composter) ExtractItem(h Hopper, pos cube.Pos, w *world.World) bool

ExtractItem ...

func (Composter) FlammabilityInfo added in v0.8.2

func (c Composter) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Composter) FuelInfo added in v0.8.2

func (c Composter) FuelInfo() item.FuelInfo

FuelInfo ...

func (Composter) Hash added in v0.8.2

func (c Composter) Hash() (uint64, uint64)

func (Composter) InsertItem added in v0.9.18

func (c Composter) InsertItem(h Hopper, pos cube.Pos, w *world.World) bool

InsertItem ...

func (Composter) Instrument added in v0.8.2

func (Composter) Instrument() sound.Instrument

Instrument ...

func (Composter) LightDiffusionLevel added in v0.8.2

func (Composter) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Composter) Model added in v0.8.2

func (c Composter) Model() world.BlockModel

Model ...

func (Composter) ScheduledTick added in v0.8.2

func (c Composter) ScheduledTick(pos cube.Pos, w *world.World, _ *rand.Rand)

ScheduledTick ...

func (Composter) SideClosed added in v0.8.2

func (c Composter) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

type Concrete

type Concrete struct {

	// Colour is the colour of the concrete block.
	Colour item.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]any)

EncodeBlock ...

func (Concrete) EncodeItem

func (c Concrete) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Concrete) Hash

func (c Concrete) Hash() (uint64, uint64)

func (Concrete) Instrument

func (Concrete) Instrument() sound.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 item.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) EncodeBlock

func (c ConcretePowder) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (ConcretePowder) EncodeItem

func (c ConcretePowder) EncodeItem() (name string, meta int16)

EncodeItem ...

func (ConcretePowder) Hash

func (c ConcretePowder) Hash() (uint64, uint64)

func (ConcretePowder) Instrument

func (ConcretePowder) Instrument() sound.Instrument

Instrument ...

func (ConcretePowder) Model

func (ConcretePowder) Model() world.BlockModel

Model ...

func (ConcretePowder) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (ConcretePowder) Solidifies

func (c ConcretePowder) Solidifies(pos cube.Pos, w *world.World) bool

Solidifies ...

type Container

type Container interface {
	AddViewer(v ContainerViewer, w *world.World, pos cube.Pos)
	RemoveViewer(v ContainerViewer, w *world.World, pos cube.Pos)
	Inventory(w *world.World, pos cube.Pos) *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 cube.Pos)
}

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

type ContainerViewer

type ContainerViewer interface {
	world.Viewer
	// 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 ContinueCrackAction added in v0.6.0

type ContinueCrackAction struct {
	BreakTime time.Duration
	// contains filtered or unexported fields
}

ContinueCrackAction is a world.BlockAction sent every so often to continue the cracking process of the block. It is only ever sent after a StartCrackAction action, and may have an altered break time if the player is not on the ground, submerged or is using a different item than at first.

func (ContinueCrackAction) BlockAction added in v0.6.0

func (ContinueCrackAction) BlockAction()

BlockAction serves to implement the world.BlockAction interface.

type Copper added in v0.9.19

type Copper struct {

	// Type is the type of copper of the block.
	Type CopperType
	// Oxidation is the level of oxidation of the copper block.
	Oxidation OxidationType
	// Waxed bool is whether the copper block has been waxed with honeycomb.
	Waxed bool
	// contains filtered or unexported fields
}

Copper is a solid block commonly found in deserts and beaches underneath sand.

func (Copper) Activate added in v0.9.19

func (c Copper) Activate(pos cube.Pos, _ cube.Face, w *world.World, user item.User, _ *item.UseContext) bool

func (Copper) BreakInfo added in v0.9.19

func (c Copper) BreakInfo() BreakInfo

BreakInfo ...

func (Copper) CanOxidate added in v0.9.19

func (c Copper) CanOxidate() bool

func (Copper) EncodeBlock added in v0.9.19

func (c Copper) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Copper) EncodeItem added in v0.9.19

func (c Copper) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Copper) Hash added in v0.9.19

func (c Copper) Hash() (uint64, uint64)

func (Copper) Instrument added in v0.9.19

func (Copper) Instrument() sound.Instrument

Instrument ...

func (Copper) Model added in v0.9.19

func (Copper) Model() world.BlockModel

Model ...

func (Copper) OxidationLevel added in v0.9.19

func (c Copper) OxidationLevel() OxidationType

func (Copper) RandomTick added in v0.9.19

func (c Copper) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

func (Copper) SneakingActivate added in v0.9.19

func (c Copper) SneakingActivate(pos cube.Pos, face cube.Face, w *world.World, user item.User, ctx *item.UseContext) bool

func (Copper) Wax added in v0.9.19

func (c Copper) Wax(cube.Pos, mgl64.Vec3) (world.Block, bool)

Wax waxes the copper block to stop it from oxidising further.

func (Copper) WithOxidationLevel added in v0.9.19

func (c Copper) WithOxidationLevel(o OxidationType) Oxidizable

type CopperDoor added in v0.9.19

type CopperDoor struct {

	// Oxidation is the level of oxidation of the copper door.
	Oxidation OxidationType
	// Waxed bool is whether the copper door has been waxed with honeycomb.
	Waxed bool
	// Facing is the direction the door is facing.
	Facing cube.Direction
	// Open is whether the door is open.
	Open bool
	// Top is whether the block is the top or bottom half of a door
	Top bool
	// Right is whether the door hinge is on the right side
	Right bool
	// contains filtered or unexported fields
}

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

func (CopperDoor) Activate added in v0.9.19

func (d CopperDoor) Activate(pos cube.Pos, _ cube.Face, w *world.World, _ item.User, _ *item.UseContext) bool

func (CopperDoor) BreakInfo added in v0.9.19

func (d CopperDoor) BreakInfo() BreakInfo

BreakInfo ...

func (CopperDoor) CanDisplace added in v0.9.19

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (CopperDoor) CanOxidate added in v0.9.19

func (d CopperDoor) CanOxidate() bool

func (CopperDoor) EncodeBlock added in v0.9.19

func (d CopperDoor) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (CopperDoor) EncodeItem added in v0.9.19

func (d CopperDoor) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CopperDoor) Hash added in v0.9.19

func (d CopperDoor) Hash() (uint64, uint64)

func (CopperDoor) Instrument added in v0.9.19

func (CopperDoor) Instrument() sound.Instrument

Instrument ...

func (CopperDoor) LightDiffusionLevel added in v0.9.19

func (CopperDoor) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (CopperDoor) Model added in v0.9.19

func (d CopperDoor) Model() world.BlockModel

Model ...

func (CopperDoor) NeighbourUpdateTick added in v0.9.19

func (d CopperDoor) NeighbourUpdateTick(pos, changedNeighbour cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (CopperDoor) OxidationLevel added in v0.9.19

func (d CopperDoor) OxidationLevel() OxidationType

func (CopperDoor) RandomTick added in v0.9.19

func (d CopperDoor) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

func (CopperDoor) SideClosed added in v0.9.19

func (d CopperDoor) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (CopperDoor) SneakingActivate added in v0.9.19

func (d CopperDoor) SneakingActivate(pos cube.Pos, _ cube.Face, w *world.World, user item.User, _ *item.UseContext) bool

func (CopperDoor) UseOnBlock added in v0.9.19

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

UseOnBlock handles the directional placing of doors

func (CopperDoor) Wax added in v0.9.19

func (d CopperDoor) Wax(cube.Pos, mgl64.Vec3) (world.Block, bool)

Wax waxes the copper door to stop it from oxidising further.

func (CopperDoor) WithOxidationLevel added in v0.9.19

func (d CopperDoor) WithOxidationLevel(o OxidationType) Oxidizable

type CopperGrate added in v0.9.19

type CopperGrate struct {

	// Oxidation is the level of oxidation of the copper grate.
	Oxidation OxidationType
	// Waxed bool is whether the copper grate has been waxed with honeycomb.
	Waxed bool
	// contains filtered or unexported fields
}

CopperGrate is a solid block commonly found in deserts and beaches underneath sand.

func (CopperGrate) Activate added in v0.9.19

func (c CopperGrate) Activate(pos cube.Pos, _ cube.Face, w *world.World, user item.User, _ *item.UseContext) bool

func (CopperGrate) BreakInfo added in v0.9.19

func (c CopperGrate) BreakInfo() BreakInfo

BreakInfo ...

func (CopperGrate) CanDisplace added in v0.9.19

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (CopperGrate) CanOxidate added in v0.9.19

func (c CopperGrate) CanOxidate() bool

func (CopperGrate) EncodeBlock added in v0.9.19

func (c CopperGrate) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (CopperGrate) EncodeItem added in v0.9.19

func (c CopperGrate) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CopperGrate) Hash added in v0.9.19

func (c CopperGrate) Hash() (uint64, uint64)

func (CopperGrate) Instrument added in v0.9.19

func (CopperGrate) Instrument() sound.Instrument

Instrument ...

func (CopperGrate) LightDiffusionLevel added in v0.9.19

func (CopperGrate) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (CopperGrate) Model added in v0.9.19

func (CopperGrate) Model() world.BlockModel

Model ...

func (CopperGrate) OxidationLevel added in v0.9.19

func (c CopperGrate) OxidationLevel() OxidationType

func (CopperGrate) RandomTick added in v0.9.19

func (c CopperGrate) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

func (CopperGrate) SneakingActivate added in v0.9.19

func (c CopperGrate) SneakingActivate(pos cube.Pos, face cube.Face, w *world.World, user item.User, ctx *item.UseContext) bool

func (CopperGrate) Wax added in v0.9.19

Wax waxes the copper grate to stop it from oxidising further.

func (CopperGrate) WithOxidationLevel added in v0.9.19

func (c CopperGrate) WithOxidationLevel(o OxidationType) Oxidizable

type CopperOre added in v0.1.0

type CopperOre struct {

	// Type is the type of copper ore.
	Type OreType
	// contains filtered or unexported fields
}

CopperOre is a rare mineral block found underground.

func (CopperOre) BreakInfo added in v0.1.0

func (c CopperOre) BreakInfo() BreakInfo

BreakInfo ...

func (CopperOre) EncodeBlock added in v0.1.0

func (c CopperOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (CopperOre) EncodeItem added in v0.1.0

func (c CopperOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CopperOre) Hash added in v0.1.0

func (c CopperOre) Hash() (uint64, uint64)

func (CopperOre) Instrument added in v0.1.0

func (CopperOre) Instrument() sound.Instrument

Instrument ...

func (CopperOre) Model added in v0.1.0

func (CopperOre) Model() world.BlockModel

Model ...

func (CopperOre) SmeltInfo added in v0.8.0

func (CopperOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type CopperTrapdoor added in v0.9.19

type CopperTrapdoor struct {

	// Oxidation is the level of oxidation of the copper trapdoor.
	Oxidation OxidationType
	// Waxed bool is whether the copper trapdoor has been waxed with honeycomb.
	Waxed bool
	// Facing is the direction the trapdoor is facing.
	Facing cube.Direction
	// Open is whether the trapdoor is open.
	Open bool
	// Top is whether the trapdoor occupies the top or bottom part of a block.
	Top bool
	// contains filtered or unexported fields
}

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

func (CopperTrapdoor) Activate added in v0.9.19

func (t CopperTrapdoor) Activate(pos cube.Pos, _ cube.Face, w *world.World, _ item.User, _ *item.UseContext) bool

func (CopperTrapdoor) BreakInfo added in v0.9.19

func (t CopperTrapdoor) BreakInfo() BreakInfo

BreakInfo ...

func (CopperTrapdoor) CanDisplace added in v0.9.19

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (CopperTrapdoor) CanOxidate added in v0.9.19

func (t CopperTrapdoor) CanOxidate() bool

func (CopperTrapdoor) EncodeBlock added in v0.9.19

func (t CopperTrapdoor) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (CopperTrapdoor) EncodeItem added in v0.9.19

func (t CopperTrapdoor) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CopperTrapdoor) Hash added in v0.9.19

func (t CopperTrapdoor) Hash() (uint64, uint64)

func (CopperTrapdoor) Instrument added in v0.9.19

func (CopperTrapdoor) Instrument() sound.Instrument

Instrument ...

func (CopperTrapdoor) LightDiffusionLevel added in v0.9.19

func (CopperTrapdoor) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (CopperTrapdoor) Model added in v0.9.19

func (t CopperTrapdoor) Model() world.BlockModel

Model ...

func (CopperTrapdoor) OxidationLevel added in v0.9.19

func (t CopperTrapdoor) OxidationLevel() OxidationType

func (CopperTrapdoor) RandomTick added in v0.9.19

func (t CopperTrapdoor) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

func (CopperTrapdoor) SideClosed added in v0.9.19

func (t CopperTrapdoor) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (CopperTrapdoor) SneakingActivate added in v0.9.19

func (t CopperTrapdoor) SneakingActivate(pos cube.Pos, _ cube.Face, w *world.World, user item.User, _ *item.UseContext) bool

func (CopperTrapdoor) UseOnBlock added in v0.9.19

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

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

func (CopperTrapdoor) Wax added in v0.9.19

Wax waxes the copper trapdoor to stop it from oxidising further.

func (CopperTrapdoor) WithOxidationLevel added in v0.9.19

func (t CopperTrapdoor) WithOxidationLevel(o OxidationType) Oxidizable

type CopperType added in v0.9.19

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

CopperType represents a type of copper.

func ChiseledCopper added in v0.9.19

func ChiseledCopper() CopperType

ChiseledCopper is the chiseled variant of copper.

func CopperTypes added in v0.9.19

func CopperTypes() []CopperType

CopperTypes ...

func CutCopper added in v0.9.19

func CutCopper() CopperType

CutCopper is the cut variant of copper.

func NormalCopper added in v0.9.19

func NormalCopper() CopperType

NormalCopper is the normal variant of copper.

func (CopperType) Name added in v0.9.19

func (s CopperType) Name() string

Name ...

func (CopperType) String added in v0.9.19

func (s CopperType) String() string

String ...

func (CopperType) Uint8 added in v0.9.19

func (s CopperType) Uint8() uint8

Uint8 returns the copper as a uint8.

type Coral

type Coral struct {

	// Type is the type of coral of the block.
	Type CoralType
	// 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 (s Coral) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Coral) EncodeBlock

func (c Coral) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Coral) EncodeItem

func (c Coral) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Coral) HasLiquidDrops

func (c Coral) HasLiquidDrops() bool

HasLiquidDrops ...

func (Coral) Hash

func (c Coral) Hash() (uint64, uint64)

func (Coral) Instrument

func (Coral) Instrument() sound.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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Coral) ScheduledTick

func (c Coral) ScheduledTick(pos cube.Pos, w *world.World, _ *rand.Rand)

ScheduledTick ...

func (Coral) SideClosed

func (c Coral) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Coral) UseOnBlock

func (c Coral) UseOnBlock(pos cube.Pos, face cube.Face, _ 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 CoralType
	// 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]any)

EncodeBlock ...

func (CoralBlock) EncodeItem

func (c CoralBlock) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CoralBlock) Hash

func (c CoralBlock) Hash() (uint64, uint64)

func (CoralBlock) Instrument

func (CoralBlock) Instrument() sound.Instrument

Instrument ...

func (CoralBlock) Model

func (CoralBlock) Model() world.BlockModel

Model ...

func (CoralBlock) NeighbourUpdateTick

func (c CoralBlock) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (CoralBlock) ScheduledTick

func (c CoralBlock) ScheduledTick(pos cube.Pos, w *world.World, _ *rand.Rand)

ScheduledTick ...

type CoralType

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

CoralType represents a type of coral of a block. CoralType, coral fans, and coral blocks carry one of these types.

func BrainCoral

func BrainCoral() CoralType

BrainCoral returns the brain coral variant

func BubbleCoral

func BubbleCoral() CoralType

BubbleCoral returns the bubble coral variant

func CoralTypes

func CoralTypes() []CoralType

CoralTypes returns all coral types.

func FireCoral

func FireCoral() CoralType

FireCoral returns the fire coral variant

func HornCoral

func HornCoral() CoralType

HornCoral returns the horn coral variant

func TubeCoral

func TubeCoral() CoralType

TubeCoral returns the tube coral variant

func (CoralType) Colour

func (c CoralType) Colour() item.Colour

Colour returns the colour of the CoralType.

func (CoralType) Name

func (c CoralType) Name() string

Name ...

func (CoralType) String

func (c CoralType) String() string

String ...

func (CoralType) Uint8

func (c CoralType) Uint8() uint8

Uint8 returns the coral as a uint8.

type CraftingTable added in v0.7.0

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

CraftingTable is a utility block that allows the player to craft a variety of blocks and items.

func (CraftingTable) Activate added in v0.7.0

func (c CraftingTable) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (CraftingTable) BreakInfo added in v0.7.0

func (c CraftingTable) BreakInfo() BreakInfo

BreakInfo ...

func (CraftingTable) EncodeBlock added in v0.7.0

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

EncodeBlock ...

func (CraftingTable) EncodeItem added in v0.7.0

func (c CraftingTable) EncodeItem() (name string, meta int16)

EncodeItem ...

func (CraftingTable) FuelInfo added in v0.8.0

func (CraftingTable) FuelInfo() item.FuelInfo

FuelInfo ...

func (CraftingTable) Hash added in v0.7.0

func (CraftingTable) Hash() (uint64, uint64)

func (CraftingTable) Instrument added in v0.7.0

func (CraftingTable) Instrument() sound.Instrument

Instrument ...

func (CraftingTable) Model added in v0.7.0

func (CraftingTable) Model() world.BlockModel

Model ...

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 DamageSource added in v0.8.6

type DamageSource struct {
	// Block is the block that caused the damage.
	Block world.Block
}

DamageSource is passed as world.DamageSource for damage caused by a block, such as a cactus or a falling anvil.

func (DamageSource) Fire added in v0.8.6

func (DamageSource) Fire() bool

func (DamageSource) ReducedByArmour added in v0.8.6

func (DamageSource) ReducedByArmour() bool

func (DamageSource) ReducedByResistance added in v0.8.6

func (DamageSource) ReducedByResistance() bool

type DeadBush added in v0.4.0

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

DeadBush is a transparent block in the form of an aesthetic plant.

func (DeadBush) BreakInfo added in v0.4.0

func (d DeadBush) BreakInfo() BreakInfo

BreakInfo ...

func (DeadBush) CanDisplace added in v0.4.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (DeadBush) EncodeBlock added in v0.4.0

func (d DeadBush) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DeadBush) EncodeItem added in v0.4.0

func (d DeadBush) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DeadBush) FlammabilityInfo added in v0.4.0

func (d DeadBush) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (DeadBush) HasLiquidDrops added in v0.4.0

func (d DeadBush) HasLiquidDrops() bool

HasLiquidDrops ...

func (DeadBush) Hash added in v0.4.0

func (DeadBush) Hash() (uint64, uint64)

func (DeadBush) LightDiffusionLevel added in v0.4.0

func (DeadBush) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (DeadBush) Model added in v0.4.0

func (DeadBush) Model() world.BlockModel

Model ...

func (DeadBush) NeighbourUpdateTick added in v0.4.0

func (d DeadBush) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (DeadBush) ReplaceableBy added in v0.4.0

func (DeadBush) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (DeadBush) SideClosed added in v0.4.0

func (d DeadBush) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (DeadBush) UseOnBlock added in v0.4.0

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

UseOnBlock ...

type DecoratedPot added in v0.9.7

type DecoratedPot struct {
	// Facing is the direction the pot is facing. The first decoration will be facing opposite of this direction.
	Facing cube.Direction
	// Decorations are the four decorations displayed on the sides of the pot. If a decoration is a brick or nil,
	// the side will appear to be empty.
	Decorations [4]PotDecoration
}

DecoratedPot is a decoration block that can be crafted from up to four pottery sherds, and bricks on the sides where no pattern should be displayed.

func (DecoratedPot) BreakInfo added in v0.9.7

func (p DecoratedPot) BreakInfo() BreakInfo

BreakInfo ...

func (DecoratedPot) DecodeNBT added in v0.9.7

func (p DecoratedPot) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (DecoratedPot) EncodeBlock added in v0.9.7

func (p DecoratedPot) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (DecoratedPot) EncodeItem added in v0.9.7

func (p DecoratedPot) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DecoratedPot) EncodeNBT added in v0.9.7

func (p DecoratedPot) EncodeNBT() map[string]any

EncodeNBT ...

func (DecoratedPot) Hash added in v0.9.7

func (p DecoratedPot) Hash() (uint64, uint64)

func (DecoratedPot) MaxCount added in v0.9.9

func (DecoratedPot) MaxCount() int

MaxCount ...

func (DecoratedPot) Model added in v0.9.7

func (p DecoratedPot) Model() world.BlockModel

Model ...

func (DecoratedPot) UseOnBlock added in v0.9.7

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

UseOnBlock ...

type Deepslate added in v0.8.0

type Deepslate struct {

	// Type is the type of deepslate of the block.
	Type DeepslateType
	// Axis is the axis which the deepslate faces.
	Axis cube.Axis
	// contains filtered or unexported fields
}

Deepslate is similar to stone but is naturally found deep underground around Y0 and below, and is harder to break.

func (Deepslate) BreakInfo added in v0.8.0

func (d Deepslate) BreakInfo() BreakInfo

BreakInfo ...

func (Deepslate) EncodeBlock added in v0.8.0

func (d Deepslate) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Deepslate) EncodeItem added in v0.8.0

func (d Deepslate) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Deepslate) Hash added in v0.8.0

func (d Deepslate) Hash() (uint64, uint64)

func (Deepslate) Instrument added in v0.8.0

func (Deepslate) Instrument() sound.Instrument

Instrument ...

func (Deepslate) Model added in v0.8.0

func (Deepslate) Model() world.BlockModel

Model ...

func (Deepslate) SmeltInfo added in v0.8.0

func (d Deepslate) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Deepslate) UseOnBlock added in v0.8.0

func (d Deepslate) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

type DeepslateBricks added in v0.8.0

type DeepslateBricks struct {

	// Cracked specifies if the deepslate bricks is its cracked variant.
	Cracked bool
	// contains filtered or unexported fields
}

DeepslateBricks are a brick variant of deepslate and can spawn in ancient cities.

func (DeepslateBricks) BreakInfo added in v0.8.0

func (d DeepslateBricks) BreakInfo() BreakInfo

BreakInfo ...

func (DeepslateBricks) EncodeBlock added in v0.8.0

func (d DeepslateBricks) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DeepslateBricks) EncodeItem added in v0.8.0

func (d DeepslateBricks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DeepslateBricks) Hash added in v0.8.0

func (d DeepslateBricks) Hash() (uint64, uint64)

func (DeepslateBricks) Instrument added in v0.8.0

func (DeepslateBricks) Instrument() sound.Instrument

Instrument ...

func (DeepslateBricks) Model added in v0.8.0

func (DeepslateBricks) Model() world.BlockModel

Model ...

func (DeepslateBricks) SmeltInfo added in v0.8.0

func (d DeepslateBricks) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type DeepslateTiles added in v0.8.0

type DeepslateTiles struct {

	// Cracked specifies if the deepslate tiles is its cracked variant.
	Cracked bool
	// contains filtered or unexported fields
}

DeepslateTiles are a tiled variant of deepslate and can spawn in ancient cities.

func (DeepslateTiles) BreakInfo added in v0.8.0

func (d DeepslateTiles) BreakInfo() BreakInfo

BreakInfo ...

func (DeepslateTiles) EncodeBlock added in v0.8.0

func (d DeepslateTiles) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DeepslateTiles) EncodeItem added in v0.8.0

func (d DeepslateTiles) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DeepslateTiles) Hash added in v0.8.0

func (d DeepslateTiles) Hash() (uint64, uint64)

func (DeepslateTiles) Instrument added in v0.8.0

func (DeepslateTiles) Instrument() sound.Instrument

Instrument ...

func (DeepslateTiles) Model added in v0.8.0

func (DeepslateTiles) Model() world.BlockModel

Model ...

func (DeepslateTiles) SmeltInfo added in v0.8.0

func (d DeepslateTiles) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type DeepslateType added in v0.8.0

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

DeepslateType represents a type of deepslate.

func ChiseledDeepslate added in v0.8.0

func ChiseledDeepslate() DeepslateType

ChiseledDeepslate is the chiseled variant of deepslate.

func CobbledDeepslate added in v0.8.0

func CobbledDeepslate() DeepslateType

CobbledDeepslate is the cobbled variant of deepslate.

func DeepslateTypes added in v0.8.0

func DeepslateTypes() []DeepslateType

DeepslateTypes ...

func NormalDeepslate added in v0.8.0

func NormalDeepslate() DeepslateType

NormalDeepslate is the normal variant of deepslate.

func PolishedDeepslate added in v0.8.0

func PolishedDeepslate() DeepslateType

PolishedDeepslate is the polished variant of deepslate.

func (DeepslateType) Name added in v0.8.0

func (s DeepslateType) Name() string

Name ...

func (DeepslateType) String added in v0.8.0

func (s DeepslateType) String() string

String ...

func (DeepslateType) Uint8 added in v0.8.0

func (s DeepslateType) Uint8() uint8

Uint8 returns the deepslate type as a uint8.

type Diamond added in v0.7.3

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

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

func (Diamond) BreakInfo added in v0.7.3

func (d Diamond) BreakInfo() BreakInfo

BreakInfo ...

func (Diamond) EncodeBlock added in v0.7.3

func (Diamond) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Diamond) EncodeItem added in v0.7.3

func (Diamond) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Diamond) Hash added in v0.7.3

func (Diamond) Hash() (uint64, uint64)

func (Diamond) Model added in v0.7.3

func (Diamond) Model() world.BlockModel

Model ...

func (Diamond) PowersBeacon added in v0.7.3

func (Diamond) PowersBeacon() bool

PowersBeacon ...

type DiamondOre

type DiamondOre struct {

	// Type is the type of diamond ore.
	Type OreType
	// contains filtered or unexported fields
}

DiamondOre is a rare ore that generates underground.

func (DiamondOre) BreakInfo

func (d DiamondOre) BreakInfo() BreakInfo

BreakInfo ...

func (DiamondOre) EncodeBlock

func (d DiamondOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DiamondOre) EncodeItem

func (d DiamondOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DiamondOre) Hash

func (d DiamondOre) Hash() (uint64, uint64)

func (DiamondOre) Instrument

func (DiamondOre) Instrument() sound.Instrument

Instrument ...

func (DiamondOre) Model

func (DiamondOre) Model() world.BlockModel

Model ...

func (DiamondOre) SmeltInfo added in v0.8.0

func (DiamondOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type Diorite

type Diorite polishable

Diorite is a type of igneous rock.

func (Diorite) BreakInfo

func (d Diorite) BreakInfo() BreakInfo

BreakInfo ...

func (Diorite) EncodeBlock

func (d Diorite) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Diorite) EncodeItem

func (d Diorite) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Diorite) Hash

func (d Diorite) Hash() (uint64, uint64)

type Dirt

type Dirt struct {

	// Coarse specifies if the dirt should be off the coarse dirt variant. Grass blocks won't spread on
	// the block if set to true.
	Coarse bool
	// contains filtered or unexported fields
}

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

func (Dirt) BreakInfo

func (d Dirt) BreakInfo() BreakInfo

BreakInfo ...

func (Dirt) EncodeBlock

func (d Dirt) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Dirt) EncodeItem

func (d Dirt) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Dirt) Hash

func (d Dirt) Hash() (uint64, uint64)

func (Dirt) Model

func (Dirt) Model() world.BlockModel

Model ...

func (Dirt) Shovel

func (d Dirt) Shovel() (world.Block, bool)

Shovel ...

func (Dirt) SoilFor added in v0.1.0

func (d Dirt) SoilFor(block world.Block) bool

SoilFor ...

func (Dirt) Till

func (d Dirt) Till() (world.Block, bool)

Till ...

type DirtPath

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

DirtPath is a decorative block that can be created by using a shovel on a dirt or grass block.

func (DirtPath) BreakInfo

func (p DirtPath) BreakInfo() BreakInfo

BreakInfo ...

func (DirtPath) EncodeBlock

func (DirtPath) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DirtPath) EncodeItem

func (DirtPath) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DirtPath) Hash

func (DirtPath) Hash() (uint64, uint64)

func (DirtPath) LightDiffusionLevel

func (DirtPath) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (DirtPath) Model

func (DirtPath) Model() world.BlockModel

Model ...

func (DirtPath) NeighbourUpdateTick

func (p DirtPath) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

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

func (DirtPath) Till added in v0.1.0

func (p DirtPath) Till() (world.Block, bool)

Till ...

type DoubleFlower added in v0.1.0

type DoubleFlower struct {

	// UpperPart is set if the plant is the upper part.
	UpperPart bool
	// Type is the type of the double plant.
	Type DoubleFlowerType
	// contains filtered or unexported fields
}

DoubleFlower is a two block high flower consisting of an upper and lower part.

func (DoubleFlower) BoneMeal added in v0.1.0

func (d DoubleFlower) BoneMeal(pos cube.Pos, w *world.World) bool

BoneMeal ...

func (DoubleFlower) BreakInfo added in v0.1.0

func (d DoubleFlower) BreakInfo() BreakInfo

BreakInfo ...

func (DoubleFlower) CompostChance added in v0.8.2

func (DoubleFlower) CompostChance() float64

CompostChance ...

func (DoubleFlower) EncodeBlock added in v0.1.0

func (d DoubleFlower) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DoubleFlower) EncodeItem added in v0.1.0

func (d DoubleFlower) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DoubleFlower) FlammabilityInfo added in v0.1.0

func (d DoubleFlower) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (DoubleFlower) HasLiquidDrops added in v0.1.0

func (d DoubleFlower) HasLiquidDrops() bool

HasLiquidDrops ...

func (DoubleFlower) Hash added in v0.1.0

func (d DoubleFlower) Hash() (uint64, uint64)

func (DoubleFlower) LightDiffusionLevel added in v0.1.0

func (DoubleFlower) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (DoubleFlower) Model added in v0.1.0

func (DoubleFlower) Model() world.BlockModel

Model ...

func (DoubleFlower) NeighbourUpdateTick added in v0.1.0

func (d DoubleFlower) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (DoubleFlower) UseOnBlock added in v0.1.0

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

UseOnBlock ...

type DoubleFlowerType added in v0.1.0

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

DoubleFlowerType represents a type of double flower.

func DoubleFlowerTypes added in v0.1.0

func DoubleFlowerTypes() []DoubleFlowerType

DoubleFlowerTypes ...

func Lilac added in v0.1.0

func Lilac() DoubleFlowerType

Lilac is a lilac plant.

func Peony added in v0.1.0

func Peony() DoubleFlowerType

Peony is a peony plant.

func RoseBush added in v0.1.0

func RoseBush() DoubleFlowerType

RoseBush is a rose bush plant.

func Sunflower added in v0.1.0

func Sunflower() DoubleFlowerType

Sunflower is a sunflower plant.

func (DoubleFlowerType) Name added in v0.1.0

func (d DoubleFlowerType) Name() string

Name ...

func (DoubleFlowerType) String added in v0.1.0

func (d DoubleFlowerType) String() string

String ...

func (DoubleFlowerType) Uint8 added in v0.1.0

func (d DoubleFlowerType) Uint8() uint8

Uint8 returns the double plant as a uint8.

type DoubleTallGrass added in v0.1.0

type DoubleTallGrass struct {

	// UpperPart is set if the plant is the upper part.
	UpperPart bool
	// Type is the type of double tall grass.
	Type DoubleTallGrassType
	// contains filtered or unexported fields
}

DoubleTallGrass is a two-block high variety of grass.

func (DoubleTallGrass) BreakInfo added in v0.1.0

func (d DoubleTallGrass) BreakInfo() BreakInfo

BreakInfo ...

func (DoubleTallGrass) CompostChance added in v0.8.2

func (d DoubleTallGrass) CompostChance() float64

CompostChance ...

func (DoubleTallGrass) EncodeBlock added in v0.1.0

func (d DoubleTallGrass) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DoubleTallGrass) EncodeItem added in v0.1.0

func (d DoubleTallGrass) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DoubleTallGrass) FlammabilityInfo added in v0.1.0

func (d DoubleTallGrass) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (DoubleTallGrass) HasLiquidDrops added in v0.1.0

func (d DoubleTallGrass) HasLiquidDrops() bool

HasLiquidDrops ...

func (DoubleTallGrass) Hash added in v0.1.0

func (d DoubleTallGrass) Hash() (uint64, uint64)

func (DoubleTallGrass) LightDiffusionLevel added in v0.1.0

func (DoubleTallGrass) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (DoubleTallGrass) Model added in v0.1.0

func (DoubleTallGrass) Model() world.BlockModel

Model ...

func (DoubleTallGrass) NeighbourUpdateTick added in v0.1.0

func (d DoubleTallGrass) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (DoubleTallGrass) ReplaceableBy added in v0.1.0

func (DoubleTallGrass) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (DoubleTallGrass) UseOnBlock added in v0.1.0

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

UseOnBlock ...

type DoubleTallGrassType added in v0.8.7

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

DoubleTallGrassType represents a type of double tall grass, which can be placed on top of grass blocks.

func DoubleTallGrassTypes added in v0.8.7

func DoubleTallGrassTypes() []DoubleTallGrassType

DoubleTallGrassTypes returns all variants of double tall grass.

func FernDoubleTallGrass added in v0.8.7

func FernDoubleTallGrass() DoubleTallGrassType

FernDoubleTallGrass returns the fern variant of double tall grass.

func NormalDoubleTallGrass added in v0.8.7

func NormalDoubleTallGrass() DoubleTallGrassType

NormalDoubleTallGrass returns the normal variant of double tall grass.

func (DoubleTallGrassType) Name added in v0.8.7

func (t DoubleTallGrassType) Name() string

Name ...

func (DoubleTallGrassType) String added in v0.8.7

func (t DoubleTallGrassType) String() string

String ...

func (DoubleTallGrassType) Uint8 added in v0.8.7

func (t DoubleTallGrassType) Uint8() uint8

Uint8 ...

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 cube.Pos, _ cube.Face, w *world.World, _ item.User, _ *item.UseContext) bool

Activate ...

func (DragonEgg) BreakInfo

func (d DragonEgg) BreakInfo() BreakInfo

BreakInfo ...

func (DragonEgg) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (DragonEgg) EncodeBlock

func (DragonEgg) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DragonEgg) EncodeItem

func (DragonEgg) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DragonEgg) Hash

func (DragonEgg) Hash() (uint64, uint64)

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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (DragonEgg) Punch

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

Punch ...

func (DragonEgg) SideClosed

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

SideClosed ...

func (DragonEgg) Solidifies

func (g DragonEgg) Solidifies(cube.Pos, *world.World) bool

Solidifies ...

type DriedKelp added in v0.7.3

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

DriedKelp is a block primarily used as fuel in furnaces.

func (DriedKelp) BreakInfo added in v0.7.3

func (d DriedKelp) BreakInfo() BreakInfo

BreakInfo ...

func (DriedKelp) CompostChance added in v0.8.2

func (DriedKelp) CompostChance() float64

CompostChance ...

func (DriedKelp) EncodeBlock added in v0.7.3

func (DriedKelp) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (DriedKelp) EncodeItem added in v0.7.3

func (DriedKelp) EncodeItem() (name string, meta int16)

EncodeItem ...

func (DriedKelp) FlammabilityInfo added in v0.7.3

func (DriedKelp) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (DriedKelp) FuelInfo added in v0.8.0

func (DriedKelp) FuelInfo() item.FuelInfo

FuelInfo ...

func (DriedKelp) Hash added in v0.7.3

func (DriedKelp) Hash() (uint64, uint64)

func (DriedKelp) Model added in v0.7.3

func (DriedKelp) Model() world.BlockModel

Model ...

type Dripstone added in v0.1.0

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

Dripstone is a rock block that allows pointed dripstone to grow beneath it.

func (Dripstone) BreakInfo added in v0.1.0

func (d Dripstone) BreakInfo() BreakInfo

BreakInfo ...

func (Dripstone) EncodeBlock added in v0.1.0

func (d Dripstone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Dripstone) EncodeItem added in v0.1.0

func (d Dripstone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Dripstone) Hash added in v0.1.0

func (Dripstone) Hash() (uint64, uint64)

func (Dripstone) Instrument added in v0.1.0

func (Dripstone) Instrument() sound.Instrument

Instrument ...

func (Dripstone) Model added in v0.1.0

func (Dripstone) Model() world.BlockModel

Model ...

type Emerald added in v0.7.3

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

Emerald is a precious mineral block crafted using 9 emeralds.

func (Emerald) BreakInfo added in v0.7.3

func (e Emerald) BreakInfo() BreakInfo

BreakInfo ...

func (Emerald) EncodeBlock added in v0.7.3

func (Emerald) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Emerald) EncodeItem added in v0.7.3

func (Emerald) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Emerald) Hash added in v0.7.3

func (Emerald) Hash() (uint64, uint64)

func (Emerald) Instrument added in v0.7.3

func (e Emerald) Instrument() sound.Instrument

Instrument ...

func (Emerald) Model added in v0.7.3

func (Emerald) Model() world.BlockModel

Model ...

func (Emerald) PowersBeacon added in v0.7.3

func (Emerald) PowersBeacon() bool

PowersBeacon ...

type EmeraldOre

type EmeraldOre struct {

	// Type is the type of emerald ore.
	Type OreType
	// 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) EncodeBlock

func (e EmeraldOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (EmeraldOre) EncodeItem

func (e EmeraldOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (EmeraldOre) Hash

func (e EmeraldOre) Hash() (uint64, uint64)

func (EmeraldOre) Instrument

func (EmeraldOre) Instrument() sound.Instrument

Instrument ...

func (EmeraldOre) Model

func (EmeraldOre) Model() world.BlockModel

Model ...

func (EmeraldOre) SmeltInfo added in v0.8.0

func (EmeraldOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type EnchantingTable added in v0.8.0

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

EnchantingTable is a block that allows players to spend their experience point levels to enchant tools, weapons, books, armor, and certain other items.

func (EnchantingTable) Activate added in v0.8.0

func (EnchantingTable) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (EnchantingTable) BreakInfo added in v0.8.0

func (e EnchantingTable) BreakInfo() BreakInfo

BreakInfo ...

func (EnchantingTable) CanDisplace added in v0.8.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (EnchantingTable) DecodeNBT added in v0.8.0

func (e EnchantingTable) DecodeNBT(map[string]any) any

DecodeNBT is used to implement world.NBTer.

func (EnchantingTable) EncodeBlock added in v0.8.0

func (EnchantingTable) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (EnchantingTable) EncodeItem added in v0.8.0

func (EnchantingTable) EncodeItem() (name string, meta int16)

EncodeItem ...

func (EnchantingTable) EncodeNBT added in v0.8.0

func (e EnchantingTable) EncodeNBT() map[string]any

EncodeNBT is used to encode the block to NBT, so that the enchanting table book will be rendered properly client-side. The actual rotation value doesn't need to be set in the NBT, we just need to write the default NBT for the block.

func (EnchantingTable) Hash added in v0.8.0

func (EnchantingTable) Hash() (uint64, uint64)

func (EnchantingTable) Instrument added in v0.8.0

func (EnchantingTable) Instrument() sound.Instrument

Instrument ...

func (EnchantingTable) LightDiffusionLevel added in v0.8.0

func (EnchantingTable) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (EnchantingTable) LightEmissionLevel added in v0.8.0

func (EnchantingTable) LightEmissionLevel() uint8

LightEmissionLevel ...

func (EnchantingTable) Model added in v0.8.0

func (e EnchantingTable) Model() world.BlockModel

Model ...

func (EnchantingTable) SideClosed added in v0.8.0

func (EnchantingTable) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

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 (e EndBricks) BreakInfo() BreakInfo

BreakInfo ...

func (EndBricks) EncodeBlock

func (EndBricks) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (EndBricks) EncodeItem

func (EndBricks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (EndBricks) Hash

func (EndBricks) Hash() (uint64, uint64)

func (EndBricks) Instrument

func (EndBricks) Instrument() sound.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) EncodeBlock

func (EndStone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (EndStone) EncodeItem

func (EndStone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (EndStone) Hash

func (EndStone) Hash() (uint64, uint64)

func (EndStone) Instrument

func (EndStone) Instrument() sound.Instrument

Instrument ...

func (EndStone) Model

func (EndStone) Model() world.BlockModel

Model ...

type EnderChest added in v0.8.0

type EnderChest struct {

	// Facing is the direction that the ender chest is facing.
	Facing cube.Direction
	// contains filtered or unexported fields
}

EnderChest is a type of chest whose contents are exclusive to each player, and can be accessed from anywhere. The empty value of EnderChest is not valid. It must be created using block.NewEnderChest().

func NewEnderChest added in v0.8.0

func NewEnderChest() EnderChest

NewEnderChest creates a new initialised ender chest.

func (EnderChest) Activate added in v0.8.0

func (c EnderChest) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (EnderChest) AddViewer added in v0.8.0

func (c EnderChest) AddViewer(w *world.World, pos cube.Pos)

AddViewer ...

func (EnderChest) BreakInfo added in v0.8.0

func (c EnderChest) BreakInfo() BreakInfo

BreakInfo ...

func (EnderChest) CanDisplace added in v0.8.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (EnderChest) DecodeNBT added in v0.8.0

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

DecodeNBT ...

func (EnderChest) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (EnderChest) EncodeItem added in v0.8.0

func (EnderChest) EncodeItem() (name string, meta int16)

EncodeItem ...

func (EnderChest) EncodeNBT added in v0.8.0

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

EncodeNBT ...

func (EnderChest) Hash added in v0.8.0

func (c EnderChest) Hash() (uint64, uint64)

func (EnderChest) Instrument added in v0.8.0

func (EnderChest) Instrument() sound.Instrument

Instrument ...

func (EnderChest) LightDiffusionLevel added in v0.8.0

func (EnderChest) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (EnderChest) LightEmissionLevel added in v0.8.0

func (c EnderChest) LightEmissionLevel() uint8

LightEmissionLevel ...

func (EnderChest) Model added in v0.8.0

func (EnderChest) Model() world.BlockModel

Model ...

func (EnderChest) RemoveViewer added in v0.8.0

func (c EnderChest) RemoveViewer(w *world.World, pos cube.Pos)

RemoveViewer ...

func (EnderChest) SideClosed added in v0.8.0

func (EnderChest) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (EnderChest) UseOnBlock added in v0.8.0

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

UseOnBlock ...

type EntityInsider added in v0.4.0

type EntityInsider interface {
	// EntityInside is called when an entity goes inside the block's 1x1x1 axis aligned bounding box.
	EntityInside(pos cube.Pos, w *world.World, e world.Entity)
}

EntityInsider represents a block that reacts to an entity going inside its 1x1x1 axis aligned bounding box.

type EntityLander added in v0.4.0

type EntityLander interface {
	// EntityLand is called when an entity lands on the block.
	EntityLand(pos cube.Pos, w *world.World, e world.Entity, distance *float64)
}

EntityLander represents a block that reacts to an entity landing on it after falling.

type Explodable added in v0.8.0

type Explodable interface {
	// Explode is called when an explosion occurs. The block can react to the explosion using the configuration passed.
	Explode(explosionPos mgl64.Vec3, pos cube.Pos, w *world.World, c ExplosionConfig)
}

Explodable represents a block that can be exploded.

type ExplodableEntity added in v0.8.0

type ExplodableEntity interface {
	// Explode is called when an explosion occurs. The entity can then react to the explosion using the configuration
	// and impact provided.
	Explode(explosionPos mgl64.Vec3, impact float64, c ExplosionConfig)
}

ExplodableEntity represents an entity that can be exploded.

type ExplosionConfig added in v0.8.0

type ExplosionConfig struct {
	// Size is the size of the explosion, it is effectively the radius which entities/blocks will be affected within.
	Size float64
	// Rand is the source to use for the explosion "randomness".
	Rand rand.Source
	// SpawnFire will cause the explosion to randomly start fires in 1/3 of all destroyed air blocks that are
	// above opaque blocks.
	SpawnFire bool
	// DisableItemDrops, when set to true, will prevent any item entities from dropping as a result of blocks being
	// destroyed.
	DisableItemDrops bool

	// Sound is the sound to play when the explosion is created. If set to nil, this will default to the sound of a
	// regular explosion.
	Sound world.Sound
	// Particle is the particle to spawn when the explosion is created. If set to nil, this will default to the particle
	// of a regular huge explosion.
	Particle world.Particle
}

ExplosionConfig is the configuration for an explosion. The world, position, size, sound, particle, and more can all be configured through this configuration.

func (ExplosionConfig) Explode added in v0.8.0

func (c ExplosionConfig) Explode(w *world.World, explosionPos mgl64.Vec3)

Explode performs the explosion as specified by the configuration.

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
	// decrements until it turns into dirt.
	Hydration int
	// contains filtered or unexported fields
}

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

func (Farmland) BreakInfo

func (f Farmland) BreakInfo() BreakInfo

BreakInfo ...

func (Farmland) EncodeBlock

func (f Farmland) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Farmland) EncodeItem

func (f Farmland) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Farmland) EntityLand added in v0.4.0

func (f Farmland) EntityLand(pos cube.Pos, w *world.World, e world.Entity, distance *float64)

EntityLand ...

func (Farmland) Hash

func (f Farmland) Hash() (uint64, uint64)

func (Farmland) Model

func (Farmland) Model() world.BlockModel

Model ...

func (Farmland) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Farmland) RandomTick

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

RandomTick ...

func (Farmland) SoilFor added in v0.1.0

func (f Farmland) SoilFor(block world.Block) bool

SoilFor ...

type Fern added in v0.1.0

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

Fern is a transparent plant block which can be used to obtain seeds and as decoration.

func (Fern) BoneMeal added in v0.9.16

func (g Fern) BoneMeal(pos cube.Pos, w *world.World) bool

BoneMeal attempts to affect the block using a bone meal item.

func (Fern) BreakInfo added in v0.9.16

func (g Fern) BreakInfo() BreakInfo

BreakInfo ...

func (Fern) CompostChance added in v0.9.16

func (g Fern) CompostChance() float64

CompostChance ...

func (Fern) EncodeBlock added in v0.9.16

func (g Fern) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Fern) EncodeItem added in v0.9.16

func (g Fern) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Fern) FlammabilityInfo added in v0.9.16

func (g Fern) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Fern) HasLiquidDrops added in v0.9.16

func (g Fern) HasLiquidDrops() bool

HasLiquidDrops ...

func (Fern) Hash added in v0.9.16

func (Fern) Hash() (uint64, uint64)

func (Fern) LightDiffusionLevel added in v0.9.16

func (Fern) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Fern) Model added in v0.9.16

func (Fern) Model() world.BlockModel

Model ...

func (Fern) NeighbourUpdateTick added in v0.9.16

func (g Fern) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Fern) ReplaceableBy added in v0.9.16

func (Fern) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (Fern) UseOnBlock added in v0.9.16

func (g Fern) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

type Fire

type Fire struct {

	// Type is the type of fire.
	Type FireType
	// 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]any)

EncodeBlock ...

func (Fire) EntityInside added in v0.4.0

func (f Fire) EntityInside(_ cube.Pos, _ *world.World, e world.Entity)

EntityInside ...

func (Fire) HasLiquidDrops

func (f Fire) HasLiquidDrops() bool

HasLiquidDrops ...

func (Fire) Hash

func (f Fire) Hash() (uint64, uint64)

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 cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Fire) RandomTick

func (f Fire) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

RandomTick ...

func (Fire) ReplaceableBy

func (Fire) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (Fire) ScheduledTick

func (f Fire) ScheduledTick(pos cube.Pos, w *world.World, r *rand.Rand)

ScheduledTick ...

func (Fire) Start added in v0.3.0

func (f Fire) Start(w *world.World, pos cube.Pos)

Start starts a fire at a position in the world. The position passed must be either air or tall grass and conditions for a fire to be present must be present.

type FireDamageSource added in v0.8.6

type FireDamageSource struct{}

FireDamageSource is used for damage caused by being in fire.

func (FireDamageSource) AffectedByEnchantment added in v0.8.6

func (FireDamageSource) AffectedByEnchantment(e item.EnchantmentType) bool

func (FireDamageSource) Fire added in v0.8.6

func (FireDamageSource) Fire() bool

func (FireDamageSource) ReducedByArmour added in v0.8.6

func (FireDamageSource) ReducedByArmour() bool

func (FireDamageSource) ReducedByResistance added in v0.8.6

func (FireDamageSource) ReducedByResistance() bool

type FireType

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

FireType represents a type of fire. Used by flaming blocks such as torches, lanterns, fire, and campfires.

func FireTypes

func FireTypes() []FireType

FireTypes ...

func NormalFire

func NormalFire() FireType

NormalFire is the default variant of fires

func SoulFire

func SoulFire() FireType

SoulFire is a turquoise variant of normal fire

func (FireType) Damage added in v0.7.3

func (f FireType) Damage() float64

Damage returns the amount of damage taken by entities inside the fire.

func (FireType) LightLevel

func (f FireType) LightLevel() uint8

LightLevel returns the light level of the fire.

func (FireType) Name

func (f FireType) Name() string

Name ...

func (FireType) String

func (f FireType) String() string

String ...

func (FireType) Uint8

func (f FireType) Uint8() uint8

Uint8 returns the fire as a uint8.

type FlammabilityInfo

type FlammabilityInfo struct {
	// Encouragement is the chance a block will catch on fire during attempted fire spread.
	Encouragement int
	// Flammability is the chance a block will burn away during a fire block tick.
	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 block's behavior involving fire.
	FlammabilityInfo() FlammabilityInfo
}

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

type FletchingTable added in v0.8.0

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

FletchingTable is a block in villages that turn an unemployed villager into a Fletcher.

func (FletchingTable) BreakInfo added in v0.8.0

func (f FletchingTable) BreakInfo() BreakInfo

BreakInfo ...

func (FletchingTable) EncodeBlock added in v0.8.0

func (FletchingTable) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (FletchingTable) EncodeItem added in v0.8.0

func (FletchingTable) EncodeItem() (string, int16)

EncodeItem ...

func (FletchingTable) FuelInfo added in v0.8.0

func (FletchingTable) FuelInfo() item.FuelInfo

FuelInfo ...

func (FletchingTable) Hash added in v0.8.0

func (FletchingTable) Hash() (uint64, uint64)

func (FletchingTable) Instrument added in v0.8.0

func (FletchingTable) Instrument() sound.Instrument

Instrument ...

func (FletchingTable) Model added in v0.8.0

func (FletchingTable) Model() world.BlockModel

Model ...

type Flower added in v0.1.0

type Flower struct {

	// Type is the type of flower.
	Type FlowerType
	// contains filtered or unexported fields
}

Flower is a non-solid plant that occur in a variety of shapes and colours. They are primarily used for decoration and crafted into dyes.

func (Flower) BoneMeal added in v0.1.0

func (f Flower) BoneMeal(pos cube.Pos, w *world.World) (success bool)

BoneMeal ...

func (Flower) BreakInfo added in v0.1.0

func (f Flower) BreakInfo() BreakInfo

BreakInfo ...

func (Flower) CompostChance added in v0.8.2

func (Flower) CompostChance() float64

CompostChance ...

func (Flower) EncodeBlock added in v0.1.0

func (f Flower) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Flower) EncodeItem added in v0.1.0

func (f Flower) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Flower) EntityInside added in v0.4.0

func (f Flower) EntityInside(_ cube.Pos, _ *world.World, e world.Entity)

EntityInside ...

func (Flower) FlammabilityInfo added in v0.1.0

func (f Flower) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Flower) HasLiquidDrops added in v0.1.0

func (Flower) HasLiquidDrops() bool

HasLiquidDrops ...

func (Flower) Hash added in v0.1.0

func (f Flower) Hash() (uint64, uint64)

func (Flower) LightDiffusionLevel added in v0.1.0

func (Flower) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Flower) Model added in v0.1.0

func (Flower) Model() world.BlockModel

Model ...

func (Flower) NeighbourUpdateTick added in v0.1.0

func (f Flower) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Flower) UseOnBlock added in v0.1.0

func (f Flower) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

type FlowerType added in v0.1.0

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

FlowerType represents a type of flower.

func Allium added in v0.1.0

func Allium() FlowerType

Allium is an allium flower.

func AzureBluet added in v0.1.0

func AzureBluet() FlowerType

AzureBluet is an azure bluet flower.

func BlueOrchid added in v0.1.0

func BlueOrchid() FlowerType

BlueOrchid is a blue orchid flower.

func Cornflower added in v0.1.0

func Cornflower() FlowerType

Cornflower is a cornflower flower.

func Dandelion added in v0.1.0

func Dandelion() FlowerType

Dandelion is a dandelion flower.

func FlowerTypes added in v0.1.0

func FlowerTypes() []FlowerType

FlowerTypes ...

func LilyOfTheValley added in v0.1.0

func LilyOfTheValley() FlowerType

LilyOfTheValley is a lily of the valley flower.

func OrangeTulip added in v0.1.0

func OrangeTulip() FlowerType

OrangeTulip is an orange tulip flower.

func OxeyeDaisy added in v0.1.0

func OxeyeDaisy() FlowerType

OxeyeDaisy is an oxeye daisy flower.

func PinkTulip added in v0.1.0

func PinkTulip() FlowerType

PinkTulip is a pink tulip flower.

func Poppy added in v0.1.0

func Poppy() FlowerType

Poppy is a poppy flower.

func RedTulip added in v0.1.0

func RedTulip() FlowerType

RedTulip is a red tulip flower.

func WhiteTulip added in v0.1.0

func WhiteTulip() FlowerType

WhiteTulip is a white tulip flower.

func WitherRose added in v0.1.0

func WitherRose() FlowerType

WitherRose is a wither rose flower.

func (FlowerType) Name added in v0.1.0

func (f FlowerType) Name() string

Name ...

func (FlowerType) String added in v0.1.0

func (f FlowerType) String() string

String ...

func (FlowerType) Uint8 added in v0.1.0

func (f FlowerType) Uint8() uint8

Uint8 returns the flower as a uint8.

type Frictional added in v0.4.0

type Frictional interface {
	// Friction returns the block's friction value.
	Friction() float64
}

Frictional represents a block that may have a custom friction value. Friction is used for entity drag when the entity is on ground. If a block does not implement this interface, it should be assumed that its friction is 0.6.

type Froglight added in v0.7.0

type Froglight struct {

	// Type is the type of froglight.
	Type FroglightType
	// Axis is the axis which the froglight block faces.
	Axis cube.Axis
	// contains filtered or unexported fields
}

Froglight is a luminous natural block that can be obtained if a frog eats a tiny magma cube.

func (Froglight) BreakInfo added in v0.7.0

func (f Froglight) BreakInfo() BreakInfo

BreakInfo ...

func (Froglight) EncodeBlock added in v0.7.0

func (f Froglight) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Froglight) EncodeItem added in v0.7.0

func (f Froglight) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Froglight) Hash added in v0.7.0

func (f Froglight) Hash() (uint64, uint64)

func (Froglight) LightEmissionLevel added in v0.7.0

func (f Froglight) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Froglight) Model added in v0.7.0

func (Froglight) Model() world.BlockModel

Model ...

func (Froglight) UseOnBlock added in v0.7.0

func (f Froglight) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

type FroglightType added in v0.7.0

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

FroglightType represents a type of froglight.

func FroglightTypes added in v0.7.0

func FroglightTypes() []FroglightType

FroglightTypes ...

func Ochre added in v0.7.0

func Ochre() FroglightType

Ochre is the yellow variant of froglight.

func Pearlescent added in v0.7.0

func Pearlescent() FroglightType

Pearlescent is the purple variant of froglight.

func Verdant added in v0.7.0

func Verdant() FroglightType

Verdant is the green variant of froglight.

func (FroglightType) Name added in v0.7.0

func (f FroglightType) Name() string

Name ...

func (FroglightType) String added in v0.7.0

func (f FroglightType) String() string

String ...

func (FroglightType) Uint8 added in v0.7.0

func (f FroglightType) Uint8() uint8

Uint8 ...

type Furnace added in v0.8.0

type Furnace struct {

	// Facing is the direction the furnace is facing.
	Facing cube.Direction
	// Lit is true if the furnace is lit.
	Lit bool
	// contains filtered or unexported fields
}

Furnace is a utility block used for the smelting of blocks and items. The empty value of Furnace is not valid. It must be created using block.NewFurnace(cube.Face).

func NewFurnace added in v0.8.0

func NewFurnace(face cube.Direction) Furnace

NewFurnace creates a new initialised furnace. The smelter is properly initialised.

func (Furnace) Activate added in v0.8.0

func (f Furnace) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Furnace) AddViewer added in v0.8.0

func (s Furnace) AddViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (Furnace) BreakInfo added in v0.8.0

func (f Furnace) BreakInfo() BreakInfo

BreakInfo ...

func (Furnace) DecodeNBT added in v0.8.0

func (f Furnace) DecodeNBT(data map[string]interface{}) interface{}

DecodeNBT ...

func (Furnace) Durations added in v0.8.0

func (s Furnace) Durations() (remaining time.Duration, max time.Duration, cook time.Duration)

Durations returns the remaining, maximum, and cook durations of the smelter.

func (Furnace) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (Furnace) EncodeItem added in v0.8.0

func (f Furnace) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Furnace) EncodeNBT added in v0.8.0

func (f Furnace) EncodeNBT() map[string]interface{}

EncodeNBT ...

func (Furnace) Experience added in v0.8.0

func (s Furnace) Experience() int

Experience returns the collected experience of the smelter.

func (Furnace) ExtractItem added in v0.9.18

func (s Furnace) ExtractItem(h Hopper, pos cube.Pos, w *world.World) bool

ExtractItem ...

func (Furnace) Hash added in v0.8.0

func (f Furnace) Hash() (uint64, uint64)

func (Furnace) InsertItem added in v0.9.18

func (s Furnace) InsertItem(h Hopper, pos cube.Pos, w *world.World) bool

InsertItem ...

func (Furnace) Instrument added in v0.8.0

func (Furnace) Instrument() sound.Instrument

Instrument ...

func (Furnace) Inventory added in v0.8.0

func (s Furnace) Inventory(*world.World, cube.Pos) *inventory.Inventory

Inventory returns the inventory of the furnace.

func (Furnace) Model added in v0.8.0

func (Furnace) Model() world.BlockModel

Model ...

func (Furnace) RemoveViewer added in v0.8.0

func (s Furnace) RemoveViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (Furnace) ResetExperience added in v0.8.0

func (s Furnace) ResetExperience() int

ResetExperience resets the collected experience of the smelter, and returns the amount of experience that was reset.

func (Furnace) Tick added in v0.8.0

func (f Furnace) Tick(_ int64, pos cube.Pos, w *world.World)

Tick is called to check if the furnace should update and start or stop smelting.

func (Furnace) UseOnBlock added in v0.8.0

func (f Furnace) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

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

func (Glass) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Glass) EncodeItem

func (Glass) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Glass) Hash

func (Glass) Hash() (uint64, uint64)

func (Glass) Instrument

func (Glass) Instrument() sound.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 (s GlassPane) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (GlassPane) EncodeBlock

func (GlassPane) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (GlassPane) EncodeItem

func (GlassPane) EncodeItem() (name string, meta int16)

EncodeItem ...

func (GlassPane) Hash

func (GlassPane) Hash() (uint64, uint64)

func (GlassPane) Instrument

func (GlassPane) Instrument() sound.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(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

type GlazedTerracotta

type GlazedTerracotta struct {

	// Colour specifies the colour of the block.
	Colour item.Colour
	// Facing specifies the face of the block.
	Facing cube.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]any)

EncodeBlock ...

func (GlazedTerracotta) EncodeItem

func (t GlazedTerracotta) EncodeItem() (name string, meta int16)

EncodeItem ...

func (GlazedTerracotta) Hash

func (t GlazedTerracotta) Hash() (uint64, uint64)

func (GlazedTerracotta) Instrument

func (GlazedTerracotta) Instrument() sound.Instrument

Instrument ...

func (GlazedTerracotta) Model

func (GlazedTerracotta) Model() world.BlockModel

Model ...

func (GlazedTerracotta) UseOnBlock

func (t GlazedTerracotta) UseOnBlock(pos cube.Pos, face cube.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) EncodeBlock

func (Glowstone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Glowstone) EncodeItem

func (Glowstone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Glowstone) Hash

func (Glowstone) Hash() (uint64, uint64)

func (Glowstone) Instrument

func (g Glowstone) Instrument() sound.Instrument

Instrument ...

func (Glowstone) LightEmissionLevel

func (Glowstone) LightEmissionLevel() uint8

LightEmissionLevel returns 15.

func (Glowstone) Model

func (Glowstone) Model() world.BlockModel

Model ...

type Gold added in v0.7.3

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

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

func (Gold) BreakInfo added in v0.7.3

func (g Gold) BreakInfo() BreakInfo

BreakInfo ...

func (Gold) EncodeBlock added in v0.7.3

func (Gold) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Gold) EncodeItem added in v0.7.3

func (Gold) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Gold) Hash added in v0.7.3

func (Gold) Hash() (uint64, uint64)

func (Gold) Instrument added in v0.7.3

func (g Gold) Instrument() sound.Instrument

Instrument ...

func (Gold) Model added in v0.7.3

func (Gold) Model() world.BlockModel

Model ...

func (Gold) PowersBeacon added in v0.7.3

func (Gold) PowersBeacon() bool

PowersBeacon ...

type GoldOre

type GoldOre struct {

	// Type is the type of gold ore.
	Type OreType
	// contains filtered or unexported fields
}

GoldOre is a rare mineral block found underground.

func (GoldOre) BreakInfo

func (g GoldOre) BreakInfo() BreakInfo

BreakInfo ...

func (GoldOre) EncodeBlock

func (g GoldOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (GoldOre) EncodeItem

func (g GoldOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (GoldOre) Hash

func (g GoldOre) Hash() (uint64, uint64)

func (GoldOre) Instrument

func (GoldOre) Instrument() sound.Instrument

Instrument ...

func (GoldOre) Model

func (GoldOre) Model() world.BlockModel

Model ...

func (GoldOre) SmeltInfo added in v0.8.0

func (GoldOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type Granite

type Granite polishable

Granite is a type of igneous rock.

func (Granite) BreakInfo

func (g Granite) BreakInfo() BreakInfo

BreakInfo ...

func (Granite) EncodeBlock

func (g Granite) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Granite) EncodeItem

func (g Granite) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Granite) Hash

func (g Granite) Hash() (uint64, uint64)

type Grass

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

Grass blocks generate abundantly across the surface of the world.

func (Grass) BoneMeal added in v0.4.0

func (g Grass) BoneMeal(pos cube.Pos, w *world.World) bool

BoneMeal ...

func (Grass) BreakInfo

func (g Grass) BreakInfo() BreakInfo

BreakInfo ...

func (Grass) CompostChance added in v0.8.2

func (Grass) CompostChance() float64

CompostChance ...

func (Grass) EncodeBlock

func (Grass) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Grass) EncodeItem

func (Grass) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Grass) Hash

func (Grass) Hash() (uint64, uint64)

func (Grass) Model

func (Grass) Model() world.BlockModel

Model ...

func (Grass) RandomTick

func (g Grass) RandomTick(pos cube.Pos, 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.

func (Grass) Shovel

func (g Grass) Shovel() (world.Block, bool)

Shovel ...

func (Grass) SoilFor added in v0.1.0

func (g Grass) SoilFor(block world.Block) bool

SoilFor ...

func (Grass) Till

func (g Grass) Till() (world.Block, bool)

Till ...

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

func (Gravel) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Gravel) EncodeItem

func (Gravel) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Gravel) Hash

func (Gravel) Hash() (uint64, uint64)

func (Gravel) Instrument

func (Gravel) Instrument() sound.Instrument

Instrument ...

func (Gravel) Model

func (Gravel) Model() world.BlockModel

Model ...

func (Gravel) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Gravel) Solidifies

func (g Gravel) Solidifies(cube.Pos, *world.World) bool

Solidifies ...

type Grindstone added in v0.8.2

type Grindstone struct {

	// Attach represents the attachment type of the Grindstone.
	Attach GrindstoneAttachment
	// Facing represents the direction the Grindstone is facing.
	Facing cube.Direction
	// contains filtered or unexported fields
}

Grindstone is a block that repairs items and tools as well as removing enchantments from them. It also serves as a weaponsmith's job site block.

func (Grindstone) Activate added in v0.8.2

func (g Grindstone) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Grindstone) BreakInfo added in v0.8.2

func (g Grindstone) BreakInfo() BreakInfo

BreakInfo ...

func (Grindstone) EncodeBlock added in v0.8.2

func (g Grindstone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Grindstone) EncodeItem added in v0.8.2

func (g Grindstone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Grindstone) Hash added in v0.8.2

func (g Grindstone) Hash() (uint64, uint64)

func (Grindstone) LightDiffusionLevel added in v0.8.2

func (Grindstone) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Grindstone) Model added in v0.8.2

func (g Grindstone) Model() world.BlockModel

Model ...

func (Grindstone) NeighbourUpdateTick added in v0.8.2

func (g Grindstone) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Grindstone) UseOnBlock added in v0.8.2

func (g Grindstone) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

type GrindstoneAttachment added in v0.8.2

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

GrindstoneAttachment represents a type of attachment for a Grindstone.

func GrindstoneAttachments added in v0.8.2

func GrindstoneAttachments() []GrindstoneAttachment

GrindstoneAttachments returns all possible GrindstoneAttachments.

func HangingGrindstoneAttachment added in v0.8.2

func HangingGrindstoneAttachment() GrindstoneAttachment

HangingGrindstoneAttachment is a type of attachment for a hanging Grindstone.

func StandingGrindstoneAttachment added in v0.8.2

func StandingGrindstoneAttachment() GrindstoneAttachment

StandingGrindstoneAttachment is a type of attachment for a standing Grindstone.

func WallGrindstoneAttachment added in v0.8.2

func WallGrindstoneAttachment() GrindstoneAttachment

WallGrindstoneAttachment is a type of attachment for a wall Grindstone.

func (GrindstoneAttachment) String added in v0.8.2

func (g GrindstoneAttachment) String() string

String returns the GrindstoneAttachment as a string.

func (GrindstoneAttachment) Uint8 added in v0.8.2

func (g GrindstoneAttachment) Uint8() uint8

Uint8 returns the GrindstoneAttachment as a uint8.

type HayBale added in v0.7.3

type HayBale struct {

	// Axis is the axis which the hay bale block faces.
	Axis cube.Axis
	// contains filtered or unexported fields
}

HayBale is a decorative, flammable block that can also be used to feed horses, breed llamas, reduce fall damage, and extend campfire smokes.

func (HayBale) BreakInfo added in v0.7.3

func (h HayBale) BreakInfo() BreakInfo

BreakInfo ...

func (HayBale) CompostChance added in v0.8.2

func (HayBale) CompostChance() float64

CompostChance ...

func (HayBale) EncodeBlock added in v0.7.3

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

EncodeBlock ...

func (HayBale) EncodeItem added in v0.7.3

func (HayBale) EncodeItem() (name string, meta int16)

EncodeItem ...

func (HayBale) EntityLand added in v0.7.3

func (h HayBale) EntityLand(_ cube.Pos, _ *world.World, e world.Entity, distance *float64)

EntityLand ...

func (HayBale) FlammabilityInfo added in v0.7.3

func (HayBale) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (HayBale) Hash added in v0.7.3

func (h HayBale) Hash() (uint64, uint64)

func (HayBale) Instrument added in v0.7.3

func (HayBale) Instrument() sound.Instrument

Instrument ...

func (HayBale) Model added in v0.7.3

func (HayBale) Model() world.BlockModel

Model ...

func (HayBale) UseOnBlock added in v0.7.3

func (h HayBale) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

type Honeycomb added in v0.7.3

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

Honeycomb is a decorative blocks crafted from honeycombs.

func (Honeycomb) BreakInfo added in v0.7.3

func (h Honeycomb) BreakInfo() BreakInfo

BreakInfo ...

func (Honeycomb) EncodeBlock added in v0.7.3

func (Honeycomb) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Honeycomb) EncodeItem added in v0.7.3

func (Honeycomb) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Honeycomb) Hash added in v0.7.3

func (Honeycomb) Hash() (uint64, uint64)

func (Honeycomb) Instrument added in v0.7.3

func (h Honeycomb) Instrument() sound.Instrument

Instrument ...

func (Honeycomb) Model added in v0.7.3

func (Honeycomb) Model() world.BlockModel

Model ...

type Hopper added in v0.9.18

type Hopper struct {

	// Facing is the direction the hopper is facing.
	Facing cube.Face
	// Powered is whether the hopper is powered or not. If the hopper is powered it will be locked and will stop
	// moving items into or out of itself.
	Powered bool
	// CustomName is the custom name of the hopper. This name is displayed when the hopper is opened, and may include
	// colour codes.
	CustomName string

	// LastTick is the last world tick that the hopper was ticked.
	LastTick int64
	// TransferCooldown is the duration in ticks until the hopper can transfer items again.
	TransferCooldown int64
	// CollectCooldown is the duration in ticks until the hopper can collect items again.
	CollectCooldown int64
	// contains filtered or unexported fields
}

Hopper is a low-capacity storage block that can be used to collect item entities directly above it, as well as to transfer items into and out of other containers.

func NewHopper added in v0.9.18

func NewHopper() Hopper

NewHopper creates a new initialised hopper. The inventory is properly initialised.

func (Hopper) Activate added in v0.9.18

func (Hopper) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Hopper) AddViewer added in v0.9.18

func (h Hopper) AddViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (Hopper) BreakInfo added in v0.9.18

func (h Hopper) BreakInfo() BreakInfo

BreakInfo ...

func (Hopper) CanDisplace added in v0.9.18

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Hopper) DecodeNBT added in v0.9.18

func (h Hopper) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Hopper) EncodeBlock added in v0.9.18

func (h Hopper) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Hopper) EncodeItem added in v0.9.18

func (Hopper) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Hopper) EncodeNBT added in v0.9.18

func (h Hopper) EncodeNBT() map[string]any

EncodeNBT ...

func (Hopper) Hash added in v0.9.18

func (h Hopper) Hash() (uint64, uint64)

func (Hopper) Inventory added in v0.9.18

func (h Hopper) Inventory(*world.World, cube.Pos) *inventory.Inventory

Inventory returns the inventory of the hopper.

func (Hopper) LightDiffusionLevel added in v0.9.18

func (Hopper) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Hopper) Model added in v0.9.18

func (Hopper) Model() world.BlockModel

Model ...

func (Hopper) RemoveViewer added in v0.9.18

func (h Hopper) RemoveViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (Hopper) SideClosed added in v0.9.18

func (Hopper) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Hopper) Tick added in v0.9.18

func (h Hopper) Tick(currentTick int64, pos cube.Pos, w *world.World)

Tick ...

func (Hopper) UseOnBlock added in v0.9.18

func (h Hopper) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

func (Hopper) WithName added in v0.9.18

func (h Hopper) WithName(a ...any) world.Item

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

type HopperExtractable added in v0.9.18

type HopperExtractable interface {
	// ExtractItem handles the extract logic for that block.
	ExtractItem(h Hopper, pos cube.Pos, w *world.World) bool
}

HopperExtractable represents a block that can have its contents extracted by a hopper.

type HopperInsertable added in v0.9.18

type HopperInsertable interface {
	// InsertItem handles the insert logic for that block.
	InsertItem(h Hopper, pos cube.Pos, w *world.World) bool
}

HopperInsertable represents a block that can have its contents inserted into by a hopper.

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

func (InvisibleBedrock) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (InvisibleBedrock) EncodeItem

func (InvisibleBedrock) EncodeItem() (name string, meta int16)

EncodeItem ...

func (InvisibleBedrock) Hash

func (InvisibleBedrock) Hash() (uint64, uint64)

func (InvisibleBedrock) LightDiffusionLevel

func (InvisibleBedrock) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (InvisibleBedrock) Model

func (InvisibleBedrock) Model() world.BlockModel

Model ...

type Iron added in v0.7.3

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

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

func (Iron) BreakInfo added in v0.7.3

func (i Iron) BreakInfo() BreakInfo

BreakInfo ...

func (Iron) EncodeBlock added in v0.7.3

func (Iron) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Iron) EncodeItem added in v0.7.3

func (Iron) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Iron) Hash added in v0.7.3

func (Iron) Hash() (uint64, uint64)

func (Iron) Instrument added in v0.7.3

func (i Iron) Instrument() sound.Instrument

Instrument ...

func (Iron) Model added in v0.7.3

func (Iron) Model() world.BlockModel

Model ...

func (Iron) PowersBeacon added in v0.7.3

func (Iron) PowersBeacon() bool

PowersBeacon ...

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 (s IronBars) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (IronBars) EncodeBlock

func (IronBars) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (IronBars) EncodeItem

func (IronBars) EncodeItem() (name string, meta int16)

EncodeItem ...

func (IronBars) Hash

func (IronBars) Hash() (uint64, uint64)

func (IronBars) LightDiffusionLevel

func (IronBars) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (IronBars) Model

func (IronBars) Model() world.BlockModel

Model ...

func (IronBars) SideClosed

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

SideClosed ...

type IronOre

type IronOre struct {

	// Type is the type of iron ore.
	Type OreType
	// contains filtered or unexported fields
}

IronOre is a mineral block found underground.

func (IronOre) BreakInfo

func (i IronOre) BreakInfo() BreakInfo

BreakInfo ...

func (IronOre) EncodeBlock

func (i IronOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (IronOre) EncodeItem

func (i IronOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (IronOre) Hash

func (i IronOre) Hash() (uint64, uint64)

func (IronOre) Instrument

func (IronOre) Instrument() sound.Instrument

Instrument ...

func (IronOre) Model

func (IronOre) Model() world.BlockModel

Model ...

func (IronOre) SmeltInfo added in v0.8.0

func (IronOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type ItemFrame added in v0.5.0

type ItemFrame struct {

	// Facing is the direction from the frame to the block.
	Facing cube.Face
	// Item is the item that is displayed inside the frame.
	Item item.Stack
	// Rotations is the number of rotations for the item in the frame. Each rotation is 45 degrees, with the exception
	// being maps having 90 degree rotations.
	Rotations int
	// DropChance is the chance of the item dropping when the frame is broken. In vanilla, this is always 1.0.
	DropChance float64
	// Glowing makes the frame the glowing variant.
	Glowing bool
	// contains filtered or unexported fields
}

ItemFrame is a block entity that displays the item or block that is inside it.

func (ItemFrame) Activate added in v0.5.0

func (i ItemFrame) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool

Activate ...

func (ItemFrame) BreakInfo added in v0.5.0

func (i ItemFrame) BreakInfo() BreakInfo

BreakInfo ...

func (ItemFrame) CanDisplace added in v0.5.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (ItemFrame) DecodeNBT added in v0.5.0

func (i ItemFrame) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (ItemFrame) EncodeBlock added in v0.5.0

func (i ItemFrame) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (ItemFrame) EncodeItem added in v0.5.0

func (i ItemFrame) EncodeItem() (name string, meta int16)

EncodeItem ...

func (ItemFrame) EncodeNBT added in v0.5.0

func (i ItemFrame) EncodeNBT() map[string]any

EncodeNBT ...

func (ItemFrame) Hash added in v0.5.0

func (i ItemFrame) Hash() (uint64, uint64)

func (ItemFrame) LightDiffusionLevel added in v0.5.0

func (ItemFrame) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (ItemFrame) Model added in v0.5.0

func (ItemFrame) Model() world.BlockModel

Model ...

func (ItemFrame) NeighbourUpdateTick added in v0.5.0

func (i ItemFrame) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (ItemFrame) Pick added in v0.5.0

func (i ItemFrame) Pick() item.Stack

Pick returns the item that is picked when the block is picked.

func (ItemFrame) Punch added in v0.5.0

func (i ItemFrame) Punch(pos cube.Pos, _ cube.Face, w *world.World, u item.User)

Punch ...

func (ItemFrame) SideClosed added in v0.5.0

func (ItemFrame) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (ItemFrame) UseOnBlock added in v0.5.0

func (i ItemFrame) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

type Jukebox added in v0.8.0

type Jukebox struct {

	// Item is the music disc played by the jukebox.
	Item item.Stack
	// contains filtered or unexported fields
}

Jukebox is a block used to play music discs.

func (Jukebox) Activate added in v0.8.0

func (j Jukebox) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool

Activate ...

func (Jukebox) BreakInfo added in v0.8.0

func (j Jukebox) BreakInfo() BreakInfo

BreakInfo ...

func (Jukebox) DecodeNBT added in v0.8.0

func (j Jukebox) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Jukebox) Disc added in v0.8.0

func (j Jukebox) Disc() (sound.DiscType, bool)

Disc returns the currently playing music disc

func (Jukebox) EncodeBlock added in v0.8.0

func (Jukebox) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Jukebox) EncodeItem added in v0.8.0

func (Jukebox) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Jukebox) EncodeNBT added in v0.8.0

func (j Jukebox) EncodeNBT() map[string]any

EncodeNBT ...

func (Jukebox) ExtractItem added in v0.9.18

func (j Jukebox) ExtractItem(h Hopper, pos cube.Pos, w *world.World) bool

ExtractItem ...

func (Jukebox) FuelInfo added in v0.8.0

func (j Jukebox) FuelInfo() item.FuelInfo

FuelInfo ...

func (Jukebox) Hash added in v0.8.0

func (Jukebox) Hash() (uint64, uint64)

func (Jukebox) InsertItem added in v0.9.18

func (j Jukebox) InsertItem(h Hopper, pos cube.Pos, w *world.World) bool

InsertItem ...

func (Jukebox) Instrument added in v0.8.0

func (Jukebox) Instrument() sound.Instrument

Instrument ...

func (Jukebox) Model added in v0.8.0

func (Jukebox) 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 cube.Pos, w *world.World) bool

BoneMeal ...

func (Kelp) BreakInfo

func (k Kelp) BreakInfo() BreakInfo

BreakInfo ...

func (Kelp) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Kelp) CompostChance added in v0.8.2

func (Kelp) CompostChance() float64

CompostChance ...

func (Kelp) EncodeBlock

func (k Kelp) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Kelp) EncodeItem

func (Kelp) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Kelp) Hash

func (k Kelp) Hash() (uint64, uint64)

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 cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Kelp) RandomTick

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

RandomTick ...

func (Kelp) SideClosed

func (Kelp) SideClosed(cube.Pos, cube.Pos, *world.World) bool

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

func (Kelp) SmeltInfo added in v0.8.0

func (k Kelp) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Kelp) UseOnBlock

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

UseOnBlock ...

type Ladder added in v0.2.0

type Ladder struct {

	// Facing is the side of the block the ladder is currently attached to. cube.FaceDown and cube.FaceUp
	// do not do anything in game but they are still valid states.
	Facing cube.Face
	// contains filtered or unexported fields
}

Ladder is a wooden block used for climbing walls either vertically or horizontally. They can be placed only on the sides of other blocks.

func (Ladder) BreakInfo added in v0.2.0

func (l Ladder) BreakInfo() BreakInfo

BreakInfo ...

func (Ladder) CanDisplace added in v0.2.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Ladder) EncodeBlock added in v0.2.0

func (l Ladder) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Ladder) EncodeItem added in v0.2.0

func (l Ladder) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Ladder) EntityInside added in v0.4.0

func (l Ladder) EntityInside(_ cube.Pos, _ *world.World, e world.Entity)

EntityInside ...

func (Ladder) FuelInfo added in v0.8.0

func (Ladder) FuelInfo() item.FuelInfo

FuelInfo ...

func (Ladder) Hash added in v0.2.0

func (l Ladder) Hash() (uint64, uint64)

func (Ladder) LightDiffusionLevel added in v0.2.0

func (Ladder) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Ladder) Model added in v0.2.0

func (l Ladder) Model() world.BlockModel

Model ...

func (Ladder) NeighbourUpdateTick added in v0.2.0

func (l Ladder) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Ladder) SideClosed added in v0.2.0

func (l Ladder) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Ladder) UseOnBlock added in v0.2.0

func (l Ladder) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) 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 FireType
	// contains filtered or unexported fields
}

Lantern is a light emitting block.

func (Lantern) BreakInfo

func (l Lantern) BreakInfo() BreakInfo

BreakInfo ...

func (Lantern) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Lantern) EncodeBlock

func (l Lantern) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Lantern) EncodeItem

func (l Lantern) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Lantern) Hash

func (l Lantern) Hash() (uint64, uint64)

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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Lantern) SideClosed

func (l Lantern) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Lantern) UseOnBlock

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

UseOnBlock ...

type Lapis added in v0.7.3

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

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

func (Lapis) BreakInfo added in v0.7.3

func (l Lapis) BreakInfo() BreakInfo

BreakInfo ...

func (Lapis) EncodeBlock added in v0.7.3

func (Lapis) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Lapis) EncodeItem added in v0.7.3

func (Lapis) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Lapis) Hash added in v0.7.3

func (Lapis) Hash() (uint64, uint64)

func (Lapis) Model added in v0.7.3

func (Lapis) Model() world.BlockModel

Model ...

type LapisOre

type LapisOre struct {

	// Type is the type of lapis ore.
	Type OreType
	// 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) EncodeBlock

func (l LapisOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (LapisOre) EncodeItem

func (l LapisOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (LapisOre) Hash

func (l LapisOre) Hash() (uint64, uint64)

func (LapisOre) Instrument

func (LapisOre) Instrument() sound.Instrument

Instrument ...

func (LapisOre) Model

func (LapisOre) Model() world.BlockModel

Model ...

func (LapisOre) SmeltInfo added in v0.8.0

func (LapisOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

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) BlastResistance added in v0.8.0

func (Lava) BlastResistance() float64

BlastResistance always returns 500.

func (Lava) EncodeBlock

func (l Lava) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Lava) EntityInside added in v0.4.0

func (l Lava) EntityInside(_ cube.Pos, _ *world.World, e world.Entity)

EntityInside ...

func (Lava) Harden

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

Harden handles the hardening logic of lava.

func (Lava) HasLiquidDrops

func (Lava) HasLiquidDrops() bool

HasLiquidDrops ...

func (Lava) Hash

func (l Lava) Hash() (uint64, uint64)

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 10 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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Lava) RandomTick

func (l Lava) RandomTick(pos cube.Pos, 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 cube.Pos, w *world.World, _ *rand.Rand)

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 LavaDamageSource added in v0.8.6

type LavaDamageSource struct{}

LavaDamageSource is used for damage caused by being in lava.

func (LavaDamageSource) Fire added in v0.8.6

func (LavaDamageSource) Fire() bool

func (LavaDamageSource) ReducedByArmour added in v0.8.6

func (LavaDamageSource) ReducedByArmour() bool

func (LavaDamageSource) ReducedByResistance added in v0.8.6

func (LavaDamageSource) ReducedByResistance() bool

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 WoodType
	// Persistent specifies if the leaves are persistent, meaning they will not decay as a result of no wood
	// being nearby.
	Persistent bool

	ShouldUpdate 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 (s Leaves) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Leaves) CompostChance added in v0.8.2

func (Leaves) CompostChance() float64

CompostChance ...

func (Leaves) EncodeBlock

func (l Leaves) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Leaves) EncodeItem

func (l Leaves) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Leaves) FlammabilityInfo

func (l Leaves) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Leaves) Hash

func (l Leaves) Hash() (uint64, uint64)

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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Leaves) RandomTick

func (l Leaves) RandomTick(pos cube.Pos, w *world.World, _ *rand.Rand)

RandomTick ...

func (Leaves) SideClosed

func (Leaves) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Leaves) UseOnBlock added in v0.3.0

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

UseOnBlock makes leaves persistent when they are placed so that they don't decay.

type Lectern added in v0.9.8

type Lectern struct {

	// Facing represents the direction the Lectern is facing.
	Facing cube.Direction
	// Book is the book currently held by the Lectern.
	Book item.Stack
	// Page is the page the Lectern is currently on in the book.
	Page int
	// contains filtered or unexported fields
}

Lectern is a librarian's job site block found in villages. It is used to hold books for multiple players to read in multiplayer. TODO: Redstone functionality.

func (Lectern) Activate added in v0.9.8

func (l Lectern) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool

Activate ...

func (Lectern) BreakInfo added in v0.9.8

func (l Lectern) BreakInfo() BreakInfo

BreakInfo ...

func (Lectern) CanDisplace added in v0.9.8

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Lectern) DecodeNBT added in v0.9.8

func (l Lectern) DecodeNBT(m map[string]any) any

DecodeNBT ...

func (Lectern) EncodeBlock added in v0.9.8

func (l Lectern) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Lectern) EncodeItem added in v0.9.8

func (Lectern) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Lectern) EncodeNBT added in v0.9.8

func (l Lectern) EncodeNBT() map[string]any

EncodeNBT ...

func (Lectern) FuelInfo added in v0.9.8

func (Lectern) FuelInfo() item.FuelInfo

FuelInfo ...

func (Lectern) Hash added in v0.9.8

func (l Lectern) Hash() (uint64, uint64)

func (Lectern) Instrument added in v0.9.8

func (Lectern) Instrument() sound.Instrument

Instrument ...

func (Lectern) Model added in v0.9.8

func (Lectern) Model() world.BlockModel

Model ...

func (Lectern) Punch added in v0.9.8

func (l Lectern) Punch(pos cube.Pos, _ cube.Face, w *world.World, _ item.User)

Punch ...

func (Lectern) SideClosed added in v0.9.8

func (Lectern) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Lectern) TurnPage added in v0.9.8

func (l Lectern) TurnPage(pos cube.Pos, w *world.World, page int) error

TurnPage updates the page the lectern is currently on to the page given.

func (Lectern) UseOnBlock added in v0.9.8

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

UseOnBlock ...

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) CanDisplace added in v0.8.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water.

func (Light) EncodeBlock

func (l Light) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Light) EncodeItem

func (l Light) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Light) Hash

func (l Light) Hash() (uint64, uint64)

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

func (Light) SideClosed added in v0.8.0

func (Light) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

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 cube.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]any)

EncodeBlock ...

func (LitPumpkin) EncodeItem

func (l LitPumpkin) EncodeItem() (name string, meta int16)

EncodeItem ...

func (LitPumpkin) Hash

func (l LitPumpkin) Hash() (uint64, uint64)

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 cube.Pos, face cube.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 WoodType
	// Stripped specifies if the log is stripped or not.
	Stripped bool
	// Axis is the axis which the log block faces.
	Axis cube.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]any)

EncodeBlock ...

func (Log) EncodeItem

func (l Log) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Log) FlammabilityInfo

func (l Log) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Log) FuelInfo added in v0.8.0

func (Log) FuelInfo() item.FuelInfo

FuelInfo ...

func (Log) Hash

func (l Log) Hash() (uint64, uint64)

func (Log) Instrument

func (Log) Instrument() sound.Instrument

Instrument ...

func (Log) Model

func (Log) Model() world.BlockModel

Model ...

func (Log) SmeltInfo added in v0.8.0

func (Log) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Log) Strip

func (l Log) Strip() (world.Block, bool)

Strip ...

func (Log) UseOnBlock

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

UseOnBlock handles the rotational placing of logs.

type Loom added in v0.8.0

type Loom struct {

	// Facing is the direction the loom is facing.
	Facing cube.Direction
	// contains filtered or unexported fields
}

Loom is a block used to apply patterns on banners. It is also used as a shepherd's job site block that is found in villages.

func (Loom) Activate added in v0.8.0

func (Loom) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Loom) BreakInfo added in v0.8.0

func (l Loom) BreakInfo() BreakInfo

BreakInfo ...

func (Loom) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (Loom) EncodeItem added in v0.8.0

func (Loom) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Loom) FuelInfo added in v0.8.0

func (Loom) FuelInfo() item.FuelInfo

FuelInfo ...

func (Loom) Hash added in v0.8.0

func (l Loom) Hash() (uint64, uint64)

func (Loom) Instrument added in v0.8.0

func (Loom) Instrument() sound.Instrument

Instrument ...

func (Loom) Model added in v0.8.0

func (Loom) Model() world.BlockModel

Model ...

func (Loom) UseOnBlock added in v0.8.0

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

UseOnBlock ...

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) CompostChance added in v0.8.2

func (Melon) CompostChance() float64

CompostChance ...

func (Melon) EncodeBlock

func (Melon) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Melon) EncodeItem

func (Melon) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Melon) Hash

func (Melon) Hash() (uint64, uint64)

func (Melon) Model

func (Melon) Model() world.BlockModel

Model ...

type MelonSeeds

type MelonSeeds struct {

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

MelonSeeds grow melon blocks.

func (MelonSeeds) BoneMeal

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

BoneMeal ...

func (MelonSeeds) BreakInfo

func (m MelonSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (MelonSeeds) CalculateGrowthChance

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

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

func (MelonSeeds) CompostChance added in v0.8.2

func (MelonSeeds) CompostChance() float64

CompostChance ...

func (MelonSeeds) EncodeBlock

func (m MelonSeeds) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (MelonSeeds) EncodeItem

func (m MelonSeeds) EncodeItem() (name string, 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, uint64)

func (MelonSeeds) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (MelonSeeds) RandomTick

func (m MelonSeeds) RandomTick(pos cube.Pos, 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 cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

type MossCarpet added in v0.1.0

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

MossCarpet is a thin decorative variant of the moss block.

func (MossCarpet) BreakInfo added in v0.1.0

func (m MossCarpet) BreakInfo() BreakInfo

BreakInfo ...

func (MossCarpet) CanDisplace added in v0.1.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (MossCarpet) CompostChance added in v0.8.2

func (MossCarpet) CompostChance() float64

CompostChance ...

func (MossCarpet) EncodeBlock added in v0.1.0

func (m MossCarpet) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (MossCarpet) EncodeItem added in v0.1.0

func (m MossCarpet) EncodeItem() (name string, meta int16)

EncodeItem ...

func (MossCarpet) HasLiquidDrops added in v0.1.0

func (MossCarpet) HasLiquidDrops() bool

HasLiquidDrops ...

func (MossCarpet) Hash added in v0.1.0

func (MossCarpet) Hash() (uint64, uint64)

func (MossCarpet) LightDiffusionLevel added in v0.1.0

func (MossCarpet) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (MossCarpet) Model added in v0.1.0

func (MossCarpet) Model() world.BlockModel

Model ...

func (MossCarpet) NeighbourUpdateTick added in v0.1.0

func (MossCarpet) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (MossCarpet) SideClosed added in v0.1.0

func (MossCarpet) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (MossCarpet) UseOnBlock added in v0.1.0

func (m MossCarpet) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

type Mud added in v0.7.0

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

Mud is a decorative block obtained by using a water bottle on a dirt block.

func (Mud) BreakInfo added in v0.7.0

func (m Mud) BreakInfo() BreakInfo

BreakInfo ...

func (Mud) EncodeBlock added in v0.7.0

func (Mud) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Mud) EncodeItem added in v0.7.0

func (Mud) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Mud) Hash added in v0.7.0

func (Mud) Hash() (uint64, uint64)

func (Mud) Model added in v0.7.0

func (Mud) Model() world.BlockModel

Model ...

func (Mud) SoilFor added in v0.7.3

func (Mud) SoilFor(block world.Block) bool

SoilFor ...

type MudBricks added in v0.7.0

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

MudBricks are a decorative block obtained by crafting 4 packed mud.

func (MudBricks) BreakInfo added in v0.7.0

func (m MudBricks) BreakInfo() BreakInfo

BreakInfo ...

func (MudBricks) EncodeBlock added in v0.7.0

func (MudBricks) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (MudBricks) EncodeItem added in v0.7.0

func (MudBricks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (MudBricks) Hash added in v0.7.0

func (MudBricks) Hash() (uint64, uint64)

func (MudBricks) Instrument added in v0.7.0

func (MudBricks) Instrument() sound.Instrument

Instrument ...

func (MudBricks) Model added in v0.7.0

func (MudBricks) Model() world.BlockModel

Model ...

type MuddyMangroveRoots added in v0.7.0

type MuddyMangroveRoots struct {

	// Axis is the axis which the muddy mangrove roots faces.
	Axis cube.Axis
	// contains filtered or unexported fields
}

MuddyMangroveRoots are a decorative variant of mangrove roots.

func (MuddyMangroveRoots) BreakInfo added in v0.7.0

func (m MuddyMangroveRoots) BreakInfo() BreakInfo

BreakInfo ...

func (MuddyMangroveRoots) EncodeBlock added in v0.7.0

func (m MuddyMangroveRoots) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (MuddyMangroveRoots) EncodeItem added in v0.7.0

func (MuddyMangroveRoots) EncodeItem() (name string, meta int16)

EncodeItem ...

func (MuddyMangroveRoots) Hash added in v0.7.0

func (m MuddyMangroveRoots) Hash() (uint64, uint64)

func (MuddyMangroveRoots) Model added in v0.7.0

func (MuddyMangroveRoots) Model() world.BlockModel

Model ...

func (MuddyMangroveRoots) SoilFor added in v0.7.3

func (MuddyMangroveRoots) SoilFor(block world.Block) bool

SoilFor ...

func (MuddyMangroveRoots) UseOnBlock added in v0.8.1

func (m MuddyMangroveRoots) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used 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 (s NetherBrickFence) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (NetherBrickFence) EncodeBlock

func (NetherBrickFence) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (NetherBrickFence) EncodeItem

func (NetherBrickFence) EncodeItem() (name string, meta int16)

EncodeItem ...

func (NetherBrickFence) Hash

func (NetherBrickFence) Hash() (uint64, uint64)

func (NetherBrickFence) LightDiffusionLevel

func (NetherBrickFence) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (NetherBrickFence) Model

func (n NetherBrickFence) Model() world.BlockModel

Model ...

func (NetherBrickFence) SideClosed

func (NetherBrickFence) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

type NetherBricks added in v0.6.0

type NetherBricks struct {

	// NetherBricksType is the type of nether bricks of the block.
	Type NetherBricksType
	// contains filtered or unexported fields
}

NetherBricks are blocks used to form nether fortresses in the Nether. Red Nether bricks, Cracked Nether bricks and Chiseled Nether bricks are decorative variants that do not naturally generate.

func (NetherBricks) BreakInfo added in v0.6.0

func (n NetherBricks) BreakInfo() BreakInfo

BreakInfo ...

func (NetherBricks) EncodeBlock added in v0.6.0

func (n NetherBricks) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (NetherBricks) EncodeItem added in v0.6.0

func (n NetherBricks) EncodeItem() (id string, meta int16)

EncodeItem ...

func (NetherBricks) Hash added in v0.6.0

func (n NetherBricks) Hash() (uint64, uint64)

func (NetherBricks) Instrument added in v0.6.0

func (NetherBricks) Instrument() sound.Instrument

Instrument ...

func (NetherBricks) Model added in v0.6.0

func (NetherBricks) Model() world.BlockModel

Model ...

func (NetherBricks) SmeltInfo added in v0.8.0

func (n NetherBricks) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type NetherBricksType added in v0.6.0

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

NetherBricksType represents a type of nether bricks.

func ChiseledNetherBricks added in v0.6.0

func ChiseledNetherBricks() NetherBricksType

ChiseledNetherBricks is the chiseled variant of the nether bricks.

func CrackedNetherBricks added in v0.6.0

func CrackedNetherBricks() NetherBricksType

CrackedNetherBricks is the cracked variant of the nether bricks.

func NetherBricksTypes added in v0.6.0

func NetherBricksTypes() []NetherBricksType

NetherBricksTypes returns all nether bricks types.

func NormalNetherBricks added in v0.6.0

func NormalNetherBricks() NetherBricksType

NormalNetherBricks is the normal variant of the nether bricks.

func RedNetherBricks added in v0.6.0

func RedNetherBricks() NetherBricksType

RedNetherBricks is the red variant of the nether bricks.

func (NetherBricksType) Name added in v0.6.0

func (n NetherBricksType) Name() string

Name ...

func (NetherBricksType) String added in v0.6.0

func (n NetherBricksType) String() string

String ...

func (NetherBricksType) Uint8 added in v0.6.0

func (n NetherBricksType) Uint8() uint8

Uint8 returns the nether bricks as a unit8.

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

func (NetherGoldOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (NetherGoldOre) EncodeItem

func (NetherGoldOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (NetherGoldOre) Hash

func (NetherGoldOre) Hash() (uint64, uint64)

func (NetherGoldOre) Model

func (NetherGoldOre) Model() world.BlockModel

Model ...

func (NetherGoldOre) SmeltInfo added in v0.8.0

func (NetherGoldOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

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

func (NetherQuartzOre) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (NetherQuartzOre) EncodeItem

func (NetherQuartzOre) EncodeItem() (name string, meta int16)

EncodeItem ...

func (NetherQuartzOre) Hash

func (NetherQuartzOre) Hash() (uint64, uint64)

func (NetherQuartzOre) Instrument

func (NetherQuartzOre) Instrument() sound.Instrument

Instrument ...

func (NetherQuartzOre) Model

func (NetherQuartzOre) Model() world.BlockModel

Model ...

func (NetherQuartzOre) SmeltInfo added in v0.8.0

func (NetherQuartzOre) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type NetherSprouts added in v0.1.0

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

NetherSprouts are a non-solid plant block that generate in warped forests.

func (NetherSprouts) BreakInfo added in v0.1.0

func (n NetherSprouts) BreakInfo() BreakInfo

BreakInfo ...

func (NetherSprouts) CompostChance added in v0.8.2

func (NetherSprouts) CompostChance() float64

CompostChance ...

func (NetherSprouts) EncodeBlock added in v0.1.0

func (n NetherSprouts) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (NetherSprouts) EncodeItem added in v0.1.0

func (n NetherSprouts) EncodeItem() (name string, meta int16)

EncodeItem ...

func (NetherSprouts) FlammabilityInfo added in v0.1.0

func (n NetherSprouts) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (NetherSprouts) HasLiquidDrops added in v0.1.0

func (n NetherSprouts) HasLiquidDrops() bool

HasLiquidDrops ...

func (NetherSprouts) Hash added in v0.1.0

func (NetherSprouts) Hash() (uint64, uint64)

func (NetherSprouts) LightDiffusionLevel added in v0.1.0

func (NetherSprouts) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (NetherSprouts) Model added in v0.1.0

func (NetherSprouts) Model() world.BlockModel

Model ...

func (NetherSprouts) NeighbourUpdateTick added in v0.1.0

func (n NetherSprouts) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (NetherSprouts) ReplaceableBy added in v0.1.0

func (NetherSprouts) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (NetherSprouts) UseOnBlock added in v0.1.0

func (n NetherSprouts) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

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) CompostChance added in v0.8.2

func (NetherWart) CompostChance() float64

CompostChance ...

func (NetherWart) EncodeBlock

func (n NetherWart) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (NetherWart) EncodeItem

func (NetherWart) EncodeItem() (name string, meta int16)

EncodeItem ...

func (NetherWart) HasLiquidDrops

func (n NetherWart) HasLiquidDrops() bool

HasLiquidDrops ...

func (NetherWart) Hash

func (n NetherWart) Hash() (uint64, uint64)

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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (NetherWart) RandomTick

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

RandomTick ...

func (NetherWart) UseOnBlock

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

UseOnBlock ...

type NetherWartBlock added in v0.7.3

type NetherWartBlock struct {

	// Warped is the turquoise variant found in warped forests, but cannot be crafted unlike Nether wart block.
	Warped bool
	// contains filtered or unexported fields
}

NetherWartBlock is a decorative block found in crimson forests and crafted using Nether wart.

func (NetherWartBlock) BreakInfo added in v0.7.3

func (n NetherWartBlock) BreakInfo() BreakInfo

BreakInfo ...

func (NetherWartBlock) CompostChance added in v0.8.2

func (NetherWartBlock) CompostChance() float64

CompostChance ...

func (NetherWartBlock) EncodeBlock added in v0.7.3

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

EncodeBlock ...

func (NetherWartBlock) EncodeItem added in v0.7.3

func (n NetherWartBlock) EncodeItem() (name string, meta int16)

EncodeItem ...

func (NetherWartBlock) Hash added in v0.7.3

func (n NetherWartBlock) Hash() (uint64, uint64)

func (NetherWartBlock) Model added in v0.7.3

func (NetherWartBlock) Model() world.BlockModel

Model ...

type Netherite added in v0.7.3

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

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

func (Netherite) BreakInfo added in v0.7.3

func (n Netherite) BreakInfo() BreakInfo

BreakInfo ...

func (Netherite) EncodeBlock added in v0.7.3

func (Netherite) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Netherite) EncodeItem added in v0.7.3

func (Netherite) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Netherite) Hash added in v0.7.3

func (Netherite) Hash() (uint64, uint64)

func (Netherite) Instrument added in v0.7.3

func (Netherite) Instrument() sound.Instrument

Instrument ...

func (Netherite) Model added in v0.7.3

func (Netherite) Model() world.BlockModel

Model ...

func (Netherite) PowersBeacon added in v0.7.3

func (Netherite) 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 (n Netherrack) BreakInfo() BreakInfo

BreakInfo ...

func (Netherrack) EncodeBlock

func (Netherrack) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Netherrack) EncodeItem

func (Netherrack) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Netherrack) Hash

func (Netherrack) Hash() (uint64, uint64)

func (Netherrack) Instrument

func (Netherrack) Instrument() sound.Instrument

Instrument ...

func (Netherrack) Model

func (Netherrack) Model() world.BlockModel

Model ...

func (Netherrack) SmeltInfo added in v0.8.0

func (Netherrack) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Netherrack) SoilFor added in v0.1.0

func (n Netherrack) SoilFor(block world.Block) bool

SoilFor ...

type Note added in v0.7.3

type Note struct {

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

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

func (Note) Activate added in v0.7.3

func (n Note) Activate(pos cube.Pos, _ cube.Face, w *world.World, _ item.User, _ *item.UseContext) bool

Activate ...

func (Note) BreakInfo added in v0.7.3

func (n Note) BreakInfo() BreakInfo

BreakInfo ...

func (Note) DecodeNBT added in v0.7.3

func (n Note) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Note) EncodeBlock added in v0.7.3

func (n Note) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Note) EncodeItem added in v0.7.3

func (n Note) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Note) EncodeNBT added in v0.7.3

func (n Note) EncodeNBT() map[string]any

EncodeNBT ...

func (Note) FuelInfo added in v0.8.0

func (Note) FuelInfo() item.FuelInfo

FuelInfo ...

func (Note) Hash added in v0.7.3

func (Note) Hash() (uint64, uint64)

func (Note) Instrument added in v0.7.3

func (Note) Instrument() sound.Instrument

Instrument ...

func (Note) Model added in v0.7.3

func (Note) Model() world.BlockModel

Model ...

type Obsidian

type Obsidian struct {

	// Crying specifies if the block is a crying obsidian block. If true, the block is blue and emits light.
	Crying bool
	// contains filtered or unexported fields
}

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

func (Obsidian) BreakInfo

func (o Obsidian) BreakInfo() BreakInfo

BreakInfo ...

func (Obsidian) EncodeBlock

func (o Obsidian) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Obsidian) EncodeItem

func (o Obsidian) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Obsidian) Hash

func (o Obsidian) Hash() (uint64, uint64)

func (Obsidian) Instrument

func (Obsidian) Instrument() sound.Instrument

Instrument ...

func (Obsidian) LightEmissionLevel

func (o Obsidian) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Obsidian) Model

func (Obsidian) Model() world.BlockModel

Model ...

type OpenAction added in v0.6.0

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

OpenAction is a world.BlockAction to open a block at a position. It is sent for blocks such as chests.

func (OpenAction) BlockAction added in v0.6.0

func (OpenAction) BlockAction()

BlockAction serves to implement the world.BlockAction interface.

type OreType added in v0.1.0

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

OreType represents a variant of ore blocks.

func DeepslateOre added in v0.1.0

func DeepslateOre() OreType

DeepslateOre returns the deepslate ore variant.

func OreTypes added in v0.1.0

func OreTypes() []OreType

OreTypes returns a list of all ore types

func StoneOre added in v0.1.0

func StoneOre() OreType

StoneOre returns the stone ore variant.

func (OreType) Hardness added in v0.1.0

func (o OreType) Hardness() float64

Hardness ...

func (OreType) Name added in v0.1.0

func (o OreType) Name() string

Name ...

func (OreType) Prefix added in v0.1.0

func (o OreType) Prefix() string

Prefix ...

func (OreType) String added in v0.1.0

func (o OreType) String() string

String ...

func (OreType) Uint8 added in v0.1.0

func (o OreType) Uint8() uint8

Uint8 returns the ore as a uint8.

type OxidationType added in v0.9.19

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

OxidationType represents a type of oxidation.

func ExposedOxidation added in v0.9.19

func ExposedOxidation() OxidationType

ExposedOxidation is the exposed variant of oxidation.

func NormalOxidation added in v0.9.19

func NormalOxidation() OxidationType

NormalOxidation is the normal variant of oxidation.

func OxidationTypes added in v0.9.19

func OxidationTypes() []OxidationType

OxidationTypes ...

func OxidizedOxidation added in v0.9.19

func OxidizedOxidation() OxidationType

OxidizedOxidation is the oxidized variant of oxidation.

func WeatheredOxidation added in v0.9.19

func WeatheredOxidation() OxidationType

WeatheredOxidation is the weathered variant of oxidation.

func (OxidationType) Decrease added in v0.9.19

func (s OxidationType) Decrease() (OxidationType, bool)

Decrease attempts to decrease the oxidation level by one. It returns the new oxidation level and if the decrease was successful.

func (OxidationType) Increase added in v0.9.19

func (s OxidationType) Increase() (OxidationType, bool)

Increase attempts to increase the oxidation level by one. It returns the new oxidation level and if the increase was successful.

func (OxidationType) Name added in v0.9.19

func (s OxidationType) Name() string

Name ...

func (OxidationType) String added in v0.9.19

func (s OxidationType) String() string

String ...

func (OxidationType) Uint8 added in v0.9.19

func (s OxidationType) Uint8() uint8

Uint8 returns the oxidation as a uint8.

type Oxidizable added in v0.9.19

type Oxidizable interface {
	world.Block
	// CanOxidate returns whether the block can oxidate, i.e. if it's not waxed.
	CanOxidate() bool
	// OxidationLevel returns the currently level of oxidation of the block.
	OxidationLevel() OxidationType
	// WithOxidationLevel returns the oxidizable block with the oxidation level passed.
	WithOxidationLevel(OxidationType) Oxidizable
}

Oxidizable is a block that can naturally oxidise over time, such as copper.

type PackedIce added in v0.4.0

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

PackedIce is an opaque solid block variant of ice. Unlike regular ice, it does not melt near bright light sources.

func (PackedIce) BreakInfo added in v0.4.0

func (p PackedIce) BreakInfo() BreakInfo

BreakInfo ...

func (PackedIce) EncodeBlock added in v0.4.0

func (PackedIce) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (PackedIce) EncodeItem added in v0.4.0

func (PackedIce) EncodeItem() (name string, meta int16)

EncodeItem ...

func (PackedIce) Friction added in v0.4.0

func (p PackedIce) Friction() float64

Friction ...

func (PackedIce) Hash added in v0.4.0

func (PackedIce) Hash() (uint64, uint64)

func (PackedIce) Instrument added in v0.4.0

func (PackedIce) Instrument() sound.Instrument

Instrument ...

func (PackedIce) Model added in v0.4.0

func (PackedIce) Model() world.BlockModel

Model ...

type PackedMud added in v0.7.0

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

PackedMud is a block crafted from mud and wheat. It is used to create mud bricks.

func (PackedMud) BreakInfo added in v0.7.0

func (p PackedMud) BreakInfo() BreakInfo

BreakInfo ...

func (PackedMud) EncodeBlock added in v0.7.0

func (PackedMud) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (PackedMud) EncodeItem added in v0.7.0

func (PackedMud) EncodeItem() (name string, meta int16)

EncodeItem ...

func (PackedMud) Hash added in v0.7.0

func (PackedMud) Hash() (uint64, uint64)

func (PackedMud) Model added in v0.7.0

func (PackedMud) Model() world.BlockModel

Model ...

type Permutable added in v0.9.12

type Permutable interface {
	// States returns a map of all the different properties for the block. The key is the property name, and the value
	// is a slice of all the possible values for that property. It is important that a block is registered in dragonfly
	// for each of the possible combinations of properties and values.
	States() map[string][]any
	// Permutations returns a slice of all the different permutations for the block. Multiple permutations can be
	// applied at once if their conditions are met.
	Permutations() []customblock.Permutation
}

Permutable represents a custom block that can have more permutations than its default state.

type Pickable added in v0.5.0

type Pickable interface {
	// Pick returns the item that is picked when the block is picked.
	Pick() item.Stack
}

Pickable represents a block that may give a different item then the block itself when picked.

type Placer

type Placer interface {
	item.User
	PlaceBlock(pos cube.Pos, 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 WoodType
	// 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]any)

EncodeBlock ...

func (Planks) EncodeItem

func (p Planks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Planks) FlammabilityInfo

func (p Planks) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Planks) FuelInfo added in v0.8.0

func (Planks) FuelInfo() item.FuelInfo

FuelInfo ...

func (Planks) Hash

func (p Planks) Hash() (uint64, uint64)

func (Planks) Instrument

func (Planks) Instrument() sound.Instrument

Instrument ...

func (Planks) Model

func (Planks) Model() world.BlockModel

Model ...

func (Planks) RepairsWoodTools added in v0.7.3

func (p Planks) RepairsWoodTools() bool

RepairsWoodTools ...

type Podzol added in v0.1.0

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

Podzol is a dirt-type block that naturally blankets the surface of the giant tree taiga and bamboo jungles, along with their respective variants.

func (Podzol) BreakInfo added in v0.1.0

func (p Podzol) BreakInfo() BreakInfo

BreakInfo ...

func (Podzol) EncodeBlock added in v0.1.0

func (Podzol) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Podzol) EncodeItem added in v0.1.0

func (Podzol) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Podzol) Hash added in v0.1.0

func (Podzol) Hash() (uint64, uint64)

func (Podzol) Model added in v0.1.0

func (Podzol) Model() world.BlockModel

Model ...

func (Podzol) Shovel added in v0.1.0

func (Podzol) Shovel() (world.Block, bool)

Shovel ...

func (Podzol) SoilFor added in v0.1.0

func (p Podzol) SoilFor(block world.Block) bool

SoilFor ...

type PolishedBlackstoneBrick added in v0.8.0

type PolishedBlackstoneBrick struct {

	// Cracked specifies if the polished blackstone bricks is its cracked variant.
	Cracked bool
	// contains filtered or unexported fields
}

PolishedBlackstoneBrick are a brick variant of polished blackstone and can spawn in bastion remnants and ruined portals.

func (PolishedBlackstoneBrick) BreakInfo added in v0.8.0

func (b PolishedBlackstoneBrick) BreakInfo() BreakInfo

BreakInfo ...

func (PolishedBlackstoneBrick) EncodeBlock added in v0.8.0

func (b PolishedBlackstoneBrick) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (PolishedBlackstoneBrick) EncodeItem added in v0.8.0

func (b PolishedBlackstoneBrick) EncodeItem() (name string, meta int16)

EncodeItem ...

func (PolishedBlackstoneBrick) Hash added in v0.8.0

func (PolishedBlackstoneBrick) Instrument added in v0.8.0

func (PolishedBlackstoneBrick) Instrument() sound.Instrument

Instrument ...

func (PolishedBlackstoneBrick) Model added in v0.8.0

func (PolishedBlackstoneBrick) Model() world.BlockModel

Model ...

func (PolishedBlackstoneBrick) SmeltInfo added in v0.8.0

func (b PolishedBlackstoneBrick) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type PolishedTuff added in v0.9.19

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

PolishedTuff is a decorational variant of Tuff that can be crafted or found naturally in Trial Chambers.

func (PolishedTuff) BreakInfo added in v0.9.19

func (t PolishedTuff) BreakInfo() BreakInfo

BreakInfo ...

func (PolishedTuff) EncodeBlock added in v0.9.19

func (t PolishedTuff) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (PolishedTuff) EncodeItem added in v0.9.19

func (t PolishedTuff) EncodeItem() (name string, meta int16)

EncodeItem ...

func (PolishedTuff) Hash added in v0.9.19

func (PolishedTuff) Hash() (uint64, uint64)

func (PolishedTuff) Instrument added in v0.9.19

func (PolishedTuff) Instrument() sound.Instrument

Instrument ...

func (PolishedTuff) Model added in v0.9.19

func (PolishedTuff) Model() world.BlockModel

Model ...

type PotDecoration added in v0.9.7

type PotDecoration interface {
	world.Item
	PotDecoration() bool
}

PotDecoration represents an item that can be used as a decoration on a pot.

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 cube.Pos, w *world.World) bool

BoneMeal ...

func (Potato) BreakInfo

func (p Potato) BreakInfo() BreakInfo

BreakInfo ...

func (Potato) CalculateGrowthChance

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

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

func (Potato) CompostChance added in v0.8.2

func (Potato) CompostChance() float64

CompostChance ...

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]any)

EncodeBlock ...

func (Potato) EncodeItem

func (p Potato) EncodeItem() (name string, 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, uint64)

func (Potato) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Potato) RandomTick

func (p Potato) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

RandomTick ...

func (Potato) SameCrop

func (Potato) SameCrop(c Crop) bool

SameCrop ...

func (Potato) SmeltInfo added in v0.8.0

func (p Potato) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Potato) UseOnBlock

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

UseOnBlock ...

type Prismarine added in v0.1.0

type Prismarine struct {

	// Type is the type of prismarine of the block.
	Type PrismarineType
	// contains filtered or unexported fields
}

Prismarine is a type of stone that appears underwater in ruins and ocean monuments.

func (Prismarine) BreakInfo added in v0.1.0

func (p Prismarine) BreakInfo() BreakInfo

BreakInfo ...

func (Prismarine) EncodeBlock added in v0.1.0

func (p Prismarine) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Prismarine) EncodeItem added in v0.1.0

func (p Prismarine) EncodeItem() (id string, meta int16)

EncodeItem ...

func (Prismarine) Hash added in v0.1.0

func (p Prismarine) Hash() (uint64, uint64)

func (Prismarine) Instrument added in v0.1.0

func (Prismarine) Instrument() sound.Instrument

Instrument ...

func (Prismarine) Model added in v0.1.0

func (Prismarine) Model() world.BlockModel

Model ...

type PrismarineType added in v0.1.0

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

PrismarineType represents a type of prismarine.

func BrickPrismarine added in v0.1.0

func BrickPrismarine() PrismarineType

BrickPrismarine is the brick variant of prismarine.

func DarkPrismarine added in v0.1.0

func DarkPrismarine() PrismarineType

DarkPrismarine is the dark variant of prismarine.

func NormalPrismarine added in v0.1.0

func NormalPrismarine() PrismarineType

NormalPrismarine is the normal variant of prismarine.

func PrismarineTypes added in v0.1.0

func PrismarineTypes() []PrismarineType

PrismarineTypes ...

func (PrismarineType) Name added in v0.1.0

func (s PrismarineType) Name() string

Name ...

func (PrismarineType) String added in v0.1.0

func (s PrismarineType) String() string

String ...

func (PrismarineType) Uint8 added in v0.1.0

func (s PrismarineType) Uint8() uint8

Uint8 returns the prismarine as a uint8.

type Pumpkin

type Pumpkin struct {

	// Carved is whether the pumpkin is carved.
	Carved bool
	// Facing is the direction the pumpkin is facing.
	Facing cube.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) Carve

func (p Pumpkin) Carve(f cube.Face) (world.Block, bool)

Carve ...

func (Pumpkin) CompostChance added in v0.8.2

func (Pumpkin) CompostChance() float64

CompostChance ...

func (Pumpkin) DefencePoints

func (p Pumpkin) DefencePoints() float64

DefencePoints ...

func (Pumpkin) EncodeBlock

func (p Pumpkin) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Pumpkin) EncodeItem

func (p Pumpkin) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Pumpkin) Hash

func (p Pumpkin) Hash() (uint64, uint64)

func (Pumpkin) Helmet

func (p Pumpkin) Helmet() bool

Helmet ...

func (Pumpkin) Instrument

func (p Pumpkin) Instrument() sound.Instrument

Instrument ...

func (Pumpkin) KnockBackResistance

func (p Pumpkin) KnockBackResistance() float64

KnockBackResistance ...

func (Pumpkin) Model

func (Pumpkin) Model() world.BlockModel

Model ...

func (Pumpkin) Toughness added in v0.7.0

func (p Pumpkin) Toughness() float64

Toughness ...

func (Pumpkin) UseOnBlock

func (p Pumpkin) UseOnBlock(pos cube.Pos, face cube.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 cube.Face
	// contains filtered or unexported fields
}

PumpkinSeeds grow pumpkin blocks.

func (PumpkinSeeds) BoneMeal

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

BoneMeal ...

func (PumpkinSeeds) BreakInfo

func (p PumpkinSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (PumpkinSeeds) CalculateGrowthChance

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

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

func (PumpkinSeeds) CompostChance added in v0.8.2

func (PumpkinSeeds) CompostChance() float64

CompostChance ...

func (PumpkinSeeds) EncodeBlock

func (p PumpkinSeeds) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (PumpkinSeeds) EncodeItem

func (p PumpkinSeeds) EncodeItem() (name string, 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, uint64)

func (PumpkinSeeds) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (PumpkinSeeds) RandomTick

func (p PumpkinSeeds) RandomTick(pos cube.Pos, 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 cube.Pos, face cube.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 cube.Pos, clickedFace cube.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 Purpur added in v0.7.3

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

Purpur is a decorative block that is naturally generated in End cities and End ships.

func (Purpur) BreakInfo added in v0.7.3

func (p Purpur) BreakInfo() BreakInfo

BreakInfo ...

func (Purpur) EncodeBlock added in v0.7.3

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

EncodeBlock ...

func (Purpur) EncodeItem added in v0.7.3

func (p Purpur) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Purpur) Hash added in v0.7.3

func (Purpur) Hash() (uint64, uint64)

func (Purpur) Instrument added in v0.7.3

func (Purpur) Instrument() sound.Instrument

Instrument ...

func (Purpur) Model added in v0.7.3

func (Purpur) Model() world.BlockModel

Model ...

type PurpurPillar added in v0.7.3

type PurpurPillar struct {

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

PurpurPillar is a variant of Purpur that can be rotated.

func (PurpurPillar) BreakInfo added in v0.7.3

func (p PurpurPillar) BreakInfo() BreakInfo

BreakInfo ...

func (PurpurPillar) EncodeBlock added in v0.7.3

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

EncodeBlock ...

func (PurpurPillar) EncodeItem added in v0.7.3

func (p PurpurPillar) EncodeItem() (name string, meta int16)

EncodeItem ...

func (PurpurPillar) Hash added in v0.7.3

func (p PurpurPillar) Hash() (uint64, uint64)

func (PurpurPillar) Instrument added in v0.7.3

func (PurpurPillar) Instrument() sound.Instrument

Instrument ...

func (PurpurPillar) Model added in v0.7.3

func (PurpurPillar) Model() world.BlockModel

Model ...

func (PurpurPillar) UseOnBlock added in v0.7.3

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

UseOnBlock ...

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]any)

EncodeBlock ...

func (Quartz) EncodeItem

func (q Quartz) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Quartz) Hash

func (q Quartz) Hash() (uint64, uint64)

func (Quartz) Instrument

func (Quartz) Instrument() sound.Instrument

Instrument ...

func (Quartz) Model

func (Quartz) Model() world.BlockModel

Model ...

func (Quartz) SmeltInfo added in v0.8.0

func (q Quartz) SmeltInfo() item.SmeltInfo

SmeltInfo ...

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

func (QuartzBricks) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (QuartzBricks) EncodeItem

func (QuartzBricks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (QuartzBricks) Hash

func (QuartzBricks) Hash() (uint64, uint64)

func (QuartzBricks) Instrument

func (QuartzBricks) Instrument() sound.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 cube.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]any)

EncodeBlock ...

func (QuartzPillar) EncodeItem

func (q QuartzPillar) EncodeItem() (name string, meta int16)

EncodeItem ...

func (QuartzPillar) Hash

func (q QuartzPillar) Hash() (uint64, uint64)

func (QuartzPillar) Instrument

func (QuartzPillar) Instrument() sound.Instrument

Instrument ...

func (QuartzPillar) Model

func (QuartzPillar) Model() world.BlockModel

Model ...

func (QuartzPillar) UseOnBlock

func (q QuartzPillar) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock handles the rotational placing of quartz pillar blocks.

type RawCopper added in v0.7.3

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

RawCopper is a raw metal block equivalent to nine raw copper.

func (RawCopper) BreakInfo added in v0.7.3

func (r RawCopper) BreakInfo() BreakInfo

BreakInfo ...

func (RawCopper) EncodeBlock added in v0.7.3

func (RawCopper) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (RawCopper) EncodeItem added in v0.7.3

func (RawCopper) EncodeItem() (name string, meta int16)

EncodeItem ...

func (RawCopper) Hash added in v0.7.3

func (RawCopper) Hash() (uint64, uint64)

func (RawCopper) Instrument added in v0.7.3

func (RawCopper) Instrument() sound.Instrument

Instrument ...

func (RawCopper) Model added in v0.7.3

func (RawCopper) Model() world.BlockModel

Model ...

type RawGold added in v0.7.3

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

RawGold is a raw metal block equivalent to nine raw gold.

func (RawGold) BreakInfo added in v0.7.3

func (g RawGold) BreakInfo() BreakInfo

BreakInfo ...

func (RawGold) EncodeBlock added in v0.7.3

func (RawGold) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (RawGold) EncodeItem added in v0.7.3

func (RawGold) EncodeItem() (name string, meta int16)

EncodeItem ...

func (RawGold) Hash added in v0.7.3

func (RawGold) Hash() (uint64, uint64)

func (RawGold) Instrument added in v0.7.3

func (RawGold) Instrument() sound.Instrument

Instrument ...

func (RawGold) Model added in v0.7.3

func (RawGold) Model() world.BlockModel

Model ...

type RawIron added in v0.7.3

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

RawIron is a raw metal block equivalent to nine raw iron.

func (RawIron) BreakInfo added in v0.7.3

func (r RawIron) BreakInfo() BreakInfo

BreakInfo ...

func (RawIron) EncodeBlock added in v0.7.3

func (RawIron) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (RawIron) EncodeItem added in v0.7.3

func (RawIron) EncodeItem() (name string, meta int16)

EncodeItem ...

func (RawIron) Hash added in v0.7.3

func (RawIron) Hash() (uint64, uint64)

func (RawIron) Instrument added in v0.7.3

func (RawIron) Instrument() sound.Instrument

Instrument ...

func (RawIron) Model added in v0.7.3

func (RawIron) Model() world.BlockModel

Model ...

type ReinforcedDeepslate added in v0.7.0

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

ReinforcedDeepslate is a tough decorative block that spawns in ancient cities.

func (ReinforcedDeepslate) BreakInfo added in v0.7.0

func (r ReinforcedDeepslate) BreakInfo() BreakInfo

BreakInfo ...

func (ReinforcedDeepslate) EncodeBlock added in v0.7.0

func (ReinforcedDeepslate) EncodeBlock() (string, map[string]interface{})

EncodeBlock ...

func (ReinforcedDeepslate) EncodeItem added in v0.7.0

func (ReinforcedDeepslate) EncodeItem() (name string, meta int16)

EncodeItem ...

func (ReinforcedDeepslate) Hash added in v0.7.0

func (ReinforcedDeepslate) Hash() (uint64, uint64)

func (ReinforcedDeepslate) Instrument added in v0.7.0

func (ReinforcedDeepslate) Instrument() sound.Instrument

Instrument ...

func (ReinforcedDeepslate) Model added in v0.7.0

func (ReinforcedDeepslate) Model() world.BlockModel

Model ...

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

func (s Sand) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Sand) EncodeItem

func (s Sand) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Sand) Hash

func (s Sand) Hash() (uint64, uint64)

func (Sand) Instrument

func (Sand) Instrument() sound.Instrument

Instrument ...

func (Sand) Model

func (Sand) Model() world.BlockModel

Model ...

func (Sand) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Sand) SmeltInfo added in v0.8.0

func (Sand) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Sand) SoilFor added in v0.4.0

func (s Sand) SoilFor(block world.Block) bool

SoilFor ...

func (Sand) Solidifies

func (g Sand) Solidifies(cube.Pos, *world.World) bool

Solidifies ...

type Sandstone added in v0.1.0

type Sandstone struct {

	// Type is the type of sandstone of the block.
	Type SandstoneType

	// Red specifies if the sandstone type is red or not. When set to true, the sandstone type will represent its
	// red variant, for example red sandstone.
	Red bool
	// contains filtered or unexported fields
}

Sandstone is a solid block commonly found in deserts and beaches underneath sand.

func (Sandstone) BreakInfo added in v0.1.0

func (s Sandstone) BreakInfo() BreakInfo

BreakInfo ...

func (Sandstone) EncodeBlock added in v0.1.0

func (s Sandstone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Sandstone) EncodeItem added in v0.1.0

func (s Sandstone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Sandstone) Hash added in v0.1.0

func (s Sandstone) Hash() (uint64, uint64)

func (Sandstone) Instrument added in v0.1.0

func (Sandstone) Instrument() sound.Instrument

Instrument ...

func (Sandstone) Model added in v0.1.0

func (Sandstone) Model() world.BlockModel

Model ...

func (Sandstone) SmeltInfo added in v0.8.0

func (s Sandstone) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type SandstoneType added in v0.1.0

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

SandstoneType represents a type of sandstone.

func ChiseledSandstone added in v0.1.0

func ChiseledSandstone() SandstoneType

ChiseledSandstone is the chiseled variant of sandstone.

func CutSandstone added in v0.1.0

func CutSandstone() SandstoneType

CutSandstone is the cut variant of sandstone.

func NormalSandstone added in v0.1.0

func NormalSandstone() SandstoneType

NormalSandstone is the normal variant of sandstone.

func SandstoneTypes added in v0.1.0

func SandstoneTypes() []SandstoneType

SandstoneTypes ...

func SmoothSandstone added in v0.1.0

func SmoothSandstone() SandstoneType

SmoothSandstone is the smooth variant of sandstone.

func (SandstoneType) Name added in v0.1.0

func (s SandstoneType) Name() string

Name ...

func (SandstoneType) String added in v0.1.0

func (s SandstoneType) String() string

String ...

func (SandstoneType) Uint8 added in v0.1.0

func (s SandstoneType) Uint8() uint8

Uint8 returns the sandstone as a uint8.

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

func (SeaLantern) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (SeaLantern) EncodeItem

func (SeaLantern) EncodeItem() (name string, meta int16)

EncodeItem ...

func (SeaLantern) Hash

func (SeaLantern) Hash() (uint64, uint64)

func (SeaLantern) Instrument

func (SeaLantern) Instrument() sound.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 SeaPickle added in v0.4.0

type SeaPickle struct {

	// AdditionalCount is the amount of additional sea pickles clustered together.
	AdditionalCount int
	// Dead is whether the sea pickles are not alive. Sea pickles are only considered alive when inside of water. While
	// alive, sea pickles emit light & can be grown with bone meal.
	Dead bool
	// contains filtered or unexported fields
}

SeaPickle is a small stationary underwater block that emits light, and is typically found in colonies of up to four sea pickles.

func (SeaPickle) BoneMeal added in v0.4.0

func (s SeaPickle) BoneMeal(pos cube.Pos, w *world.World) bool

BoneMeal ...

func (SeaPickle) BreakInfo added in v0.4.0

func (s SeaPickle) BreakInfo() BreakInfo

BreakInfo ...

func (SeaPickle) CanDisplace added in v0.4.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (SeaPickle) CompostChance added in v0.8.2

func (SeaPickle) CompostChance() float64

CompostChance ...

func (SeaPickle) EncodeBlock added in v0.4.0

func (s SeaPickle) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (SeaPickle) EncodeItem added in v0.4.0

func (SeaPickle) EncodeItem() (name string, meta int16)

EncodeItem ...

func (SeaPickle) FlammabilityInfo added in v0.8.0

func (SeaPickle) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (SeaPickle) HasLiquidDrops added in v0.4.0

func (SeaPickle) HasLiquidDrops() bool

HasLiquidDrops ...

func (SeaPickle) Hash added in v0.4.0

func (s SeaPickle) Hash() (uint64, uint64)

func (SeaPickle) LightDiffusionLevel added in v0.4.0

func (SeaPickle) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (SeaPickle) LightEmissionLevel added in v0.4.0

func (s SeaPickle) LightEmissionLevel() uint8

LightEmissionLevel ...

func (SeaPickle) Model added in v0.4.0

func (SeaPickle) Model() world.BlockModel

Model ...

func (SeaPickle) NeighbourUpdateTick added in v0.4.0

func (s SeaPickle) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (SeaPickle) SideClosed added in v0.4.0

func (SeaPickle) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (SeaPickle) SmeltInfo added in v0.8.0

func (SeaPickle) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (SeaPickle) UseOnBlock added in v0.4.0

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

UseOnBlock ...

type ShortGrass added in v0.9.16

type ShortGrass struct {
	Double bool
	// contains filtered or unexported fields
}

ShortGrass is a transparent plant block which can be used to obtain seeds and as decoration.

func (ShortGrass) BoneMeal added in v0.9.16

func (g ShortGrass) BoneMeal(pos cube.Pos, w *world.World) bool

BoneMeal attempts to affect the block using a bone meal item.

func (ShortGrass) BreakInfo added in v0.9.16

func (g ShortGrass) BreakInfo() BreakInfo

BreakInfo ...

func (ShortGrass) CompostChance added in v0.9.16

func (g ShortGrass) CompostChance() float64

CompostChance ...

func (ShortGrass) EncodeBlock added in v0.9.16

func (g ShortGrass) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (ShortGrass) EncodeItem added in v0.9.16

func (g ShortGrass) EncodeItem() (name string, meta int16)

EncodeItem ...

func (ShortGrass) FlammabilityInfo added in v0.9.16

func (g ShortGrass) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (ShortGrass) HasLiquidDrops added in v0.9.16

func (g ShortGrass) HasLiquidDrops() bool

HasLiquidDrops ...

func (ShortGrass) Hash added in v0.9.16

func (ShortGrass) Hash() (uint64, uint64)

func (ShortGrass) LightDiffusionLevel added in v0.9.16

func (ShortGrass) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (ShortGrass) Model added in v0.9.16

func (ShortGrass) Model() world.BlockModel

Model ...

func (ShortGrass) NeighbourUpdateTick added in v0.9.16

func (g ShortGrass) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (ShortGrass) ReplaceableBy added in v0.9.16

func (ShortGrass) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (ShortGrass) UseOnBlock added in v0.9.16

func (g ShortGrass) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, w *world.World, user item.User, ctx *item.UseContext) bool

UseOnBlock ...

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) CompostChance added in v0.8.2

func (Shroomlight) CompostChance() float64

CompostChance ...

func (Shroomlight) EncodeBlock

func (Shroomlight) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Shroomlight) EncodeItem

func (Shroomlight) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Shroomlight) Hash

func (Shroomlight) Hash() (uint64, uint64)

func (Shroomlight) LightEmissionLevel

func (Shroomlight) LightEmissionLevel() uint8

LightEmissionLevel ...

func (Shroomlight) Model

func (Shroomlight) Model() world.BlockModel

Model ...

type Sign added in v0.2.0

type Sign struct {

	// Wood is the type of wood of the sign. This field must have one of the values found in the material
	// package.
	Wood WoodType
	// Attach is the attachment of the Sign. It is either of the type WallAttachment or StandingAttachment.
	Attach Attachment
	// Waxed specifies if the Sign has been waxed by a player. If set to true, the Sign can no longer be edited by
	// anyone and must be destroyed if the text needs to be changed.
	Waxed bool
	// Front is the text of the front side of the sign. Anyone can edit this unless the sign is Waxed.
	Front SignText
	// Back is the text of the back side of the sign. Anyone can edit this unless the sign is Waxed.
	Back SignText
	// contains filtered or unexported fields
}

Sign is a non-solid block that can display text on the front and back of the block.

func (Sign) Activate added in v0.9.7

func (s Sign) Activate(pos cube.Pos, _ cube.Face, w *world.World, user item.User, _ *item.UseContext) bool

Activate ...

func (Sign) BreakInfo added in v0.2.0

func (s Sign) BreakInfo() BreakInfo

BreakInfo ...

func (Sign) CanDisplace added in v0.2.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Sign) DecodeNBT added in v0.2.0

func (s Sign) DecodeNBT(data map[string]any) any

DecodeNBT ...

func (Sign) Dye added in v0.2.0

func (s Sign) Dye(pos cube.Pos, userPos mgl64.Vec3, c item.Colour) (world.Block, bool)

Dye dyes the Sign, changing its base colour to that of the colour passed.

func (Sign) EditingFrontSide added in v0.9.7

func (s Sign) EditingFrontSide(pos cube.Pos, userPos mgl64.Vec3) bool

EditingFrontSide returns if the user is editing the front side of the sign based on their position relative to the position and direction of the sign.

func (Sign) EncodeBlock added in v0.2.0

func (s Sign) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Sign) EncodeItem added in v0.2.0

func (s Sign) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Sign) EncodeNBT added in v0.2.0

func (s Sign) EncodeNBT() map[string]any

EncodeNBT ...

func (Sign) FlammabilityInfo added in v0.2.0

func (s Sign) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Sign) FuelInfo added in v0.8.0

func (Sign) FuelInfo() item.FuelInfo

FuelInfo ...

func (Sign) Hash added in v0.2.0

func (s Sign) Hash() (uint64, uint64)

func (Sign) Ink added in v0.2.0

func (s Sign) Ink(pos cube.Pos, userPos mgl64.Vec3, glowing bool) (world.Block, bool)

Ink inks the sign either glowing or non-glowing.

func (Sign) Instrument added in v0.2.0

func (Sign) Instrument() sound.Instrument

Instrument ...

func (Sign) LightDiffusionLevel added in v0.2.0

func (Sign) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Sign) MaxCount added in v0.2.0

func (s Sign) MaxCount() int

MaxCount ...

func (Sign) Model added in v0.2.0

func (Sign) Model() world.BlockModel

Model ...

func (Sign) NeighbourUpdateTick added in v0.2.0

func (s Sign) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Sign) SideClosed added in v0.2.0

func (s Sign) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Sign) UseOnBlock added in v0.2.0

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

UseOnBlock ...

func (Sign) Wax added in v0.9.7

func (s Sign) Wax(cube.Pos, mgl64.Vec3) (world.Block, bool)

Wax waxes a sign to prevent it from further editing.

type SignEditor added in v0.2.0

type SignEditor interface {
	OpenSign(pos cube.Pos, frontSide bool)
}

SignEditor represents something that can edit a sign, typically players.

type SignText added in v0.9.7

type SignText struct {
	// Text is the text displayed on this side of the sign. The text is automatically wrapped if it does not fit on a line.
	Text string
	// BaseColour is the base colour of the text on this side of the sign, changed when using a dye on the sign. The default
	// colour is black.
	BaseColour color.RGBA
	// Glowing specifies if the Sign has glowing text on the current side. If set to true, the text will be visible even
	// in the dark, and it will have an outline to improve visibility.
	Glowing bool
	// Owner holds the XUID of the player that most recently edited this side of the sign.
	Owner string
}

SignText represents the data for a single side of a sign. The sign can be edited on the front and back side.

type Skull added in v0.8.0

type Skull struct {

	// Type is the type of the skull.
	Type SkullType

	// Attach is the attachment of the Skull. It is either of the type WallAttachment or StandingAttachment.
	//blockhash:facing_only
	Attach Attachment
	// contains filtered or unexported fields
}

Skull is a decorative block. There are seven types of skulls: player, zombie, skeleton, wither skeleton, creeper, dragon, and piglin.

func (Skull) BreakInfo added in v0.8.0

func (s Skull) BreakInfo() BreakInfo

BreakInfo ...

func (Skull) CanDisplace added in v0.8.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Skull) DecodeNBT added in v0.8.0

func (s Skull) DecodeNBT(data map[string]interface{}) interface{}

DecodeNBT ...

func (Skull) DefencePoints added in v0.8.0

func (Skull) DefencePoints() float64

DefencePoints ...

func (Skull) EncodeBlock added in v0.8.0

func (s Skull) EncodeBlock() (string, map[string]interface{})

EncodeBlock ...

func (Skull) EncodeItem added in v0.8.0

func (s Skull) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Skull) EncodeNBT added in v0.8.0

func (s Skull) EncodeNBT() map[string]interface{}

EncodeNBT ...

func (Skull) HasLiquidDrops added in v0.8.0

func (Skull) HasLiquidDrops() bool

HasLiquidDrops ...

func (Skull) Hash added in v0.8.0

func (s Skull) Hash() (uint64, uint64)

func (Skull) Helmet added in v0.8.0

func (Skull) Helmet() bool

Helmet ...

func (Skull) KnockBackResistance added in v0.8.0

func (Skull) KnockBackResistance() float64

KnockBackResistance ...

func (Skull) LightDiffusionLevel added in v0.8.0

func (Skull) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Skull) Model added in v0.8.0

func (s Skull) Model() world.BlockModel

Model ...

func (Skull) SideClosed added in v0.8.0

func (Skull) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Skull) Toughness added in v0.8.0

func (Skull) Toughness() float64

Toughness ...

func (Skull) UseOnBlock added in v0.8.0

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

UseOnBlock ...

type SkullType added in v0.8.0

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

SkullType represents a mob variant of a skull.

func CreeperHead added in v0.8.0

func CreeperHead() SkullType

CreeperHead returns the skull variant for creepers.

func DragonHead added in v0.8.0

func DragonHead() SkullType

DragonHead returns the skull variant for ender dragons.

func PiglinHead added in v0.9.8

func PiglinHead() SkullType

PiglinHead returns the skull variant for piglins.

func PlayerHead added in v0.8.0

func PlayerHead() SkullType

PlayerHead returns the skull variant for players.

func SkeletonSkull added in v0.8.0

func SkeletonSkull() SkullType

SkeletonSkull returns the skull variant for skeletons.

func SkullTypes added in v0.8.0

func SkullTypes() []SkullType

SkullTypes returns all variants of skulls.

func WitherSkeletonSkull added in v0.8.0

func WitherSkeletonSkull() SkullType

WitherSkeletonSkull returns the skull variant for wither skeletons.

func ZombieHead added in v0.8.0

func ZombieHead() SkullType

ZombieHead returns the skull variant for zombies.

func (SkullType) Name added in v0.8.0

func (s SkullType) Name() string

Name ...

func (SkullType) String added in v0.8.0

func (s SkullType) String() string

String ...

func (SkullType) Uint8 added in v0.8.0

func (s SkullType) Uint8() uint8

Uint8 ...

type Slab added in v0.8.0

type Slab struct {
	// Block is the block to use for the type of slab.
	Block world.Block
	// Top specifies if the slab is in the top part of the block.
	Top bool
	// Double specifies if the slab is a double slab. These double slabs can be made by placing another slab
	// on an existing slab.
	Double bool
}

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

func (Slab) BreakInfo added in v0.8.0

func (s Slab) BreakInfo() BreakInfo

BreakInfo ...

func (Slab) CanDisplace added in v0.8.0

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

CanDisplace ...

func (Slab) EncodeBlock added in v0.8.0

func (s Slab) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Slab) EncodeItem added in v0.8.0

func (s Slab) EncodeItem() (string, int16)

EncodeItem ...

func (Slab) FlammabilityInfo added in v0.8.0

func (s Slab) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Slab) FuelInfo added in v0.8.0

func (s Slab) FuelInfo() item.FuelInfo

FuelInfo ...

func (Slab) Hash added in v0.8.0

func (s Slab) Hash() (uint64, uint64)

func (Slab) Instrument added in v0.8.0

func (s Slab) Instrument() sound.Instrument

Instrument ...

func (Slab) LightDiffusionLevel added in v0.8.0

func (s Slab) LightDiffusionLevel() uint8

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

func (Slab) Model added in v0.8.0

func (s Slab) Model() world.BlockModel

Model ...

func (Slab) SideClosed added in v0.8.0

func (s Slab) SideClosed(pos, side cube.Pos, _ *world.World) bool

SideClosed ...

func (Slab) UseOnBlock added in v0.8.0

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

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

type SmithingTable added in v0.8.0

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

SmithingTable is a toolsmith's job site block that generates in villages. It can be used to upgrade diamond gear into netherite gear.

func (SmithingTable) Activate added in v0.8.0

func (SmithingTable) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (SmithingTable) BreakInfo added in v0.8.0

func (s SmithingTable) BreakInfo() BreakInfo

BreakInfo ...

func (SmithingTable) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (SmithingTable) EncodeItem added in v0.8.0

func (SmithingTable) EncodeItem() (name string, meta int16)

EncodeItem ...

func (SmithingTable) Hash added in v0.8.0

func (SmithingTable) Hash() (uint64, uint64)

func (SmithingTable) Instrument added in v0.8.0

func (SmithingTable) Instrument() sound.Instrument

Instrument ...

func (SmithingTable) Model added in v0.8.0

func (SmithingTable) Model() world.BlockModel

Model ...

type Smoker added in v0.8.0

type Smoker struct {

	// Facing is the direction the smoker is facing.
	Facing cube.Direction
	// Lit is true if the smoker is lit.
	Lit bool
	// contains filtered or unexported fields
}

Smoker is a type of furnace that cooks food items, similar to a furnace, but twice as fast. It also serves as a butcher's job site block. The empty value of Smoker is not valid. It must be created using block.NewSmoker(cube.Face).

func NewSmoker added in v0.8.0

func NewSmoker(face cube.Direction) Smoker

NewSmoker creates a new initialised smoker. The smelter is properly initialised.

func (Smoker) Activate added in v0.8.0

func (s Smoker) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Smoker) AddViewer added in v0.8.0

func (s Smoker) AddViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (Smoker) BreakInfo added in v0.8.0

func (s Smoker) BreakInfo() BreakInfo

BreakInfo ...

func (Smoker) DecodeNBT added in v0.8.0

func (s Smoker) DecodeNBT(data map[string]interface{}) interface{}

DecodeNBT ...

func (Smoker) Durations added in v0.8.0

func (s Smoker) Durations() (remaining time.Duration, max time.Duration, cook time.Duration)

Durations returns the remaining, maximum, and cook durations of the smelter.

func (Smoker) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (Smoker) EncodeItem added in v0.8.0

func (s Smoker) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Smoker) EncodeNBT added in v0.8.0

func (s Smoker) EncodeNBT() map[string]interface{}

EncodeNBT ...

func (Smoker) Experience added in v0.8.0

func (s Smoker) Experience() int

Experience returns the collected experience of the smelter.

func (Smoker) ExtractItem added in v0.9.18

func (s Smoker) ExtractItem(h Hopper, pos cube.Pos, w *world.World) bool

ExtractItem ...

func (Smoker) Hash added in v0.8.0

func (s Smoker) Hash() (uint64, uint64)

func (Smoker) InsertItem added in v0.9.18

func (s Smoker) InsertItem(h Hopper, pos cube.Pos, w *world.World) bool

InsertItem ...

func (Smoker) Instrument added in v0.8.0

func (Smoker) Instrument() sound.Instrument

Instrument ...

func (Smoker) Inventory added in v0.8.0

func (s Smoker) Inventory(*world.World, cube.Pos) *inventory.Inventory

Inventory returns the inventory of the furnace.

func (Smoker) Model added in v0.8.0

func (Smoker) Model() world.BlockModel

Model ...

func (Smoker) RemoveViewer added in v0.8.0

func (s Smoker) RemoveViewer(v ContainerViewer, _ *world.World, _ cube.Pos)

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

func (Smoker) ResetExperience added in v0.8.0

func (s Smoker) ResetExperience() int

ResetExperience resets the collected experience of the smelter, and returns the amount of experience that was reset.

func (Smoker) Tick added in v0.8.0

func (s Smoker) Tick(_ int64, pos cube.Pos, w *world.World)

Tick is called to check if the smoker should update and start or stop smelting.

func (Smoker) UseOnBlock added in v0.8.0

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

UseOnBlock ...

type SneakingActivatable added in v0.9.19

type SneakingActivatable interface {
	// SneakingActivate activates the block at a specific block position while sneaking. The face clicked is
	// passed, as well as the world in which the block was activated and the viewer that activated it.
	// SneakingActivate returns a bool indicating if activating the block was used successfully.
	SneakingActivate(pos cube.Pos, clickedFace cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool
}

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

type Snow added in v0.5.0

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

Snow is a full-sized block of snow.

func (Snow) BreakInfo added in v0.5.0

func (s Snow) BreakInfo() BreakInfo

BreakInfo ...

func (Snow) EncodeBlock added in v0.5.0

func (Snow) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Snow) EncodeItem added in v0.5.0

func (Snow) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Snow) Hash added in v0.5.0

func (Snow) Hash() (uint64, uint64)

func (Snow) Model added in v0.5.0

func (Snow) Model() world.BlockModel

Model ...

type Soil added in v0.1.0

type Soil interface {
	// SoilFor returns whether the vegetation can exist on the block.
	SoilFor(world.Block) bool
}

Soil represents a block that can support vegetation.

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

func (SoulSand) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (SoulSand) EncodeItem

func (SoulSand) EncodeItem() (name string, meta int16)

EncodeItem ...

func (SoulSand) Hash

func (SoulSand) Hash() (uint64, uint64)

func (SoulSand) Instrument

func (s SoulSand) Instrument() sound.Instrument

Instrument ...

func (SoulSand) Model

func (SoulSand) Model() world.BlockModel

Model ...

func (SoulSand) SoilFor added in v0.1.0

func (s SoulSand) SoilFor(block world.Block) bool

SoilFor ...

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

func (SoulSoil) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (SoulSoil) EncodeItem

func (SoulSoil) EncodeItem() (name string, meta int16)

EncodeItem ...

func (SoulSoil) Hash

func (SoulSoil) Hash() (uint64, uint64)

func (SoulSoil) Model

func (SoulSoil) Model() world.BlockModel

Model ...

func (SoulSoil) SoilFor added in v0.1.0

func (s SoulSoil) SoilFor(block world.Block) bool

SoilFor ...

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

func (s Sponge) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Sponge) EncodeItem

func (s Sponge) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Sponge) Hash

func (s Sponge) Hash() (uint64, uint64)

func (Sponge) Model

func (Sponge) Model() world.BlockModel

Model ...

func (Sponge) NeighbourUpdateTick

func (s Sponge) NeighbourUpdateTick(pos, _ cube.Pos, 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) SmeltInfo added in v0.8.0

func (s Sponge) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Sponge) UseOnBlock

func (s Sponge) UseOnBlock(pos cube.Pos, face cube.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 SporeBlossom added in v0.1.0

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

SporeBlossom is a decorative block.

func (SporeBlossom) BreakInfo added in v0.1.0

func (s SporeBlossom) BreakInfo() BreakInfo

BreakInfo ...

func (SporeBlossom) CompostChance added in v0.8.2

func (SporeBlossom) CompostChance() float64

CompostChance ...

func (SporeBlossom) EncodeBlock added in v0.1.0

func (s SporeBlossom) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (SporeBlossom) EncodeItem added in v0.1.0

func (s SporeBlossom) EncodeItem() (name string, meta int16)

EncodeItem ...

func (SporeBlossom) FlammabilityInfo added in v0.8.0

func (SporeBlossom) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (SporeBlossom) HasLiquidDrops added in v0.1.0

func (s SporeBlossom) HasLiquidDrops() bool

HasLiquidDrops ...

func (SporeBlossom) Hash added in v0.1.0

func (SporeBlossom) Hash() (uint64, uint64)

func (SporeBlossom) LightDiffusionLevel added in v0.1.0

func (SporeBlossom) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (SporeBlossom) Model added in v0.1.0

func (SporeBlossom) Model() world.BlockModel

Model ...

func (SporeBlossom) NeighbourUpdateTick added in v0.1.0

func (s SporeBlossom) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (SporeBlossom) UseOnBlock added in v0.1.0

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

UseOnBlock ...

type StainedGlass

type StainedGlass struct {

	// Colour specifies the colour of the block.
	Colour item.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]any)

EncodeBlock ...

func (StainedGlass) EncodeItem

func (g StainedGlass) EncodeItem() (name string, meta int16)

EncodeItem ...

func (StainedGlass) Hash

func (g StainedGlass) Hash() (uint64, uint64)

func (StainedGlass) Instrument

func (StainedGlass) Instrument() sound.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 item.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 (s StainedGlassPane) CanDisplace(b world.Liquid) bool

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (StainedGlassPane) EncodeBlock

func (p StainedGlassPane) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (StainedGlassPane) EncodeItem

func (p StainedGlassPane) EncodeItem() (name string, meta int16)

EncodeItem ...

func (StainedGlassPane) Hash

func (p StainedGlassPane) Hash() (uint64, uint64)

func (StainedGlassPane) Instrument

func (StainedGlassPane) Instrument() sound.Instrument

Instrument ...

func (StainedGlassPane) LightDiffusionLevel

func (StainedGlassPane) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (StainedGlassPane) Model

func (StainedGlassPane) Model() world.BlockModel

Model ...

func (StainedGlassPane) SideClosed

func (p StainedGlassPane) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

type StainedTerracotta

type StainedTerracotta struct {

	// Colour specifies the colour of the block.
	Colour item.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]any)

EncodeBlock ...

func (StainedTerracotta) EncodeItem

func (t StainedTerracotta) EncodeItem() (name string, meta int16)

EncodeItem ...

func (StainedTerracotta) Hash

func (t StainedTerracotta) Hash() (uint64, uint64)

func (StainedTerracotta) Instrument

func (StainedTerracotta) Instrument() sound.Instrument

Instrument ...

func (StainedTerracotta) Model

func (StainedTerracotta) Model() world.BlockModel

Model ...

func (StainedTerracotta) SmeltInfo added in v0.8.0

func (t StainedTerracotta) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (StainedTerracotta) SoilFor added in v0.4.0

func (t StainedTerracotta) SoilFor(block world.Block) bool

SoilFor ...

type Stairs added in v0.8.0

type Stairs struct {

	// Block is the block to use for the type of stair.
	Block world.Block
	// 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 cube.Direction
	// contains filtered or unexported fields
}

Stairs are blocks that allow entities to walk up blocks without jumping.

func (Stairs) BreakInfo added in v0.8.0

func (s Stairs) BreakInfo() BreakInfo

BreakInfo ...

func (Stairs) CanDisplace added in v0.8.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Stairs) EncodeBlock added in v0.8.0

func (s Stairs) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Stairs) EncodeItem added in v0.8.0

func (s Stairs) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Stairs) FlammabilityInfo added in v0.8.0

func (s Stairs) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Stairs) FuelInfo added in v0.8.0

func (s Stairs) FuelInfo() item.FuelInfo

FuelInfo ...

func (Stairs) Hash added in v0.8.0

func (s Stairs) Hash() (uint64, uint64)

func (Stairs) Instrument added in v0.8.0

func (s Stairs) Instrument() sound.Instrument

Instrument ...

func (Stairs) LightDiffusionLevel added in v0.8.0

func (Stairs) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Stairs) Model added in v0.8.0

func (s Stairs) Model() world.BlockModel

Model ...

func (Stairs) SideClosed added in v0.8.0

func (s Stairs) SideClosed(pos, side cube.Pos, w *world.World) bool

SideClosed ...

func (Stairs) UseOnBlock added in v0.8.0

func (s Stairs) UseOnBlock(pos cube.Pos, face cube.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 StartCrackAction added in v0.6.0

type StartCrackAction struct {
	BreakTime time.Duration
	// contains filtered or unexported fields
}

StartCrackAction is a world.BlockAction to make the cracks in a block start forming, following the break time set in the action.

func (StartCrackAction) BlockAction added in v0.6.0

func (StartCrackAction) BlockAction()

BlockAction serves to implement the world.BlockAction interface.

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

func (s Stone) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Stone) EncodeItem

func (s Stone) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Stone) Hash

func (s Stone) Hash() (uint64, uint64)

func (Stone) Instrument

func (Stone) Instrument() sound.Instrument

Instrument ...

func (Stone) Model

func (Stone) Model() world.BlockModel

Model ...

func (Stone) SmeltInfo added in v0.8.0

func (s Stone) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type StoneBricks added in v0.5.0

type StoneBricks struct {

	// Type is the type of stone bricks of the block.
	Type StoneBricksType
	// contains filtered or unexported fields
}

StoneBricks are materials found in structures such as strongholds, igloo basements, jungle temples, ocean ruins and ruined portals.

func (StoneBricks) BreakInfo added in v0.5.0

func (s StoneBricks) BreakInfo() BreakInfo

BreakInfo ...

func (StoneBricks) EncodeBlock added in v0.5.0

func (s StoneBricks) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (StoneBricks) EncodeItem added in v0.5.0

func (s StoneBricks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (StoneBricks) Hash added in v0.5.0

func (s StoneBricks) Hash() (uint64, uint64)

func (StoneBricks) Instrument added in v0.5.0

func (StoneBricks) Instrument() sound.Instrument

Instrument ...

func (StoneBricks) Model added in v0.5.0

func (StoneBricks) Model() world.BlockModel

Model ...

func (StoneBricks) SmeltInfo added in v0.8.0

func (s StoneBricks) SmeltInfo() item.SmeltInfo

SmeltInfo ...

type StoneBricksType added in v0.5.0

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

StoneBricksType represents a type of stone bricks.

func ChiseledStoneBricks added in v0.5.0

func ChiseledStoneBricks() StoneBricksType

ChiseledStoneBricks is the chiseled variant of stone bricks.

func CrackedStoneBricks added in v0.5.0

func CrackedStoneBricks() StoneBricksType

CrackedStoneBricks is the cracked variant of stone bricks.

func MossyStoneBricks added in v0.5.0

func MossyStoneBricks() StoneBricksType

MossyStoneBricks is the mossy variant of stone bricks.

func NormalStoneBricks added in v0.5.0

func NormalStoneBricks() StoneBricksType

NormalStoneBricks is the normal variant of stone bricks.

func StoneBricksTypes added in v0.5.0

func StoneBricksTypes() []StoneBricksType

StoneBricksTypes ...

func (StoneBricksType) Name added in v0.5.0

func (s StoneBricksType) Name() string

Name ...

func (StoneBricksType) String added in v0.5.0

func (s StoneBricksType) String() string

String ...

func (StoneBricksType) Uint8 added in v0.5.0

func (s StoneBricksType) Uint8() uint8

Uint8 returns the stone bricks as a uint8.

type Stonecutter added in v0.8.0

type Stonecutter struct {

	// Facing is the direction the stonecutter is facing.
	Facing cube.Direction
	// contains filtered or unexported fields
}

Stonecutter is used to craft stone and copper related blocks in smaller and more precise quantities than crafting, and is more efficient than crafting for certain recipes.

func (Stonecutter) Activate added in v0.8.0

func (Stonecutter) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (Stonecutter) BreakInfo added in v0.8.0

func (s Stonecutter) BreakInfo() BreakInfo

BreakInfo ...

func (Stonecutter) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (Stonecutter) EncodeItem added in v0.8.0

func (Stonecutter) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Stonecutter) Hash added in v0.8.0

func (s Stonecutter) Hash() (uint64, uint64)

func (Stonecutter) Instrument added in v0.8.0

func (Stonecutter) Instrument() sound.Instrument

Instrument ...

func (Stonecutter) Model added in v0.8.0

func (Stonecutter) Model() world.BlockModel

Model ...

func (Stonecutter) UseOnBlock added in v0.8.0

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

UseOnBlock ...

type StopCrackAction added in v0.6.0

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

StopCrackAction is a world.BlockAction to make the cracks forming in a block stop and disappear.

func (StopCrackAction) BlockAction added in v0.6.0

func (StopCrackAction) BlockAction()

BlockAction serves to implement the world.BlockAction interface.

type SugarCane added in v0.8.2

type SugarCane struct {

	// Age is the growth state of sugar cane. Values range from 0 to 15.
	Age int
	// contains filtered or unexported fields
}

SugarCane is a plant block that generates naturally near water.

func (SugarCane) BoneMeal added in v0.8.2

func (c SugarCane) BoneMeal(pos cube.Pos, w *world.World) bool

BoneMeal ...

func (SugarCane) BreakInfo added in v0.8.2

func (c SugarCane) BreakInfo() BreakInfo

BreakInfo ...

func (SugarCane) EncodeBlock added in v0.8.2

func (c SugarCane) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (SugarCane) EncodeItem added in v0.8.2

func (c SugarCane) EncodeItem() (name string, meta int16)

EncodeItem ...

func (SugarCane) HasLiquidDrops added in v0.8.2

func (c SugarCane) HasLiquidDrops() bool

HasLiquidDrops ...

func (SugarCane) Hash added in v0.8.2

func (c SugarCane) Hash() (uint64, uint64)

func (SugarCane) LightDiffusionLevel added in v0.8.2

func (SugarCane) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (SugarCane) Model added in v0.8.2

func (SugarCane) Model() world.BlockModel

Model ...

func (SugarCane) NeighbourUpdateTick added in v0.8.2

func (c SugarCane) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (SugarCane) RandomTick added in v0.8.2

func (c SugarCane) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

RandomTick ...

func (SugarCane) UseOnBlock added in v0.8.2

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

UseOnBlock ensures the placement of the block is OK.

type TNT added in v0.8.0

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

TNT is an explosive block that can be primed to generate an explosion.

func (TNT) Activate added in v0.8.0

func (t TNT) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, ctx *item.UseContext) bool

Activate ...

func (TNT) BreakInfo added in v0.8.0

func (t TNT) BreakInfo() BreakInfo

BreakInfo ...

func (TNT) EncodeBlock added in v0.8.0

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

EncodeBlock ...

func (TNT) EncodeItem added in v0.8.0

func (t TNT) EncodeItem() (name string, meta int16)

EncodeItem ...

func (TNT) Explode added in v0.8.0

func (t TNT) Explode(_ mgl64.Vec3, pos cube.Pos, w *world.World, _ ExplosionConfig)

Explode ...

func (TNT) FlammabilityInfo added in v0.8.0

func (t TNT) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (TNT) Hash added in v0.8.0

func (TNT) Hash() (uint64, uint64)

func (TNT) Ignite added in v0.8.0

func (t TNT) Ignite(pos cube.Pos, w *world.World, igniter world.Entity) bool

Ignite ...

func (TNT) Igniter added in v0.9.14

func (t TNT) Igniter() world.Entity

Igniter returns the entity that ignited the TNT. It is nil if ignited by a world source like fire.

func (TNT) Model added in v0.8.0

func (TNT) 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) EncodeBlock

func (Terracotta) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Terracotta) EncodeItem

func (Terracotta) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Terracotta) Hash

func (Terracotta) Hash() (uint64, uint64)

func (Terracotta) Instrument

func (Terracotta) Instrument() sound.Instrument

Instrument ...

func (Terracotta) Model

func (Terracotta) Model() world.BlockModel

Model ...

func (Terracotta) SoilFor added in v0.4.0

func (Terracotta) SoilFor(block world.Block) bool

SoilFor ...

type Torch

type Torch struct {

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

Torch are non-solid blocks that emit light.

func (Torch) BreakInfo

func (t Torch) BreakInfo() BreakInfo

BreakInfo ...

func (Torch) EncodeBlock

func (t Torch) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Torch) EncodeItem

func (t Torch) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Torch) HasLiquidDrops

func (t Torch) HasLiquidDrops() bool

HasLiquidDrops ...

func (Torch) Hash

func (t Torch) Hash() (uint64, uint64)

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, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (Torch) UseOnBlock

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

UseOnBlock ...

type Tuff added in v0.1.0

type Tuff struct {

	// Chiseled specifies if the tuff is chiseled.
	Chiseled bool
	// contains filtered or unexported fields
}

Tuff is an ornamental rock formed from volcanic ash, occurring in underground blobs below Y=16.

func (Tuff) BreakInfo added in v0.1.0

func (t Tuff) BreakInfo() BreakInfo

BreakInfo ...

func (Tuff) EncodeBlock added in v0.1.0

func (t Tuff) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Tuff) EncodeItem added in v0.1.0

func (t Tuff) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Tuff) Hash added in v0.1.0

func (t Tuff) Hash() (uint64, uint64)

func (Tuff) Instrument added in v0.1.0

func (Tuff) Instrument() sound.Instrument

Instrument ...

func (Tuff) Model added in v0.1.0

func (Tuff) Model() world.BlockModel

Model ...

type TuffBricks added in v0.9.19

type TuffBricks struct {

	// Chiseled specifies if the tuff bricks are chiseled.
	Chiseled bool
	// contains filtered or unexported fields
}

TuffBricks are a decorational variant of Tuff that can be crafted or found naturally in Trial Chambers.

func (TuffBricks) BreakInfo added in v0.9.19

func (t TuffBricks) BreakInfo() BreakInfo

BreakInfo ...

func (TuffBricks) EncodeBlock added in v0.9.19

func (t TuffBricks) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (TuffBricks) EncodeItem added in v0.9.19

func (t TuffBricks) EncodeItem() (name string, meta int16)

EncodeItem ...

func (TuffBricks) Hash added in v0.9.19

func (t TuffBricks) Hash() (uint64, uint64)

func (TuffBricks) Instrument added in v0.9.19

func (TuffBricks) Instrument() sound.Instrument

Instrument ...

func (TuffBricks) Model added in v0.9.19

func (TuffBricks) Model() world.BlockModel

Model ...

type Wall added in v0.8.0

type Wall struct {

	// Block is the block to use for the type of wall.
	Block world.Block
	// NorthConnection is the type of connection in the north direction of the post.
	NorthConnection WallConnectionType
	// EastConnection is the type of connection in the east direction of the post.
	EastConnection WallConnectionType
	// SouthConnection is the type of connection in the south direction of the post.
	SouthConnection WallConnectionType
	// WestConnection is the type of connection in the west direction of the post.
	WestConnection WallConnectionType
	// Post is if the wall is extended to the full height of a block or not.
	Post bool
	// contains filtered or unexported fields
}

Wall is a block similar to fences that prevents players from jumping over and is thinner than the usual block. It is available for many blocks and all types connect together as if they were the same type.

func (Wall) BreakInfo added in v0.8.0

func (w Wall) BreakInfo() BreakInfo

BreakInfo ...

func (Wall) CanDisplace added in v0.8.0

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (Wall) ConnectionType added in v0.8.0

func (w Wall) ConnectionType(direction cube.Direction) WallConnectionType

ConnectionType returns the connection type of the wall in the given direction.

func (Wall) EncodeBlock added in v0.8.0

func (w Wall) EncodeBlock() (string, map[string]any)

EncodeBlock ...

func (Wall) EncodeItem added in v0.8.0

func (w Wall) EncodeItem() (string, int16)

EncodeItem ...

func (Wall) Hash added in v0.8.0

func (w Wall) Hash() (uint64, uint64)

func (Wall) LightDiffusionLevel added in v0.8.0

func (Wall) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Wall) Model added in v0.8.0

func (w Wall) Model() world.BlockModel

Model ...

func (Wall) NeighbourUpdateTick added in v0.8.0

func (w Wall) NeighbourUpdateTick(pos, _ cube.Pos, wo *world.World)

NeighbourUpdateTick ...

func (Wall) SideClosed added in v0.8.0

func (Wall) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (Wall) UseOnBlock added in v0.8.0

func (w Wall) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, wo *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

func (Wall) WithConnectionType added in v0.8.0

func (w Wall) WithConnectionType(direction cube.Direction, connection WallConnectionType) Wall

WithConnectionType returns the wall with the given connection type in the given direction.

type WallConnectionType added in v0.8.0

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

WallConnectionType represents the connection type of a wall.

func NoWallConnection added in v0.8.0

func NoWallConnection() WallConnectionType

NoWallConnection returns the no connection type of a wall.

func ShortWallConnection added in v0.8.0

func ShortWallConnection() WallConnectionType

ShortWallConnection returns the short connection type of a wall.

func TallWallConnection added in v0.8.0

func TallWallConnection() WallConnectionType

TallWallConnection returns the tall connection type of a wall.

func WallConnectionTypes added in v0.8.0

func WallConnectionTypes() []WallConnectionType

WallConnectionTypes returns a list of all wall connection types.

func (WallConnectionType) Height added in v0.8.0

func (w WallConnectionType) Height() float64

Height returns the height of the connection for the block model.

func (WallConnectionType) String added in v0.8.0

func (w WallConnectionType) String() string

String ...

func (WallConnectionType) Uint8 added in v0.8.0

func (w WallConnectionType) Uint8() uint8

Uint8 returns the wall connection as a uint8.

type Water

type Water struct {

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

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

func (Water) BlastResistance added in v0.8.0

func (Water) BlastResistance() float64

BlastResistance always returns 500.

func (Water) EncodeBlock

func (w Water) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Water) EntityInside added in v0.4.0

func (w Water) EntityInside(_ cube.Pos, _ *world.World, e world.Entity)

EntityInside ...

func (Water) FillBottle

func (w Water) FillBottle() (world.Block, item.Stack, bool)

FillBottle ...

func (Water) Harden

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

Harden hardens the water if lava flows into it.

func (Water) HasLiquidDrops

func (Water) HasLiquidDrops() bool

HasLiquidDrops ...

func (Water) Hash

func (w Water) Hash() (uint64, uint64)

func (Water) LightDiffusionLevel

func (Water) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (Water) LiquidDepth

func (w Water) LiquidDepth() int

LiquidDepth returns the depth of the water.

func (Water) LiquidFalling

func (w Water) LiquidFalling() bool

LiquidFalling returns Water.Falling.

func (Water) LiquidType

func (Water) LiquidType() string

LiquidType ...

func (Water) Model

func (Water) Model() world.BlockModel

Model ...

func (Water) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (Water) ReplaceableBy

func (Water) ReplaceableBy(world.Block) bool

ReplaceableBy ...

func (Water) ScheduledTick

func (w Water) ScheduledTick(pos cube.Pos, wo *world.World, _ *rand.Rand)

ScheduledTick ...

func (Water) SpreadDecay

func (Water) SpreadDecay() int

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

func (Water) WithDepth

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

WithDepth returns the water with the depth passed.

type WheatSeeds

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

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

func (WheatSeeds) BoneMeal

func (s WheatSeeds) BoneMeal(pos cube.Pos, w *world.World) bool

BoneMeal ...

func (WheatSeeds) BreakInfo

func (s WheatSeeds) BreakInfo() BreakInfo

BreakInfo ...

func (WheatSeeds) CalculateGrowthChance

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

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

func (WheatSeeds) CompostChance added in v0.8.2

func (WheatSeeds) CompostChance() float64

CompostChance ...

func (WheatSeeds) EncodeBlock

func (s WheatSeeds) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (WheatSeeds) EncodeItem

func (s WheatSeeds) EncodeItem() (name string, meta int16)

EncodeItem ...

func (WheatSeeds) GrowthStage

func (c WheatSeeds) GrowthStage() int

GrowthStage returns the current stage of growth.

func (WheatSeeds) HasLiquidDrops

func (c WheatSeeds) HasLiquidDrops() bool

HasLiquidDrops ...

func (WheatSeeds) Hash

func (s WheatSeeds) Hash() (uint64, uint64)

func (WheatSeeds) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (WheatSeeds) RandomTick

func (s WheatSeeds) RandomTick(pos cube.Pos, w *world.World, r *rand.Rand)

RandomTick ...

func (WheatSeeds) SameCrop

func (WheatSeeds) SameCrop(c Crop) bool

SameCrop ...

func (WheatSeeds) UseOnBlock

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

UseOnBlock ...

type Wood added in v0.5.0

type Wood struct {

	// Wood is the type of wood.
	Wood WoodType
	// Stripped specifies if the wood is stripped or not.
	Stripped bool
	// Axis is the axis which the wood block faces.
	Axis cube.Axis
	// contains filtered or unexported fields
}

Wood is a block that has the log's "bark" texture on all six sides. It comes in 8 types: oak, spruce, birch, jungle, acacia, dark oak, crimson, and warped. Stripped wood is a variant obtained by using an axe on the wood.

func (Wood) BreakInfo added in v0.5.0

func (w Wood) BreakInfo() BreakInfo

BreakInfo ...

func (Wood) EncodeBlock added in v0.5.0

func (w Wood) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Wood) EncodeItem added in v0.5.0

func (w Wood) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Wood) FlammabilityInfo added in v0.5.0

func (w Wood) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Wood) FuelInfo added in v0.8.0

func (Wood) FuelInfo() item.FuelInfo

FuelInfo ...

func (Wood) Hash added in v0.5.0

func (w Wood) Hash() (uint64, uint64)

func (Wood) Instrument added in v0.5.0

func (Wood) Instrument() sound.Instrument

Instrument ...

func (Wood) Model added in v0.5.0

func (Wood) Model() world.BlockModel

Model ...

func (Wood) SmeltInfo added in v0.8.0

func (Wood) SmeltInfo() item.SmeltInfo

SmeltInfo ...

func (Wood) Strip added in v0.5.0

func (w Wood) Strip() (world.Block, bool)

Strip ...

func (Wood) UseOnBlock added in v0.5.0

func (w Wood) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, wo *world.World, user item.User, ctx *item.UseContext) (used bool)

UseOnBlock ...

type WoodDoor

type WoodDoor struct {

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

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

func (WoodDoor) Activate

func (d WoodDoor) Activate(pos cube.Pos, _ cube.Face, w *world.World, _ item.User, _ *item.UseContext) bool

Activate ...

func (WoodDoor) BreakInfo

func (d WoodDoor) BreakInfo() BreakInfo

BreakInfo ...

func (WoodDoor) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (WoodDoor) EncodeBlock

func (d WoodDoor) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (WoodDoor) EncodeItem

func (d WoodDoor) EncodeItem() (name string, meta int16)

EncodeItem ...

func (WoodDoor) FlammabilityInfo

func (d WoodDoor) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (WoodDoor) FuelInfo added in v0.8.0

func (WoodDoor) FuelInfo() item.FuelInfo

FuelInfo ...

func (WoodDoor) Hash

func (d WoodDoor) Hash() (uint64, uint64)

func (WoodDoor) Instrument

func (WoodDoor) Instrument() sound.Instrument

Instrument ...

func (WoodDoor) LightDiffusionLevel

func (WoodDoor) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodDoor) Model

func (d WoodDoor) Model() world.BlockModel

Model ...

func (WoodDoor) NeighbourUpdateTick

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

NeighbourUpdateTick ...

func (WoodDoor) SideClosed

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

SideClosed ...

func (WoodDoor) UseOnBlock

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

UseOnBlock handles the directional placing of doors

type WoodFence

type WoodFence struct {

	// Wood is the type of wood of the fence. This field must have one of the values found in the wood
	// package.
	Wood WoodType
	// contains filtered or unexported fields
}

WoodFence are blocks similar to Walls, which cannot normally be jumped over. Unlike walls however, they allow the player (but not mobs) to see through them, making for excellent barriers.

func (WoodFence) BreakInfo

func (w WoodFence) BreakInfo() BreakInfo

BreakInfo ...

func (WoodFence) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (WoodFence) EncodeBlock

func (w WoodFence) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (WoodFence) EncodeItem

func (w WoodFence) EncodeItem() (name string, meta int16)

EncodeItem ...

func (WoodFence) FlammabilityInfo

func (w WoodFence) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (WoodFence) FuelInfo added in v0.8.0

func (WoodFence) FuelInfo() item.FuelInfo

FuelInfo ...

func (WoodFence) Hash

func (w WoodFence) Hash() (uint64, uint64)

func (WoodFence) Instrument

func (WoodFence) Instrument() sound.Instrument

Instrument ...

func (WoodFence) LightDiffusionLevel

func (WoodFence) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodFence) Model

func (w WoodFence) Model() world.BlockModel

Model ...

func (WoodFence) SideClosed

func (WoodFence) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

type WoodFenceGate

type WoodFenceGate struct {

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

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

func (WoodFenceGate) Activate

func (f WoodFenceGate) Activate(pos cube.Pos, _ cube.Face, w *world.World, u item.User, _ *item.UseContext) bool

Activate ...

func (WoodFenceGate) BreakInfo

func (f WoodFenceGate) BreakInfo() BreakInfo

BreakInfo ...

func (WoodFenceGate) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (WoodFenceGate) EncodeBlock

func (f WoodFenceGate) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (WoodFenceGate) EncodeItem

func (f WoodFenceGate) EncodeItem() (name string, meta int16)

EncodeItem ...

func (WoodFenceGate) FlammabilityInfo

func (f WoodFenceGate) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (WoodFenceGate) FuelInfo added in v0.8.0

func (WoodFenceGate) FuelInfo() item.FuelInfo

FuelInfo ...

func (WoodFenceGate) Hash

func (f WoodFenceGate) Hash() (uint64, uint64)

func (WoodFenceGate) Instrument

func (WoodFenceGate) Instrument() sound.Instrument

Instrument ...

func (WoodFenceGate) LightDiffusionLevel

func (WoodFenceGate) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodFenceGate) Model

func (f WoodFenceGate) Model() world.BlockModel

Model ...

func (WoodFenceGate) NeighbourUpdateTick added in v0.8.0

func (f WoodFenceGate) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World)

NeighbourUpdateTick ...

func (WoodFenceGate) SideClosed

func (f WoodFenceGate) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (WoodFenceGate) UseOnBlock

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

UseOnBlock ...

type WoodTrapdoor

type WoodTrapdoor struct {

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

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

func (WoodTrapdoor) Activate

func (t WoodTrapdoor) Activate(pos cube.Pos, _ cube.Face, w *world.World, _ item.User, _ *item.UseContext) bool

Activate ...

func (WoodTrapdoor) BreakInfo

func (t WoodTrapdoor) BreakInfo() BreakInfo

BreakInfo ...

func (WoodTrapdoor) CanDisplace

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

CanDisplace returns true if the world.Liquid passed is of the type Water, not falling and has a depth of 8.

func (WoodTrapdoor) EncodeBlock

func (t WoodTrapdoor) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (WoodTrapdoor) EncodeItem

func (t WoodTrapdoor) EncodeItem() (name string, meta int16)

EncodeItem ...

func (WoodTrapdoor) FlammabilityInfo

func (t WoodTrapdoor) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (WoodTrapdoor) FuelInfo added in v0.8.0

func (WoodTrapdoor) FuelInfo() item.FuelInfo

FuelInfo ...

func (WoodTrapdoor) Hash

func (t WoodTrapdoor) Hash() (uint64, uint64)

func (WoodTrapdoor) Instrument

func (WoodTrapdoor) Instrument() sound.Instrument

Instrument ...

func (WoodTrapdoor) LightDiffusionLevel

func (WoodTrapdoor) LightDiffusionLevel() uint8

LightDiffusionLevel ...

func (WoodTrapdoor) Model

func (t WoodTrapdoor) Model() world.BlockModel

Model ...

func (WoodTrapdoor) SideClosed

func (t WoodTrapdoor) SideClosed(cube.Pos, cube.Pos, *world.World) bool

SideClosed ...

func (WoodTrapdoor) UseOnBlock

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

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

type WoodType

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

WoodType represents a type of wood of a block. Some blocks, such as log blocks, bark blocks, wooden planks and others carry one of these types.

func AcaciaWood

func AcaciaWood() WoodType

AcaciaWood returns acacia wood material.

func BirchWood

func BirchWood() WoodType

BirchWood returns birchwood material.

func CherryWood added in v0.9.19

func CherryWood() WoodType

CherryWood returns cherry wood material.

func CrimsonWood

func CrimsonWood() WoodType

CrimsonWood returns crimson wood material.

func DarkOakWood

func DarkOakWood() WoodType

DarkOakWood returns dark oak wood material.

func JungleWood

func JungleWood() WoodType

JungleWood returns jungle wood material.

func MangroveWood added in v0.9.19

func MangroveWood() WoodType

MangroveWood returns mangrove wood material.

func OakWood

func OakWood() WoodType

OakWood returns oak wood material.

func SpruceWood

func SpruceWood() WoodType

SpruceWood returns spruce wood material.

func WarpedWood

func WarpedWood() WoodType

WarpedWood returns warped wood material.

func WoodTypes

func WoodTypes() []WoodType

WoodTypes returns a list of all wood types

func (WoodType) Flammable

func (w WoodType) Flammable() bool

Flammable returns whether the wood type is flammable.

func (WoodType) Name

func (w WoodType) Name() string

Name ...

func (WoodType) String

func (w WoodType) String() string

String ...

func (WoodType) Uint8

func (w WoodType) Uint8() uint8

Uint8 returns the wood as a uint8.

type Wool

type Wool struct {

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

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

func (Wool) BreakInfo

func (w Wool) BreakInfo() BreakInfo

BreakInfo ...

func (Wool) EncodeBlock

func (w Wool) EncodeBlock() (name string, properties map[string]any)

EncodeBlock ...

func (Wool) EncodeItem

func (w Wool) EncodeItem() (name string, meta int16)

EncodeItem ...

func (Wool) FlammabilityInfo

func (w Wool) FlammabilityInfo() FlammabilityInfo

FlammabilityInfo ...

func (Wool) Hash

func (w Wool) Hash() (uint64, uint64)

func (Wool) Instrument

func (w Wool) Instrument() sound.Instrument

Instrument ...

func (Wool) Model

func (Wool) Model() world.BlockModel

Model ...

type XPDropRange

type XPDropRange [2]int

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

func (XPDropRange) RandomValue added in v0.9.0

func (r XPDropRange) RandomValue() int

RandomValue returns a random XP value that falls within the drop range.

Source Files

Directories

Path Synopsis
Package cube provides types and functions to handle positions and rotations of voxel-based objects in a 3D world.
Package cube provides types and functions to handle positions and rotations of voxel-based objects in a 3D world.
Package model has world.BlockModel implementations for each world.Block implementation in the block package.
Package model has world.BlockModel implementations for each world.Block implementation in the block package.

Jump to

Keyboard shortcuts

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