public class CampfireBlock extends BlockWithEntity implements Waterloggable
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
private boolean |
emitsParticles |
static DirectionProperty |
FACING |
private int |
fireDamage |
static BooleanProperty |
LIT |
protected static VoxelShape |
SHAPE |
static BooleanProperty |
SIGNAL_FIRE |
private static VoxelShape |
SMOKEY_SHAPE
The shape used to test whether a given block is considered 'smokey'.
|
static BooleanProperty |
WATERLOGGED |
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
CampfireBlock(boolean emitsParticles,
int fireDamage,
AbstractBlock.Settings settings) |
createScreenHandlerFactory, onSyncedBlockEvent
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, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onStacksDropped, prepare, randomTick, scheduledTick
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canFillWithFluid, tryDrainFluid
protected static final VoxelShape SHAPE
public static final BooleanProperty LIT
public static final BooleanProperty SIGNAL_FIRE
public static final BooleanProperty WATERLOGGED
public static final DirectionProperty FACING
private static final VoxelShape SMOKEY_SHAPE
private final boolean emitsParticles
private final int fireDamage
public CampfireBlock(boolean emitsParticles, int fireDamage, AbstractBlock.Settings settings)
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 onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)
onEntityCollision
in class AbstractBlock
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
@Nullable 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
private boolean doesBlockCauseSignalFire(BlockState state)
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape
in class AbstractBlock
public BlockRenderType getRenderType(BlockState state)
getRenderType
in class BlockWithEntity
@Environment(value=CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)
randomDisplayTick
in class Block
public static void extinguish(WorldAccess world, BlockPos pos, BlockState state)
public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState)
tryFillWithFluid
in interface FluidFillable
tryFillWithFluid
in interface Waterloggable
public void onProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile)
onProjectileHit
in class AbstractBlock
public static void spawnSmokeParticle(World world, BlockPos pos, boolean isSignal, boolean lotsOfSmoke)
public static boolean isLitCampfire(BlockState state)
public FluidState getFluidState(BlockState state)
getFluidState
in class AbstractBlock
public BlockState rotate(BlockState state, BlockRotation rotation)
By default, this returns the provided block state.
rotate
in class AbstractBlock
public BlockState mirror(BlockState state, BlockMirror mirror)
mirror
in class AbstractBlock
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public BlockEntity createBlockEntity(BlockView world)
createBlockEntity
in interface BlockEntityProvider
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough
in class AbstractBlock
public static boolean method_30035(BlockState blockState)