public class PowerComponent extends BooleanComponent
| Modifier and Type | Class and Description |
|---|---|
static class |
PowerComponent.ComponentType
ComponentType whether the
PowerComponent should receive or provide redstone power. |
static class |
PowerComponent.InteractionType
InterractionType defines how the
PowerComponent is changed. |
| Constructor and Description |
|---|
PowerComponent(PowerComponent.InteractionType interractionType,
PowerComponent.ComponentType componentType) |
| Modifier and Type | Method and Description |
|---|---|
void |
breakBlock(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state)
Called when the
Block is broken. |
boolean |
canProvidePower(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state) |
static net.minecraft.block.properties.PropertyBool |
getProperty(net.minecraft.block.Block block) |
static boolean |
isPowered(net.minecraft.block.state.IBlockState state)
Checks if is powered of this
IBlockState. |
static boolean |
isPowered(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Checks whether the block in world is powered.
|
boolean |
onBlockActivated(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.EnumFacing side,
float hitX,
float hitY,
float hitZ)
Called when the
Block is right-clicked by the player. |
void |
onComponentAdded(IComponentProvider provider)
Called when this
IComponent is added to the IComponentProvider. |
void |
onNeighborBlockChange(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
net.minecraft.block.Block neighborBlock,
net.minecraft.util.math.BlockPos neighborPos)
Called when a neighboring
Block changes. |
get, get, getMetaFromState, getName, getProperty, getStateFromMeta, invert, invert, set, set, setDefaultState, setMetaOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanPlaceBlockAt, canPlaceBlockOnSide, damageDropped, getBoundingBox, getBoundingBoxes, getHasSubtypes, getItem, getItemDropped, getLightOpacity, getMapColor, getPackedLightmapCoords, getProperties, getStateForPlacement, getSubBlocks, getUnlocalizedName, isFullBlock, isFullCube, isOpaqueCube, onBlockAdded, onBlockPlacedBy, quantityDropped, shouldSideBeRenderedgetComponent, getDependencies, isClientComponentpublic PowerComponent(PowerComponent.InteractionType interractionType, PowerComponent.ComponentType componentType)
public void onComponentAdded(IComponentProvider provider)
IComponentIComponent is added to the IComponentProvider.provider - the providerpublic boolean onBlockActivated(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.EnumFacing side,
float hitX,
float hitY,
float hitZ)
IBlockComponentBlock is right-clicked by the player.block - the blockworld - the worldpos - the posstate - the stateplayer - the playerside - the sidehitX - the hit xhitY - the hit yhitZ - the hit zpublic void onNeighborBlockChange(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
net.minecraft.block.Block neighborBlock,
net.minecraft.util.math.BlockPos neighborPos)
IBlockComponentBlock changes.block - the blockworld - the worldpos - the posstate - the stateneighborBlock - the neighbor blockneighborPos - TODOpublic boolean canProvidePower(net.minecraft.block.Block block,
net.minecraft.block.state.IBlockState state)
public void breakBlock(net.minecraft.block.Block block,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state)
IBlockComponentBlock is broken.block - the blockworld - the worldpos - the posstate - the statepublic static boolean isPowered(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
world - the worldpos - the pospublic static boolean isPowered(net.minecraft.block.state.IBlockState state)
IBlockState.state - the statepublic static net.minecraft.block.properties.PropertyBool getProperty(net.minecraft.block.Block block)