public class ComparatorBlock extends AbstractRedstoneGateBlock implements BlockEntityProvider
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
static EnumProperty<ComparatorMode> |
MODE |
POWERED, SHAPE
FACING
LOGGER, STATE_IDS, stateManager
collidable, 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, updateTarget
mirror, rotate
addStacksForDisplay, 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, toString
calcBlockBreakingDelta, 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, randomTick
public static final EnumProperty<ComparatorMode> MODE
public ComparatorBlock(AbstractBlock.Settings settings)
protected int getUpdateDelayInternal(BlockState state)
getUpdateDelayInternal
in class AbstractRedstoneGateBlock
protected int getOutputLevel(BlockView world, BlockPos pos, BlockState state)
getOutputLevel
in class AbstractRedstoneGateBlock
private int calculateOutputSignal(World world, BlockPos pos, BlockState state)
protected boolean hasPower(World world, BlockPos pos, BlockState state)
hasPower
in class AbstractRedstoneGateBlock
protected 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 AbstractBlock
protected void updatePowered(World world, BlockPos pos, BlockState state)
updatePowered
in class AbstractRedstoneGateBlock
private void update(World world, BlockPos pos, BlockState state)
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
scheduledTick
in class AbstractRedstoneGateBlock
public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)
onSyncedBlockEvent
in class AbstractBlock
public BlockEntity createBlockEntity(BlockView world)
createBlockEntity
in interface BlockEntityProvider
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block