public class NoteBlock extends Block
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
static EnumProperty<Instrument> |
INSTRUMENT |
static IntProperty |
NOTE |
static BooleanProperty |
POWERED |
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
NoteBlock(AbstractBlock.Settings settings) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendProperties(StateManager.Builder<Block,BlockState> builder) |
BlockState |
getPlacementState(ItemPlacementContext ctx) |
BlockState |
getStateForNeighborUpdate(BlockState state,
Direction direction,
BlockState newState,
WorldAccess world,
BlockPos pos,
BlockPos posFrom) |
void |
neighborUpdate(BlockState state,
World world,
BlockPos pos,
Block block,
BlockPos fromPos,
boolean notify) |
void |
onBlockBreakStart(BlockState state,
World world,
BlockPos pos,
PlayerEntity player) |
boolean |
onSyncedBlockEvent(BlockState state,
World world,
BlockPos pos,
int type,
int data) |
ActionResult |
onUse(BlockState state,
World world,
BlockPos pos,
PlayerEntity player,
Hand hand,
BlockHitResult hit)
Called when this block is used by a player.
|
private void |
playNote(World world,
BlockPos pos) |
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, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getOutlineShape, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, onBlockAdded, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, prepare, randomTick, rotate, scheduledTick
public static final EnumProperty<Instrument> INSTRUMENT
public static final BooleanProperty POWERED
public static final IntProperty NOTE
public NoteBlock(AbstractBlock.Settings settings)
public BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState
in class Block
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate
in class AbstractBlock
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
neighborUpdate
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 onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player)
onBlockBreakStart
in class AbstractBlock
public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)
onSyncedBlockEvent
in class AbstractBlock
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block