public class SweetBerryBushBlock extends PlantBlock implements Fertilizable
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
static IntProperty |
AGE |
private static VoxelShape |
LARGE_SHAPE |
private static VoxelShape |
SMALL_SHAPE |
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
SweetBerryBushBlock(AbstractBlock.Settings settings) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendProperties(StateManager.Builder<Block,BlockState> builder) |
boolean |
canGrow(World world,
Random random,
BlockPos pos,
BlockState state) |
VoxelShape |
getOutlineShape(BlockState state,
BlockView world,
BlockPos pos,
ShapeContext context) |
ItemStack |
getPickStack(BlockView world,
BlockPos pos,
BlockState state) |
void |
grow(ServerWorld world,
Random random,
BlockPos pos,
BlockState state) |
boolean |
hasRandomTicks(BlockState state) |
boolean |
isFertilizable(BlockView world,
BlockPos pos,
BlockState state,
boolean isClient) |
void |
onEntityCollision(BlockState state,
World world,
BlockPos pos,
Entity entity) |
ActionResult |
onUse(BlockState state,
World world,
BlockPos pos,
PlayerEntity player,
Hand hand,
BlockHitResult hit)
Called when this block is used by a player.
|
void |
randomTick(BlockState state,
ServerWorld world,
BlockPos pos,
Random random) |
canPathfindThrough, canPlaceAt, canPlantOnTop, getStateForNeighborUpdate, isTranslucent
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPlacementState, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
calcBlockBreakingDelta, canBucketPlace, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, rotate, scheduledTick
public static final IntProperty AGE
private static final VoxelShape SMALL_SHAPE
private static final VoxelShape LARGE_SHAPE
public SweetBerryBushBlock(AbstractBlock.Settings settings)
@Environment(value=CLIENT) public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state)
getPickStack
in class Block
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape
in class AbstractBlock
public boolean hasRandomTicks(BlockState state)
hasRandomTicks
in class Block
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
randomTick
in class AbstractBlock
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)
onEntityCollision
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
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient)
isFertilizable
in interface Fertilizable
public boolean canGrow(World world, Random random, BlockPos pos, BlockState state)
canGrow
in interface Fertilizable
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state)
grow
in interface Fertilizable