Package net.minecraft.block
Class DaylightDetectorBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.BlockWithEntity
net.minecraft.block.DaylightDetectorBlock
- All Implemented Interfaces:
BlockEntityProvider,ItemConvertible
public class DaylightDetectorBlock extends BlockWithEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroupNested 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 BooleanPropertyINVERTEDstatic IntPropertyPOWERprotected static VoxelShapeSHAPEFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier -
Constructor Summary
Constructors Constructor Description DaylightDetectorBlock(AbstractBlock.Settings settings) -
Method Summary
Modifier and Type Method Description protected voidappendProperties(StateManager.Builder<Block,BlockState> builder)BlockEntitycreateBlockEntity(BlockPos pos, BlockState state)booleanemitsRedstonePower(BlockState state)VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)BlockRenderTypegetRenderType(BlockState state)<T extends BlockEntity>
BlockEntityTicker<T>getTicker(World world, BlockState state, BlockEntityType<T> type)intgetWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)booleanhasSidedTransparency(BlockState state)ActionResultonUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player.private static voidtick(World world, BlockPos pos, BlockState state, DaylightDetectorBlockEntity blockEntity)private static voidupdateState(BlockState state, World world, BlockPos pos)Methods inherited from class net.minecraft.block.BlockWithEntity
checkType, createScreenHandlerFactory, onSyncedBlockEventMethods 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, getPlacementState, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, hasComparatorOutput, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, prepare, randomTick, rotate, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.block.BlockEntityProvider
getGameEventListener
-
Field Details
-
POWER
-
INVERTED
-
SHAPE
-
-
Constructor Details
-
DaylightDetectorBlock
-
-
Method Details
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShapein classAbstractBlock
-
hasSidedTransparency
- Overrides:
hasSidedTransparencyin classAbstractBlock
-
getWeakRedstonePower
public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getWeakRedstonePowerin classAbstractBlock
-
updateState
-
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:
onUsein classAbstractBlock- Returns:
- an action result that specifies if using the block was successful.
-
getRenderType
- Overrides:
getRenderTypein classBlockWithEntity
-
emitsRedstonePower
- Overrides:
emitsRedstonePowerin classAbstractBlock
-
createBlockEntity
-
getTicker
@Nullable public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) -
tick
private static void tick(World world, BlockPos pos, BlockState state, DaylightDetectorBlockEntity blockEntity) -
appendProperties
- Overrides:
appendPropertiesin classBlock
-