Table of Contents

Class BlockGeneric

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class BlockGeneric : Block
Inheritance
BlockGeneric
Inherited Members
Extension Methods

Methods

DoParticalSelection(IWorldAccessor, BlockPos)

If true, the player can select invdividual selection boxes of this block

public override bool DoParticalSelection(IWorldAccessor world, BlockPos pos)

Parameters

world IWorldAccessor
pos BlockPos

Returns

bool

GetCollisionBoxes(IBlockAccessor, BlockPos)

Returns the blocks collision box. Warning: This method may get called by different threads, so it has to be thread safe.

public override Cuboidf[] GetCollisionBoxes(IBlockAccessor blockAccessor, BlockPos pos)

Parameters

blockAccessor IBlockAccessor
pos BlockPos

Returns

Cuboidf[]

GetDecal(IWorldAccessor, BlockPos, ITexPositionSource, ref MeshData, ref MeshData)

Called before a decal is created.

public override void GetDecal(IWorldAccessor world, BlockPos pos, ITexPositionSource decalTexSource, ref MeshData decalModelData, ref MeshData blockModelData)

Parameters

world IWorldAccessor
pos BlockPos
decalTexSource ITexPositionSource
decalModelData MeshData

The block model which need UV values for the decal texture

blockModelData MeshData

The original block model

GetParticleBreakBox(IBlockAccessor, BlockPos, BlockFacing)

The cuboid used to determine where to spawn particles when breaking the block

public override Cuboidf GetParticleBreakBox(IBlockAccessor blockAccess, BlockPos pos, BlockFacing facing)

Parameters

blockAccess IBlockAccessor
pos BlockPos
facing BlockFacing

Returns

Cuboidf

GetParticleCollisionBoxes(IBlockAccessor, BlockPos)

Returns the blocks particle collision box. Warning: This method may get called by different threads, so it has to be thread safe.

public override Cuboidf[] GetParticleCollisionBoxes(IBlockAccessor blockAccessor, BlockPos pos)

Parameters

blockAccessor IBlockAccessor
pos BlockPos

Returns

Cuboidf[]

GetSelectionBoxes(IBlockAccessor, BlockPos)

Returns the blocks selection boxes at this position in the world.

public override Cuboidf[] GetSelectionBoxes(IBlockAccessor blockAccessor, BlockPos pos)

Parameters

blockAccessor IBlockAccessor
pos BlockPos

Returns

Cuboidf[]

OnDecalTesselation(IWorldAccessor, MeshData, BlockPos)

public override void OnDecalTesselation(IWorldAccessor world, MeshData decalMesh, BlockPos pos)

Parameters

world IWorldAccessor
decalMesh MeshData
pos BlockPos

TryPlaceBlockForWorldGen(IBlockAccessor, BlockPos, BlockFacing, IRandom, BlockPatchAttributes)

Currently used for wildvines and saguaro cactus

public override bool TryPlaceBlockForWorldGen(IBlockAccessor blockAccessor, BlockPos pos, BlockFacing onBlockFace, IRandom worldgenRandom, BlockPatchAttributes attributes = null)

Parameters

blockAccessor IBlockAccessor
pos BlockPos
onBlockFace BlockFacing
worldgenRandom IRandom
attributes BlockPatchAttributes

Returns

bool