public class ComparatorBlock extends RedstoneDiodeBlock implements ITileEntityProvider
Block.OffsetType, Block.Properties, Block.RenderSideCacheKey
Modifier and Type | Field and Description |
---|---|
static EnumProperty<ComparatorMode> |
MODE |
POWERED, SHAPE
HORIZONTAL_FACING
BLOCK_STATE_IDS, blockHardness, blockResistance, blocksMovement, lightValue, LOGGER, material, materialColor, RANDOM, soundType, stateContainer, ticksRandomly
delegate
Constructor and Description |
---|
ComparatorBlock(Block.Properties properties) |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateInputStrength(World worldIn,
BlockPos pos,
BlockState state) |
private int |
calculateOutput(World worldIn,
BlockPos pos,
BlockState state) |
TileEntity |
createNewTileEntity(IBlockReader worldIn) |
boolean |
eventReceived(BlockState state,
World worldIn,
BlockPos pos,
int id,
int param) |
protected void |
fillStateContainer(StateContainer.Builder<Block,BlockState> builder) |
private ItemFrameEntity |
findItemFrame(World worldIn,
Direction facing,
BlockPos pos) |
protected int |
getActiveSignal(IBlockReader worldIn,
BlockPos pos,
BlockState state) |
protected int |
getDelay(BlockState state) |
boolean |
getWeakChanges(BlockState state,
IWorldReader world,
BlockPos pos)
If this block should be notified of weak changes.
|
ActionResultType |
onBlockActivated(BlockState state,
World worldIn,
BlockPos pos,
PlayerEntity player,
Hand handIn,
BlockRayTraceResult hit) |
void |
onNeighborChange(BlockState state,
IWorldReader world,
BlockPos pos,
BlockPos neighbor)
Called when a tile entity on a side of this block changes is created or is destroyed.
|
private void |
onStateChange(World worldIn,
BlockPos pos,
BlockState state) |
protected boolean |
shouldBePowered(World worldIn,
BlockPos pos,
BlockState state) |
void |
tick(BlockState state,
ServerWorld worldIn,
BlockPos pos,
java.util.Random rand) |
protected void |
updateState(World worldIn,
BlockPos pos,
BlockState state) |
canProvidePower, getPowerOnSide, getPowerOnSides, getShape, getStateForPlacement, getStrongPower, getWeakPower, isAlternateInput, isDiode, isFacingTowardsRepeater, isLocked, isValidPosition, neighborChanged, notifyNeighbors, onBlockAdded, onBlockPlacedBy, onReplaced
mirror, rotate
addInformation, allowsMovement, animateTick, asItem, canDropFromExplosion, canEntitySpawn, cannotAttach, canSpawnInBlock, canSustainPlant, causesSuffocation, doesSideFillSquare, dropXpOnBlockBreak, fillItemGroup, fillWithRain, getAmbientOcclusionLightValue, getBlockFromItem, getBlockHardness, getCollisionShape, getComparatorInputOverride, getContainer, getDefaultState, getDrops, getDrops, getDrops, getExplosionResistance, getFluidState, getHarvestLevel, getHarvestTool, getItem, getJumpFactor, getLightValue, getLootTable, getMaterial, getMaterialColor, getNameTextComponent, getOffset, getOffsetType, getOpacity, getPlayerRelativeBlockHardness, getPositionRandom, getPushReaction, getRaytraceShape, getRenderShape, getRenderType, getSlipperiness, getSlipperiness, getSoundType, getSpeedFactor, getStateById, getStateContainer, getStateId, getTags, getTranslationKey, getValidBlockForPosition, harvestBlock, hasComparatorInputOverride, hasEnoughSolidSide, hasSolidSide, hasSolidSideOnTop, hasTileEntity, isAir, isEmissiveRendering, isIn, isNormalCube, isOpaque, isOpaqueCube, isReplaceable, isReplaceable, isSideInvisible, isSolid, isTransparent, isVariableOpacity, isViewBlocking, makeCuboidShape, needsPostProcessing, nudgeEntitiesWithNewState, onBlockClicked, onBlockHarvested, onEntityCollision, onEntityWalk, onExplosionDestroy, onFallenUpon, onLanded, onPlayerDestroy, onProjectileCollision, propagatesSkylightDown, randomTick, replaceBlock, setDefaultState, shouldSideBeRendered, spawnAdditionalDrops, spawnAsEntity, spawnDrops, spawnDrops, spawnDrops, tickRate, ticksRandomly, toString, updateDiagonalNeighbors, updateNeighbors, updatePostPlacement
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, beginLeaveDecay, canBeConnectedTo, canBeReplacedByLeaves, canBeReplacedByLogs, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, createTileEntity, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getExtendedState, getFireSpreadSpeed, getFlammability, getFogColor, getLightValue, getPickBlock, getRayTraceResult, getSoundType, getStateAtViewpoint, getStateForPlacement, getValidRotations, hasTileEntity, isAir, isBeaconBase, isBed, isBedFoot, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isFoliage, isLadder, isPortalFrame, isReplaceableOreGen, isSlimeBlock, isStickyBlock, isToolEffective, observedNeighborChange, onBlockExploded, onPlantGrow, recolorBlock, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
public static final EnumProperty<ComparatorMode> MODE
public ComparatorBlock(Block.Properties properties)
protected int getDelay(BlockState state)
getDelay
in class RedstoneDiodeBlock
protected int getActiveSignal(IBlockReader worldIn, BlockPos pos, BlockState state)
getActiveSignal
in class RedstoneDiodeBlock
private int calculateOutput(World worldIn, BlockPos pos, BlockState state)
protected boolean shouldBePowered(World worldIn, BlockPos pos, BlockState state)
shouldBePowered
in class RedstoneDiodeBlock
protected int calculateInputStrength(World worldIn, BlockPos pos, BlockState state)
calculateInputStrength
in class RedstoneDiodeBlock
@Nullable private ItemFrameEntity findItemFrame(World worldIn, Direction facing, BlockPos pos)
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit)
onBlockActivated
in class Block
protected void updateState(World worldIn, BlockPos pos, BlockState state)
updateState
in class RedstoneDiodeBlock
private void onStateChange(World worldIn, BlockPos pos, BlockState state)
public void tick(BlockState state, ServerWorld worldIn, BlockPos pos, java.util.Random rand)
tick
in class RedstoneDiodeBlock
public boolean eventReceived(BlockState state, World worldIn, BlockPos pos, int id, int param)
eventReceived
in class Block
public TileEntity createNewTileEntity(IBlockReader worldIn)
createNewTileEntity
in interface ITileEntityProvider
protected void fillStateContainer(StateContainer.Builder<Block,BlockState> builder)
fillStateContainer
in class Block
public boolean getWeakChanges(BlockState state, IWorldReader world, BlockPos pos)
IForgeBlock
getWeakChanges
in interface IForgeBlock
world
- The current worldpos
- Block position in worldpublic void onNeighborChange(BlockState state, IWorldReader world, BlockPos pos, BlockPos neighbor)
IForgeBlock
onNeighborChange
in interface IForgeBlock
world
- The worldpos
- Block position in worldneighbor
- Block position of neighbor