public class DirectionalComponent extends java.lang.Object implements IBlockComponent
MalisisBlock allows the block to automatically have an orientation.IBlockState<->metadata conversion.
HORIZONTAL and ALL properties are available by default, but the component can be used with any
PropertyDirection.| Modifier and Type | Class and Description |
|---|---|
static interface |
DirectionalComponent.IPlacement |
static class |
DirectionalComponent.Placement |
| Modifier and Type | Field and Description |
|---|---|
static net.minecraft.block.properties.PropertyDirection |
ALL |
static net.minecraft.block.properties.PropertyDirection |
HORIZONTAL |
| Constructor and Description |
|---|
DirectionalComponent()
Instantiates a new
DirectionalComponent with HORIZONTAL property and DirectionalComponent.Placement.PLACER by default. |
DirectionalComponent(DirectionalComponent.IPlacement placement)
Instantiates a new
DirectionalComponent with specified placement and HORIZONTAL property by default. |
DirectionalComponent(net.minecraft.block.properties.PropertyDirection property)
Instantiates a new
DirectionalComponent with specified property and DirectionalComponent.Placement.PLACER by default. |
DirectionalComponent(net.minecraft.block.properties.PropertyDirection property,
DirectionalComponent.IPlacement placement)
Instantiates a new
DirectionalComponent. |
| Modifier and Type | Method and Description |
|---|---|
static net.minecraft.util.EnumFacing |
getDirection(net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos)
Gets the
direction for the Block at world coords. |
static net.minecraft.util.EnumFacing |
getDirection(net.minecraft.block.state.IBlockState state)
Gets the
direction for the IBlockState |
int |
getMetaFromState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Gets the metadata from the
IBlockState. |
static net.minecraft.block.state.IBlockState |
getPlacedState(net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing facing,
net.minecraft.entity.EntityLivingBase placer) |
net.minecraft.block.properties.PropertyDirection |
getProperty()
Gets the property direction to use for this
DirectionalComponent. |
static net.minecraft.block.properties.PropertyDirection |
getProperty(net.minecraft.block.Block block)
Gets the
PropertyDirection used by the block. |
net.minecraft.block.state.IBlockState |
getStateFromMeta(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state,
int meta)
Gets the
IBlockState from meta. |
net.minecraft.block.state.IBlockState |
onBlockPlaced(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing facing,
float hitX,
float hitY,
float hitZ,
int meta,
net.minecraft.entity.EntityLivingBase placer)
Automatically gets the right
IBlockState based on the placer facing. |
net.minecraft.block.state.IBlockState |
placedState(net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing facing,
net.minecraft.entity.EntityLivingBase placer) |
static net.minecraft.block.state.IBlockState |
rotate(net.minecraft.block.state.IBlockState state)
Rotates the
IBlockState by 90 degrees counter-clockwise. |
static net.minecraft.block.state.IBlockState |
rotate(net.minecraft.block.state.IBlockState state,
int angle)
Rotates the
IBlockState by a factor of 90 degrees counter-clockwise. |
net.minecraft.block.state.IBlockState |
setDefaultState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Sets the default value to use for the
IBlockState. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbreakBlock, canPlaceBlockAt, canPlaceBlockOnSide, damageDropped, getBoundingBox, getBoundingBoxes, getItem, getItemDropped, getLightOpacity, getMapColor, getPackedLightmapCoords, getProperties, getSubBlocks, getUnlocalizedName, isFullBlock, isFullCube, isOpaqueCube, onBlockActivated, onBlockAdded, onBlockPlacedBy, onNeighborBlockChange, quantityDropped, shouldSideBeRenderedgetComponent, getDependencies, isClientComponentpublic static final net.minecraft.block.properties.PropertyDirection HORIZONTAL
public static final net.minecraft.block.properties.PropertyDirection ALL
public DirectionalComponent(net.minecraft.block.properties.PropertyDirection property,
DirectionalComponent.IPlacement placement)
DirectionalComponent.property - the propertyplacement - the placementpublic DirectionalComponent()
DirectionalComponent with HORIZONTAL property and DirectionalComponent.Placement.PLACER by default.public DirectionalComponent(net.minecraft.block.properties.PropertyDirection property)
DirectionalComponent with specified property and DirectionalComponent.Placement.PLACER by default.property - the propertypublic DirectionalComponent(DirectionalComponent.IPlacement placement)
DirectionalComponent with specified placement and HORIZONTAL property by default.placement - the placementpublic net.minecraft.block.properties.PropertyDirection getProperty()
DirectionalComponent.getProperty in interface IBlockComponentpublic net.minecraft.block.state.IBlockState setDefaultState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockState.setDefaultState in interface IBlockComponentblock - the blockstate - the statepublic net.minecraft.block.state.IBlockState placedState(net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing facing,
net.minecraft.entity.EntityLivingBase placer)
public net.minecraft.block.state.IBlockState onBlockPlaced(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing facing,
float hitX,
float hitY,
float hitZ,
int meta,
net.minecraft.entity.EntityLivingBase placer)
IBlockState based on the placer facing.onBlockPlaced in interface IBlockComponentblock - the blockworld - the worldpos - the posfacing - the facinghitX - the hit xhitY - the hit yhitZ - the hit zmeta - the metaplacer - the placerstate - the statepublic net.minecraft.block.state.IBlockState getStateFromMeta(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state,
int meta)
IBlockState from meta.getStateFromMeta in interface IBlockComponentblock - the blockmeta - the metapublic int getMetaFromState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockState.getMetaFromState in interface IBlockComponentblock - the blockstate - the statepublic static net.minecraft.util.EnumFacing getDirection(net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos)
direction for the Block at world coords.world - the worldpos - the posDirectionalComponentpublic static net.minecraft.util.EnumFacing getDirection(net.minecraft.block.state.IBlockState state)
direction for the IBlockStatestate - the stateDirectionalComponentpublic static net.minecraft.block.properties.PropertyDirection getProperty(net.minecraft.block.Block block)
PropertyDirection used by the block.block - the blockpublic static net.minecraft.block.state.IBlockState rotate(net.minecraft.block.state.IBlockState state)
IBlockState by 90 degrees counter-clockwise.state - the statepublic static net.minecraft.block.state.IBlockState rotate(net.minecraft.block.state.IBlockState state,
int angle)
IBlockState by a factor of 90 degrees counter-clockwise.state - the stateangle - the anglepublic static net.minecraft.block.state.IBlockState getPlacedState(net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing facing,
net.minecraft.entity.EntityLivingBase placer)