public class ColorComponent extends SubtypeComponent<net.minecraft.item.EnumDyeColor> implements IRegisterComponent
ColorComponent automatically handles blocks with color variants.| Constructor and Description |
|---|
ColorComponent(boolean useColorMultiplier)
Instantiates a new
ColorComponent. |
| Modifier and Type | Method and Description |
|---|---|
int |
damageDropped(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Gets the damage value for the item when the
Block is dropped. |
static net.minecraft.item.EnumDyeColor |
getColor(net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos)
Gets the
color for the Block at world coords. |
static net.minecraft.item.EnumDyeColor |
getColor(net.minecraft.block.state.IBlockState state)
Gets the
color for the IBlockState. |
boolean |
getHasSubtypes(net.minecraft.block.Block block,
net.minecraft.item.Item item)
Checks whether the Item has subtypes.
|
net.minecraft.item.Item |
getItem(net.minecraft.block.Block block) |
net.minecraft.block.material.MapColor |
getMapColor(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Get the
MapColor for this Block and the given IBlockState. |
int |
getMetaFromState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Get the metadata from the
IBlockState |
int |
getRenderColor(net.minecraft.block.state.IBlockState state,
net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos,
int tintIndex)
Gets the render color for this
Block. |
net.minecraft.block.state.IBlockState |
getStateFromMeta(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state,
int meta)
Get the
IBlockState from the metadata |
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. |
void |
register(IComponentProvider block)
Extra registration process for
IComponent. |
net.minecraft.block.state.IBlockState |
setDefaultState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
Sets the default values for the
IBlockState. |
boolean |
useColorMultiplier()
Gets whether the color is handled by the renderer or by the texture.
|
getPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbreakBlock, canPlaceBlockAt, canPlaceBlockOnSide, canProvidePower, getBoundingBox, getBoundingBoxes, getItemDropped, getLightOpacity, getPackedLightmapCoords, getProperties, getStateForPlacement, isFullBlock, isFullCube, isOpaqueCube, onBlockActivated, onBlockAdded, onBlockPlacedBy, onNeighborBlockChange, quantityDropped, shouldSideBeRenderedgetComponent, getDependencies, isClientComponent, onComponentAddedpublic ColorComponent(boolean useColorMultiplier)
ColorComponent.useColorMultiplier - true if the renderer should handle the color, false if the color is already in the texturepublic boolean useColorMultiplier()
public net.minecraft.block.state.IBlockState setDefaultState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockComponentIBlockState.setDefaultState in interface IBlockComponentsetDefaultState in class SubtypeComponent<net.minecraft.item.EnumDyeColor>block - the blockstate - the statepublic void register(IComponentProvider block)
IRegisterComponentIComponent.register in interface IRegisterComponentblock - the providerpublic java.lang.String getUnlocalizedName(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockComponentIBlockState.getUnlocalizedName in interface IBlockComponentgetUnlocalizedName in class SubtypeComponent<net.minecraft.item.EnumDyeColor>block - the blockstate - the statepublic net.minecraft.item.Item getItem(net.minecraft.block.Block block)
getItem in interface IBlockComponentpublic int damageDropped(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockComponentBlock is dropped.damageDropped in interface IBlockComponentblock - the blockstate - the statepublic boolean getHasSubtypes(net.minecraft.block.Block block,
net.minecraft.item.Item item)
IBlockComponentgetHasSubtypes in interface IBlockComponentgetHasSubtypes in class SubtypeComponent<net.minecraft.item.EnumDyeColor>public 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 IBlockComponentgetSubBlocks in class SubtypeComponent<net.minecraft.item.EnumDyeColor>block - the blockitem - the itemtab - the tablist - the listpublic int getRenderColor(net.minecraft.block.state.IBlockState state,
net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos,
int tintIndex)
Block.useColorMultiplier() is false, color is already in the texture, and white (0xFFFFFF) is returned.state - the stateworld - the worldpos - the postintIndex - the tint indexpublic net.minecraft.block.material.MapColor getMapColor(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
MapColor for this Block and the given IBlockState.getMapColor in interface IBlockComponentblock - the blockstate - the statepublic net.minecraft.block.state.IBlockState getStateFromMeta(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state,
int meta)
IBlockState from the metadatagetStateFromMeta in interface IBlockComponentgetStateFromMeta in class SubtypeComponent<net.minecraft.item.EnumDyeColor>block - the blockstate - the statemeta - the metapublic int getMetaFromState(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
IBlockStategetMetaFromState in interface IBlockComponentgetMetaFromState in class SubtypeComponent<net.minecraft.item.EnumDyeColor>block - the blockstate - the statepublic static net.minecraft.item.EnumDyeColor getColor(net.minecraft.world.IBlockAccess world,
net.minecraft.util.math.BlockPos pos)
color for the Block at world coords.world - the worldpos - the posColorComponentpublic static net.minecraft.item.EnumDyeColor getColor(net.minecraft.block.state.IBlockState state)
color for the IBlockState.state - the stateColorComponent