public class BeehiveBlock extends BlockWithEntity
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
static DirectionProperty |
FACING |
private static Direction[] |
GENERATE_DIRECTIONS |
static IntProperty |
HONEY_LEVEL |
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
BeehiveBlock(AbstractBlock.Settings settings) |
createScreenHandlerFactory, onSyncedBlockEvent
addStacksForDisplay, 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, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getCullingShape, getDefaultMaterialColor, getFluidState, getLootTableId, getOffsetType, getOpacity, getOutlineShape, getPistonBehavior, getRaycastShape, getRenderingSeed, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, prepare, randomTick, rotate, scheduledTick
private static final Direction[] GENERATE_DIRECTIONS
public static final DirectionProperty FACING
public static final IntProperty HONEY_LEVEL
public BeehiveBlock(AbstractBlock.Settings settings)
public boolean hasComparatorOutput(BlockState state)
hasComparatorOutput
in class AbstractBlock
public int getComparatorOutput(BlockState state, World world, BlockPos pos)
getComparatorOutput
in class AbstractBlock
public void afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack)
afterBreak
in class Block
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 takeHoney(World world, BlockState state, BlockPos pos, @Nullable PlayerEntity player, BeehiveBlockEntity.BeeState beeState)
public void takeHoney(World world, BlockState state, BlockPos pos)
@Environment(value=CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)
randomDisplayTick
in class Block
@Environment(value=CLIENT) private void spawnHoneyParticles(World world, BlockPos pos, BlockState state)
@Environment(value=CLIENT) private void addHoneyParticle(World world, BlockPos pos, VoxelShape shape, double height)
@Environment(value=CLIENT) private void addHoneyParticle(World world, double minX, double maxX, double minZ, double maxZ, double height)
public BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState
in class Block
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public BlockRenderType getRenderType(BlockState state)
getRenderType
in class BlockWithEntity
@Nullable public BlockEntity createBlockEntity(BlockView world)
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player)
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder)
getDroppedStacks
in class AbstractBlock
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate
in class AbstractBlock