Modifier and Type | Class and Description |
---|---|
static class |
AbstractBlock.AbstractBlockState |
static interface |
AbstractBlock.ContextPredicate |
static class |
AbstractBlock.OffsetType |
static class |
AbstractBlock.Settings |
static interface |
AbstractBlock.TypedContextPredicate<A> |
Modifier and Type | Field and Description |
---|---|
protected boolean |
collidable |
protected boolean |
dynamicBounds |
protected static Direction[] |
FACINGS |
protected float |
jumpVelocityMultiplier |
protected Identifier |
lootTableId |
protected Material |
material |
protected boolean |
randomTicks |
protected float |
resistance |
protected AbstractBlock.Settings |
settings |
protected float |
slipperiness |
protected BlockSoundGroup |
soundGroup |
protected float |
velocityMultiplier |
Constructor and Description |
---|
AbstractBlock(AbstractBlock.Settings settings) |
protected static final Direction[] FACINGS
protected final Material material
protected final boolean collidable
protected final float resistance
protected final boolean randomTicks
protected final BlockSoundGroup soundGroup
protected final float slipperiness
protected final float velocityMultiplier
protected final float jumpVelocityMultiplier
protected final boolean dynamicBounds
protected final AbstractBlock.Settings settings
@Nullable protected Identifier lootTableId
public AbstractBlock(AbstractBlock.Settings settings)
@Deprecated public void prepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)
@Deprecated public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
@Deprecated public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
@Environment(value=CLIENT) @Deprecated public boolean isSideInvisible(BlockState state, BlockState stateFrom, Direction direction)
@Deprecated public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
@Deprecated public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
@Deprecated 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.@Deprecated 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.
@Deprecated public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data)
@Deprecated public BlockRenderType getRenderType(BlockState state)
@Deprecated public boolean hasSidedTransparency(BlockState state)
@Deprecated public boolean emitsRedstonePower(BlockState state)
@Deprecated public PistonBehavior getPistonBehavior(BlockState state)
@Deprecated public FluidState getFluidState(BlockState state)
@Deprecated public boolean hasComparatorOutput(BlockState state)
public AbstractBlock.OffsetType getOffsetType()
@Deprecated public BlockState rotate(BlockState state, BlockRotation rotation)
By default, this returns the provided block state.
@Deprecated public BlockState mirror(BlockState state, BlockMirror mirror)
@Deprecated public boolean canReplace(BlockState state, ItemPlacementContext context)
@Deprecated public boolean canBucketPlace(BlockState state, Fluid fluid)
@Deprecated public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder)
@Environment(value=CLIENT) @Deprecated public long getRenderingSeed(BlockState state, BlockPos pos)
@Deprecated public VoxelShape getCullingShape(BlockState state, BlockView world, BlockPos pos)
@Deprecated public VoxelShape getSidesShape(BlockState state, BlockView world, BlockPos pos)
@Deprecated public VoxelShape getRaycastShape(BlockState state, BlockView world, BlockPos pos)
@Deprecated public int getOpacity(BlockState state, BlockView world, BlockPos pos)
@Nullable @Deprecated public NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos)
@Deprecated public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos)
@Environment(value=CLIENT) @Deprecated public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos)
@Deprecated public int getComparatorOutput(BlockState state, World world, BlockPos pos)
@Deprecated public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
@Deprecated public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
@Deprecated public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
@Deprecated public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
@Deprecated public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
@Deprecated public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos)
@Deprecated public void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack)
@Deprecated public void onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player)
@Deprecated public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
@Deprecated public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)
@Deprecated public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
public final boolean hasBlockEntity()
public final Identifier getLootTableId()
@Deprecated public void onProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile)
public abstract Item asItem()
protected abstract Block asBlock()
public MaterialColor getDefaultMaterialColor()