public abstract class AbstractButtonBlock extends WallMountedBlock
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
protected static VoxelShape |
CEILING_X_PRESSED_SHAPE |
protected static VoxelShape |
CEILING_X_SHAPE |
protected static VoxelShape |
CEILING_Z_PRESSED_SHAPE |
protected static VoxelShape |
CEILING_Z_SHAPE |
protected static VoxelShape |
EAST_PRESSED_SHAPE |
protected static VoxelShape |
EAST_SHAPE |
protected static VoxelShape |
FLOOR_X_PRESSED_SHAPE |
protected static VoxelShape |
FLOOR_X_SHAPE |
protected static VoxelShape |
FLOOR_Z_PRESSED_SHAPE |
protected static VoxelShape |
FLOOR_Z_SHAPE |
protected static VoxelShape |
NORTH_PRESSED_SHAPE |
protected static VoxelShape |
NORTH_SHAPE |
static BooleanProperty |
POWERED |
protected static VoxelShape |
SOUTH_PRESSED_SHAPE |
protected static VoxelShape |
SOUTH_SHAPE |
protected static VoxelShape |
WEST_PRESSED_SHAPE |
protected static VoxelShape |
WEST_SHAPE |
private boolean |
wooden |
FACE
FACING
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Modifier | Constructor and Description |
---|---|
protected |
AbstractButtonBlock(boolean wooden,
AbstractBlock.Settings settings) |
canPlaceAt, canPlaceAt, getDirection, getPlacementState, getStateForNeighborUpdate
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, onPlaced, 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, getVisualShape, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onProjectileHit, onStacksDropped, onSyncedBlockEvent, prepare, randomTick
public static final BooleanProperty POWERED
protected static final VoxelShape CEILING_X_SHAPE
protected static final VoxelShape CEILING_Z_SHAPE
protected static final VoxelShape FLOOR_X_SHAPE
protected static final VoxelShape FLOOR_Z_SHAPE
protected static final VoxelShape NORTH_SHAPE
protected static final VoxelShape SOUTH_SHAPE
protected static final VoxelShape WEST_SHAPE
protected static final VoxelShape EAST_SHAPE
protected static final VoxelShape CEILING_X_PRESSED_SHAPE
protected static final VoxelShape CEILING_Z_PRESSED_SHAPE
protected static final VoxelShape FLOOR_X_PRESSED_SHAPE
protected static final VoxelShape FLOOR_Z_PRESSED_SHAPE
protected static final VoxelShape NORTH_PRESSED_SHAPE
protected static final VoxelShape SOUTH_PRESSED_SHAPE
protected static final VoxelShape WEST_PRESSED_SHAPE
protected static final VoxelShape EAST_PRESSED_SHAPE
private final boolean wooden
protected AbstractButtonBlock(boolean wooden, AbstractBlock.Settings settings)
private int getPressTicks()
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape
in class AbstractBlock
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
public void powerOn(BlockState state, World world, BlockPos pos)
protected void playClickSound(@Nullable PlayerEntity player, WorldAccess world, BlockPos pos, boolean powered)
protected abstract SoundEvent getClickSound(boolean powered)
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)
WorldChunk.setBlockState(BlockPos, BlockState, boolean)
if newState
is different from state
. Vanilla blocks perform removal cleanups here.onStateReplaced
in class AbstractBlock
public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
getWeakRedstonePower
in class AbstractBlock
public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
getStrongRedstonePower
in class AbstractBlock
public boolean emitsRedstonePower(BlockState state)
emitsRedstonePower
in class AbstractBlock
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
scheduledTick
in class AbstractBlock
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)
onEntityCollision
in class AbstractBlock
private void tryPowerWithProjectiles(BlockState state, World world, BlockPos pos)
private void updateNeighbors(BlockState state, World world, BlockPos pos)
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block