Package net.minecraft.world.level.block
Class DiodeBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.HorizontalDirectionalBlock
net.minecraft.world.level.block.DiodeBlock
- All Implemented Interfaces:
FeatureElement,ItemLike,IBlockExtension
- Direct Known Subclasses:
ComparatorBlock,RepeaterBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKeyNested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate -
Field Summary
FieldsFields inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlock
FACINGFields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, CODEC, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanSurvive(BlockState state, LevelReader level, BlockPos pos) protected booleancanSurviveOn(LevelReader level, BlockPos pos, BlockState state) protected voidcheckTickOnNeighbor(Level level, BlockPos pos, BlockState state) Check the output signal of this diode and schedule a new block tick if it should change.protected abstract com.mojang.serialization.MapCodec<? extends DiodeBlock> codec()protected intgetAlternateSignal(SignalGetter level, BlockPos pos, BlockState state) protected abstract intgetDelay(BlockState state) protected intgetDirectSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the direct signal this block emits in the given direction.protected intgetInputSignal(Level level, BlockPos pos, BlockState state) protected intgetOutputSignal(BlockGetter level, BlockPos pos, BlockState state) protected VoxelShapegetShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) protected intgetSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the signal this block emits in the given direction.getStateForPlacement(BlockPlaceContext context) static booleanisDiode(BlockState state) booleanisLocked(LevelReader level, BlockPos pos, BlockState state) Check if neighboring blocks are locking this diode.protected booleanisSignalSource(BlockState state) Returns whether this block is capable of emitting redstone signals.protected voidneighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) protected voidonPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) protected voidonRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) voidsetPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) Called by BlockItem after this block has been placed.booleanshouldPrioritize(BlockGetter level, BlockPos pos, BlockState state) Check if this diode should have a higher tick priority than default.protected booleanshouldTurnOn(Level level, BlockPos pos, BlockState state) protected booleanprotected voidtick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) protected voidupdateNeighborsInFront(Level level, BlockPos pos, BlockState state) Methods inherited from class net.minecraft.world.level.block.HorizontalDirectionalBlock
mirror, rotateMethods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, createBlockStateDefinition, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isRandomlyTicking, onExplosionHit, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, updateShape, useItemOn, useShapeForLightOcclusion, useWithoutItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
SHAPE
-
POWERED
-
-
Constructor Details
-
DiodeBlock
-
-
Method Details
-
codec
- Specified by:
codecin classHorizontalDirectionalBlock
-
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) - Overrides:
getShapein classBlockBehaviour
-
canSurvive
- Overrides:
canSurvivein classBlockBehaviour
-
canSurviveOn
-
tick
- Overrides:
tickin classBlockBehaviour
-
getDirectSignal
protected int getDirectSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the direct signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getDirectSignalin classBlockBehaviour
-
getSignal
protected int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getSignalin classBlockBehaviour
-
neighborChanged
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) - Overrides:
neighborChangedin classBlockBehaviour
-
checkTickOnNeighbor
Check the output signal of this diode and schedule a new block tick if it should change. -
isLocked
Check if neighboring blocks are locking this diode. -
shouldTurnOn
-
getInputSignal
-
getAlternateSignal
-
isSignalSource
Returns whether this block is capable of emitting redstone signals.- Overrides:
isSignalSourcein classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacementin classBlock
-
setPlacedBy
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) Called by BlockItem after this block has been placed.- Overrides:
setPlacedByin classBlock
-
onPlace
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) - Overrides:
onPlacein classBlockBehaviour
-
onRemove
protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) - Overrides:
onRemovein classBlockBehaviour
-
updateNeighborsInFront
-
sideInputDiodesOnly
protected boolean sideInputDiodesOnly() -
getOutputSignal
-
isDiode
-
shouldPrioritize
Check if this diode should have a higher tick priority than default.Both repeaters and comparators use this method to increase their tick priorities when facing other diodes. This makes certain monostable circuits based on the repeater locking mechanic more reliable.
-
getDelay
-