T - the generic typepublic class SubtypeComponent<T extends java.lang.Enum<T> & net.minecraft.util.IStringSerializable> extends java.lang.Object implements IBlockComponent
SubtypeComponent automatically handles multiple blocks variants and its different items based on a specific Enum.| Constructor and Description |
|---|
SubtypeComponent(java.lang.Class<T> clazz)
Instantiates a new
SubtypeComponent. |
SubtypeComponent(java.lang.Class<T> clazz,
net.minecraft.block.properties.PropertyEnum<T> property)
Instantiates a new
SubtypeComponent. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getHasSubtypes(net.minecraft.block.Block block,
net.minecraft.item.Item item)
Checks whether the Item has subtypes.
|
int |
getMetaFromState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Gets the metadata from the
IBlockState. |
net.minecraft.block.properties.PropertyEnum<T> |
getProperty()
Gets the
IProperty used by this IBlockComponent. |
net.minecraft.block.state.IBlockState |
getStateFromMeta(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state,
int meta)
Gets the
IBlockState from meta. |
void |
getSubBlocks(net.minecraft.block.Block block,
net.minecraft.item.Item item,
net.minecraft.creativetab.CreativeTabs tab,
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> list)
Fills the list with the sub-blocks associated with this
Block. |
java.lang.String |
getUnlocalizedName(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Gets the unlocalized name for the specific
IBlockState. |
net.minecraft.block.state.IBlockState |
setDefaultState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Sets the default values for the
IBlockState. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbreakBlock, canPlaceBlockAt, canPlaceBlockOnSide, canProvidePower, damageDropped, getBoundingBox, getBoundingBoxes, getItem, getItemDropped, getLightOpacity, getMapColor, getPackedLightmapCoords, getProperties, getStateForPlacement, isFullBlock, isFullCube, isOpaqueCube, onBlockActivated, onBlockAdded, onBlockPlacedBy, onNeighborBlockChange, quantityDropped, shouldSideBeRenderedgetComponent, getDependencies, isClientComponent, onComponentAddedpublic SubtypeComponent(java.lang.Class<T> clazz, net.minecraft.block.properties.PropertyEnum<T> property)
SubtypeComponent.clazz - the clazzproperty - the propertypublic SubtypeComponent(java.lang.Class<T> clazz)
SubtypeComponent.clazz - the clazzpublic java.lang.String getUnlocalizedName(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockComponentIBlockState.getUnlocalizedName in interface IBlockComponentblock - the blockstate - the statepublic boolean getHasSubtypes(net.minecraft.block.Block block,
net.minecraft.item.Item item)
IBlockComponentgetHasSubtypes in interface IBlockComponentpublic net.minecraft.block.properties.PropertyEnum<T> getProperty()
IBlockComponentIProperty used by this IBlockComponent.getProperty in interface IBlockComponentpublic net.minecraft.block.state.IBlockState setDefaultState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockComponentIBlockState.setDefaultState in interface IBlockComponentblock - the blockstate - the statepublic void getSubBlocks(net.minecraft.block.Block block,
net.minecraft.item.Item item,
net.minecraft.creativetab.CreativeTabs tab,
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> list)
IBlockComponentBlock.getSubBlocks in interface IBlockComponentblock - the blockitem - the itemtab - the tablist - the listpublic net.minecraft.block.state.IBlockState getStateFromMeta(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state,
int meta)
IBlockComponentIBlockState from meta.getStateFromMeta in interface IBlockComponentblock - the blockmeta - the metapublic int getMetaFromState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockComponentIBlockState.getMetaFromState in interface IBlockComponentblock - the blockstate - the state