public class ComparatorBlock extends AbstractRedstoneGateBlock implements BlockEntityProvider
Block.NeighborGroupAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>| Modifier and Type | Field and Description |
|---|---|
static EnumProperty<ComparatorMode> |
MODE |
POWERED, SHAPEFACINGLOGGER, STATE_IDS, stateManagercollidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier| Constructor and Description |
|---|
ComparatorBlock(AbstractBlock.Settings settings) |
canPlaceAt, emitsRedstonePower, getInputLevel, getMaxInputLevelSides, getOutlineShape, getPlacementState, getStrongRedstonePower, getWeakRedstonePower, isLocked, isRedstoneGate, isTargetNotAligned, isValidInput, neighborUpdate, onBlockAdded, onPlaced, onStateReplaced, updateTargetmirror, rotateaddStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringcalcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createScreenHandlerFactory, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getVisualShape, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, prepare, randomTickpublic static final EnumProperty<ComparatorMode> MODE
public ComparatorBlock(AbstractBlock.Settings settings)
protected int getUpdateDelayInternal(BlockState state)
getUpdateDelayInternal in class AbstractRedstoneGateBlockprotected int getOutputLevel(BlockView world, BlockPos pos, BlockState state)
getOutputLevel in class AbstractRedstoneGateBlockprivate int calculateOutputSignal(World world, BlockPos pos, BlockState state)
protected boolean hasPower(World world, BlockPos pos, BlockState state)
hasPower in class AbstractRedstoneGateBlockprotected int getPower(World world, BlockPos pos, BlockState state)
getPower in class AbstractRedstoneGateBlock@Nullable private ItemFrameEntity getAttachedItemFrame(World world, Direction facing, BlockPos pos)
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
This method is called on both the logical client and logical server, so take caution when overriding this method.
The logical side can be checked using world.isClient().
If the action result is successful on a logical client, then the action will be sent to the logical server for processing.
onUse in class AbstractBlockprotected void updatePowered(World world, BlockPos pos, BlockState state)
updatePowered in class AbstractRedstoneGateBlockprivate void update(World world, BlockPos pos, BlockState state)
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
scheduledTick in class AbstractRedstoneGateBlockpublic boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)
onSyncedBlockEvent in class AbstractBlockpublic BlockEntity createBlockEntity(BlockView world)
createBlockEntity in interface BlockEntityProviderprotected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties in class Block