public class BlockObserver extends BlockDirectional
Block.EnumOffsetType
IForgeRegistryEntry.Impl<T extends IForgeRegistryEntry<T>>
Modifier and Type | Field and Description |
---|---|
static PropertyBool |
POWERED |
FACING
BLOCK_STATE_IDS, blockHardness, blockMapColor, blockMaterial, blockParticleGravity, blockResistance, blockSoundType, blockState, capturedDrops, captureDrops, enableStats, FULL_BLOCK_AABB, fullBlock, harvesters, isBlockContainer, lightOpacity, lightValue, needsRandomTick, NULL_AABB, RANDOM, REGISTRY, slipperiness, translucent, useNeighborBrightness
delegate
Constructor and Description |
---|
BlockObserver() |
Modifier and Type | Method and Description |
---|---|
void |
breakBlock(World worldIn,
BlockPos pos,
IBlockState state)
Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
|
boolean |
canProvidePower(IBlockState state)
Can this block provide power.
|
protected BlockStateContainer |
createBlockState() |
int |
getMetaFromState(IBlockState state)
Convert the BlockState into the correct metadata value
|
IBlockState |
getStateForPlacement(World worldIn,
BlockPos pos,
EnumFacing facing,
float hitX,
float hitY,
float hitZ,
int meta,
EntityLivingBase placer)
Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
IBlockstate
|
IBlockState |
getStateFromMeta(int meta)
Convert the given metadata into a BlockState for this Block
|
int |
getStrongPower(IBlockState blockState,
IBlockAccess blockAccess,
BlockPos pos,
EnumFacing side) |
int |
getWeakPower(IBlockState blockState,
IBlockAccess blockAccess,
BlockPos pos,
EnumFacing side) |
void |
neighborChanged(IBlockState state,
World worldIn,
BlockPos pos,
Block blockIn,
BlockPos fromPos)
Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
change.
|
void |
observedNeighborChange(IBlockState observerState,
World world,
BlockPos observerPos,
Block changedBlock,
BlockPos changedBlockPos)
Called on an Observer block whenever an update for an Observer is received.
|
void |
observedNeighborChanged(IBlockState p_190962_1_,
World p_190962_2_,
BlockPos p_190962_3_,
Block p_190962_4_,
BlockPos p_190962_5_) |
void |
onBlockAdded(World worldIn,
BlockPos pos,
IBlockState state)
Called after the block is set in the Chunk data, but before the Tile Entity is set
|
protected void |
updateNeighborsInFront(World p_190961_1_,
BlockPos p_190961_2_,
IBlockState p_190961_3_) |
void |
updateTick(World worldIn,
BlockPos pos,
IBlockState state,
java.util.Random rand) |
IBlockState |
withMirror(IBlockState state,
Mirror mirrorIn)
Returns the blockstate with the given mirror of the passed blockstate.
|
IBlockState |
withRotation(IBlockState state,
Rotation rot)
Returns the blockstate with the given rotation from the passed blockstate.
|
addCollisionBoxToList, addCollisionBoxToList, addDestroyEffects, addHitEffects, addInformation, addLandingEffects, beginLeavesDecay, canBeConnectedTo, canBeReplacedByLeaves, canCollideCheck, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canEntitySpawn, canHarvestBlock, canPlaceBlockAt, canPlaceBlockOnSide, canPlaceTorchOnTop, canRenderInLayer, canSilkHarvest, canSilkHarvest, canSpawnInBlock, canSustainLeaves, canSustainPlant, captureDrops, causesSuffocation, collisionRayTrace, createTileEntity, damageDropped, disableStats, doesSideBlockRendering, dropBlockAsItem, dropBlockAsItemWithChance, dropXpOnBlockBreak, eventReceived, fillWithRain, getActualState, getAiPathNodeType, getAmbientOcclusionLightValue, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlockById, getBlockFromItem, getBlockFromName, getBlockHardness, getBlockLayer, getBlockState, getBoundingBox, getCollisionBoundingBox, getComparatorInputOverride, getCreativeTabToDisplayOn, getDefaultState, getDrops, getEnableStats, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getExplosionResistance, getExtendedState, getFireSpreadSpeed, getFlammability, getHarvestLevel, getHarvestTool, getIdFromBlock, getItem, getItemDropped, getLightOpacity, getLightOpacity, getLightValue, getLightValue, getLocalizedName, getMapColor, getMaterial, getMobilityFlag, getOffset, getOffsetType, getPackedLightmapCoords, getPickBlock, getPlayerRelativeBlockHardness, getRenderType, getSelectedBoundingBox, getSilkTouchDrop, getSoundType, getSoundType, getStateById, getStateForPlacement, getStateId, getSubBlocks, getTickRandomly, getUnlocalizedName, getUseNeighborBrightness, getValidRotations, getWeakChanges, harvestBlock, hasComparatorInputOverride, hasCustomBreakingProgress, hasTileEntity, hasTileEntity, isAABBInsideMaterial, isAir, isAssociatedBlock, isBeaconBase, isBed, isBedFoot, isBlockNormalCube, isBlockSolid, isBurning, isCollidable, isEntityInsideMaterial, isEqualTo, isFertile, isFireSource, isFlammable, isFoliage, isFullBlock, isFullCube, isFullyOpaque, isLadder, isLeaves, isNormalCube, isNormalCube, isOpaqueCube, isPassable, isReplaceable, isReplaceableOreGen, isSideSolid, isToolEffective, isTranslucent, isWood, modifyAcceleration, onBlockActivated, onBlockClicked, onBlockDestroyedByExplosion, onBlockDestroyedByPlayer, onBlockExploded, onBlockHarvested, onBlockPlacedBy, onEntityCollidedWithBlock, onEntityWalk, onFallenUpon, onLanded, onNeighborChange, onPlantGrow, quantityDropped, quantityDropped, quantityDroppedWithBonus, randomDisplayTick, randomTick, rayTrace, recolorBlock, registerBlocks, removedByPlayer, requiresUpdates, rotateBlock, setBedOccupied, setBlockUnbreakable, setCreativeTab, setDefaultState, setHardness, setHarvestLevel, setHarvestLevel, setLightLevel, setLightOpacity, setResistance, setSoundType, setTickRandomly, setUnlocalizedName, shouldCheckWeakPower, shouldSideBeRendered, spawnAsEntity, tickRate, toString
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
public static final PropertyBool POWERED
protected BlockStateContainer createBlockState()
createBlockState
in class Block
public IBlockState withRotation(IBlockState state, Rotation rot)
withRotation
in class Block
public IBlockState withMirror(IBlockState state, Mirror mirrorIn)
withMirror
in class Block
public void updateTick(World worldIn, BlockPos pos, IBlockState state, java.util.Random rand)
updateTick
in class Block
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
neighborChanged
in class Block
public void observedNeighborChanged(IBlockState p_190962_1_, World p_190962_2_, BlockPos p_190962_3_, Block p_190962_4_, BlockPos p_190962_5_)
protected void updateNeighborsInFront(World p_190961_1_, BlockPos p_190961_2_, IBlockState p_190961_3_)
public boolean canProvidePower(IBlockState state)
canProvidePower
in class Block
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
getStrongPower
in class Block
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
getWeakPower
in class Block
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
onBlockAdded
in class Block
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
breakBlock
in class Block
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
getStateForPlacement
in class Block
public int getMetaFromState(IBlockState state)
getMetaFromState
in class Block
public IBlockState getStateFromMeta(int meta)
getStateFromMeta
in class Block
public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos)
Block
observedNeighborChange
in class Block
observerState
- The Observer block's state.world
- The current world.observerPos
- The Observer block's position.changedBlock
- The updated block.changedBlockPos
- The updated block's position.