Documentation ¶
Overview ¶
Package model has world.BlockModel implementations for each world.Block implementation in the block package. These models may be reused by blocks that share the same model. Some block models require additional fields and knowledge about the surrounding blocks to calculate the correct model.
Index ¶
- type Anvil
- type BrewingStand
- type Cactus
- type Cake
- type Campfire
- type Carpet
- type Chain
- type Chest
- type CocoaBean
- type Composter
- type DecoratedPot
- type Door
- type Empty
- type EnchantingTable
- type Fence
- type FenceGate
- type Grindstone
- type Hopper
- type Ladder
- type Lantern
- type Leaves
- type Lectern
- type Skull
- type Slab
- type Solid
- type Stair
- type Stonecutter
- type Thin
- type TilledGrass
- type Trapdoor
- type Wall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anvil ¶ added in v0.7.3
Anvil is a model used by anvils.
type BrewingStand ¶ added in v0.9.19
type BrewingStand struct{}
BrewingStand is a model used by brewing stands.
func (BrewingStand) BBox ¶ added in v0.9.19
func (b BrewingStand) BBox(cube.Pos, world.BlockSource) []cube.BBox
BBox ...
func (BrewingStand) FaceSolid ¶ added in v0.9.19
func (b BrewingStand) FaceSolid(cube.Pos, cube.Face, world.BlockSource) bool
FaceSolid ...
type Cactus ¶ added in v0.7.0
type Cactus struct{}
Cactus is the model for a Cactus. It is just barely not a full block, having a slightly reduced width and depth.
type Cake ¶
type Cake struct { // Bites is the amount of bites that were taken from the cake. A cake can have up to 7 bites taken from it, before // being consumed entirely. Bites int }
Cake is a model used by cake blocks.
type Campfire ¶ added in v0.9.18
type Campfire struct{}
Campfire is the model used by campfires.
type Carpet ¶
type Carpet struct{}
Carpet is a model for carpet-like extremely thin blocks.
type Chain ¶ added in v0.5.0
Chain is a model used by chain blocks.
type Chest ¶
type Chest struct{}
Chest is the model of a chest. It is just barely not a full block, having a slightly reduced with on all axes.
type CocoaBean ¶
type CocoaBean struct { // Facing is the face that the cocoa bean faces. It is the opposite of the face that the CocoaBean is attached to. Facing cube.Direction // Age is the age of the CocoaBean. The age influences the size of the CocoaBean. The maximum age value of a cocoa // bean is 3. Age int }
CocoaBean is a model used by cocoa bean blocks.
type Composter ¶ added in v0.8.2
type Composter struct { // Level is the level of compost inside the composter. Level int }
Composter is a model used by composter blocks. It is solid on all sides apart from the top, and the height of the inside area depends on the level of compost inside the composter.
type DecoratedPot ¶ added in v0.9.7
type DecoratedPot struct{}
DecoratedPot is the model for a DecoratedPot. It is just barely not a full block, having a slightly reduced width and depth.
func (DecoratedPot) BBox ¶ added in v0.9.7
func (DecoratedPot) BBox(cube.Pos, world.BlockSource) []cube.BBox
BBox returns a physics.BBox that is slightly smaller than a full block.
func (DecoratedPot) FaceSolid ¶ added in v0.9.7
func (DecoratedPot) FaceSolid(_ cube.Pos, face cube.Face, _ world.BlockSource) bool
FaceSolid always returns true for the top and bottom face, and false for all other faces.
type Door ¶
type Door struct { // Facing is the direction that the door is facing when closed. Facing cube.Direction // Open specifies if the Door is open. The direction it opens towards depends on the Right field. Open bool // Right specifies the attachment side of the door and, with that, the direction it opens in. Right bool }
Door is a model used for doors. It has no solid faces and a bounding box that changes depending on the direction of the door, whether it is open, and the side of its hinge.
type Empty ¶
type Empty struct{}
Empty is a model that is completely empty. It has no collision boxes or solid faces.
type EnchantingTable ¶ added in v0.8.0
type EnchantingTable struct{}
EnchantingTable is a model used by enchanting tables.
func (EnchantingTable) BBox ¶ added in v0.8.0
func (EnchantingTable) BBox(cube.Pos, world.BlockSource) []cube.BBox
BBox ...
func (EnchantingTable) FaceSolid ¶ added in v0.8.0
func (EnchantingTable) FaceSolid(cube.Pos, cube.Face, world.BlockSource) bool
FaceSolid ...
type Fence ¶
type Fence struct { // Wood specifies if the Fence is made from wood. This field is used to check if two fences are able to attach to // each other. Wood bool }
Fence is a model used by fences of any type. It can attach to blocks with solid faces and other fences of the same type and has a model height just slightly over 1.
type FenceGate ¶
type FenceGate struct { // Facing is the facing direction of the FenceGate. A fence gate can only be opened in this direction or the // direction opposite to it. Facing cube.Direction // Open specifies if the FenceGate is open. In this case, BBox returns an empty slice. Open bool }
FenceGate is a model used by fence gates. The model is completely zero-ed when the FenceGate is opened.
type Grindstone ¶ added in v0.8.2
Grindstone is a model used by grindstones.
func (Grindstone) BBox ¶ added in v0.8.2
func (g Grindstone) BBox(cube.Pos, world.BlockSource) []cube.BBox
BBox ...
func (Grindstone) FaceSolid ¶ added in v0.8.2
func (g Grindstone) FaceSolid(cube.Pos, cube.Face, world.BlockSource) bool
FaceSolid always returns false.
type Hopper ¶ added in v0.9.18
type Hopper struct{}
Hopper is a model used by hoppers.
type Ladder ¶ added in v0.2.0
type Ladder struct { // Facing is the side opposite to the block the Ladder is currently attached to. Facing cube.Face }
Ladder is the model for a ladder block.
type Lantern ¶
type Lantern struct { // Hanging specifies if the lantern is hanging from a block or if it's placed on the ground. Hanging bool }
Lantern is a model for the lantern block. It can be placed on the ground or hanging from the ceiling.
type Leaves ¶
type Leaves struct{}
Leaves is a model for leaves-like blocks. These blocks have a full collision box, but none of their faces are solid.
type Lectern ¶ added in v0.9.8
type Lectern struct{}
Lectern is a model used by lecterns.
type Skull ¶ added in v0.8.0
type Skull struct { // Direction is the direction the skull is facing. Direction cube.Face // Hanging specifies if the Skull is hanging on a wall. Hanging bool }
Skull is a model used by skull blocks.
type Slab ¶
type Slab struct {
// Double and Top specify if the Slab is a double slab and if it's in the top slot respectively. If Double is true,
// the BBox returned is always a full block.
Double, Top bool
}
Slab is the model of a slab-like block, which is either a half block or a full block, depending on if the slab is double.
type Solid ¶
type Solid struct{}
Solid is the model of a fully solid block. Blocks with this model, such as stone or wooden planks, have a 1x1x1 collision box.
type Stair ¶
type Stair struct { // Facing specifies the direction that the full side of the Stair faces. Facing cube.Direction // UpsideDown turns the Stair upside-down, meaning the full side of the Stair is turned to the top side of the // block. UpsideDown bool }
Stair is a model for stair-like blocks. These have different solid sides depending on the direction the stairs are facing, the surrounding blocks and whether it is upside down or not.
type Stonecutter ¶ added in v0.8.0
type Stonecutter struct{}
Stonecutter is a model used by stonecutters.
func (Stonecutter) BBox ¶ added in v0.8.0
func (Stonecutter) BBox(cube.Pos, world.BlockSource) []cube.BBox
BBox ...
func (Stonecutter) FaceSolid ¶ added in v0.8.0
func (Stonecutter) FaceSolid(cube.Pos, cube.Face, world.BlockSource) bool
FaceSolid ...
type Thin ¶
type Thin struct{}
Thin is a model for thin, partial blocks such as a glass pane or an iron bar. It changes its bounding box depending on solid faces next to it.
type TilledGrass ¶
type TilledGrass struct{}
TilledGrass is a model used for grass that has been tilled in some way, such as dirt paths and farmland.
func (TilledGrass) BBox ¶ added in v0.7.0
func (TilledGrass) BBox(cube.Pos, world.BlockSource) []cube.BBox
BBox returns a physics.BBox that spans an entire block.
func (TilledGrass) FaceSolid ¶
func (TilledGrass) FaceSolid(cube.Pos, cube.Face, world.BlockSource) bool
FaceSolid always returns true.
type Trapdoor ¶
type Trapdoor struct { // Facing is the facing direction of the Trapdoor. In addition to the texture, it influences the direction in which // the Trapdoor is opened. Facing cube.Direction // Open and Top specify if the Trapdoor is opened and if it's in the top or bottom part of a block respectively. Open, Top bool }
Trapdoor is a model used for trapdoors. It has no solid faces and a bounding box that changes depending on the direction of the trapdoor.
type Wall ¶ added in v0.8.0
type Wall struct { // NorthConnection is the height of the connection for the north direction. NorthConnection float64 // EastConnection is the height of the connection for the east direction. EastConnection float64 // SouthConnection is the height of the connection for the south direction. SouthConnection float64 // WestConnection is the height of the connection for the west direction. WestConnection float64 // Post is if the wall is the full height of a block or not. Post bool }
Wall is a model used by all wall types.
Source Files ¶
- anvil.go
- brewing_stand.go
- cactus.go
- cake.go
- campfire.go
- carpet.go
- chain.go
- chest.go
- cocoa_bean.go
- composter.go
- decorated_pot.go
- doc.go
- door.go
- empty.go
- enchanting_table.go
- fence.go
- fence_gate.go
- grindstone.go
- hopper.go
- ladder.go
- lantern.go
- leaves.go
- lectern.go
- skull.go
- slab.go
- solid.go
- stair.go
- stonecutter.go
- thin.go
- tilled_grass.go
- trapdoor.go
- wall.go