Package net.minecraft.block
Class CandleBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.AbstractCandleBlock
net.minecraft.block.CandleBlock
- All Implemented Interfaces:
FluidDrainable
,FluidFillable
,Waterloggable
,ItemConvertible
public class CandleBlock extends AbstractCandleBlock implements Waterloggable
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroup
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Fields Modifier and Type Field Description static IntProperty
CANDLES
private static Int2ObjectMap<List<Vec3d>>
CANDLES_TO_PARTICLE_OFFSETS
private static VoxelShape
FOUR_CANDLES_SHAPE
static BooleanProperty
LIT
private static VoxelShape
ONE_CANDLE_SHAPE
static ToIntFunction<BlockState>
STATE_TO_LUMINANCE
private static VoxelShape
THREE_CANDLES_SHAPE
private static VoxelShape
TWO_CANDLES_SHAPE
static BooleanProperty
WATERLOGGED
Fields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
-
Constructor Summary
Constructors Constructor Description CandleBlock(AbstractBlock.Settings settings)
-
Method Summary
Modifier and Type Method Description protected void
appendProperties(StateManager.Builder<Block,BlockState> builder)
static boolean
canBeLit(BlockState state)
boolean
canPlaceAt(BlockState state, WorldView world, BlockPos pos)
boolean
canReplace(BlockState state, ItemPlacementContext context)
FluidState
getFluidState(BlockState state)
VoxelShape
getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
protected Iterable<Vec3d>
getParticleOffsets(BlockState state)
BlockState
getPlacementState(ItemPlacementContext ctx)
BlockState
getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
ActionResult
onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
Called when this block is used by a player.boolean
tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState)
Methods inherited from class net.minecraft.block.AbstractCandleBlock
extinguish, onProjectileHit, randomDisplayTick
Methods inherited from class net.minecraft.block.Block
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, isFaceFullSquare, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, rotate, scheduledTick
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.block.Waterloggable
canFillWithFluid, getDrainSound, tryDrainFluid
-
Field Details
-
CANDLES
-
LIT
-
WATERLOGGED
-
STATE_TO_LUMINANCE
-
CANDLES_TO_PARTICLE_OFFSETS
-
ONE_CANDLE_SHAPE
-
TWO_CANDLES_SHAPE
-
THREE_CANDLES_SHAPE
-
FOUR_CANDLES_SHAPE
-
-
Constructor Details
-
CandleBlock
-
-
Method Details
-
onUse
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player. This, by default, is bound to using the right mouse button.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.
- Overrides:
onUse
in classAbstractBlock
- Returns:
- an action result that specifies if using the block was successful.
-
canReplace
- Overrides:
canReplace
in classAbstractBlock
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)- Overrides:
getStateForNeighborUpdate
in classAbstractBlock
-
getFluidState
- Overrides:
getFluidState
in classAbstractBlock
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShape
in classAbstractBlock
-
appendProperties
- Overrides:
appendProperties
in classBlock
-
tryFillWithFluid
public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState)- Specified by:
tryFillWithFluid
in interfaceFluidFillable
- Specified by:
tryFillWithFluid
in interfaceWaterloggable
-
canBeLit
-
getParticleOffsets
- Specified by:
getParticleOffsets
in classAbstractCandleBlock
-
canPlaceAt
- Overrides:
canPlaceAt
in classAbstractBlock
-