Package net.minecraft.world.level.block
Class RedStoneWireBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.RedStoneWireBlock
- All Implemented Interfaces:
FeatureElement,ItemLike,IBlockExtension
-
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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RedStoneWireBlock> private static final Vec3[]private final BlockStateprotected static final intstatic final EnumProperty<RedstoneSide> protected static final intprotected static final intstatic final EnumProperty<RedstoneSide> private static final floatstatic final IntegerPropertystatic final Map<Direction, EnumProperty<RedstoneSide>> protected static final intprivate static final VoxelShapeprivate static final Map<BlockState, VoxelShape> private static final Map<Direction, VoxelShape> private static final Map<Direction, VoxelShape> private booleanstatic final EnumProperty<RedstoneSide> protected static final intstatic final EnumProperty<RedstoneSide> Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, 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 TypeMethodDescriptionvoidanimateTick(BlockState pState, Level pLevel, BlockPos pPos, RandomSource pRandom) Called periodically clientside on blocks near the player to show effects (like furnace fire particles).private VoxelShapecalculateShape(BlockState pState) private intcalculateTargetStrength(Level pLevel, BlockPos pPos) protected booleancanSurvive(BlockState pState, LevelReader pLevel, BlockPos pPos) private booleancanSurviveOn(BlockGetter pLevel, BlockPos pPos, BlockState pState) private voidcheckCornerChangeAt(Level pLevel, BlockPos pPos) CallsLevel.updateNeighborsAt(net.minecraft.core.BlockPos, net.minecraft.world.level.block.Block)for all neighboring blocks, but only if the given block is a redstone wire.com.mojang.serialization.MapCodec<RedStoneWireBlock> codec()protected voidstatic intgetColorForPower(int pPower) private RedstoneSidegetConnectingSide(BlockGetter pLevel, BlockPos pPos, Direction pFace) private RedstoneSidegetConnectingSide(BlockGetter pLevel, BlockPos pPos, Direction pDirection, boolean pNonNormalCubeAbove) private BlockStategetConnectionState(BlockGetter pLevel, BlockState pState, BlockPos pPos) protected intgetDirectSignal(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) Returns the direct signal this block emits in the given direction.private BlockStategetMissingConnections(BlockGetter pLevel, BlockState pState, BlockPos pPos) protected VoxelShapegetShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) protected intgetSignal(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) Returns the signal this block emits in the given direction.getStateForPlacement(BlockPlaceContext pContext) private intgetWireSignal(BlockState pState) private static booleanisCross(BlockState pState) private static booleanisDot(BlockState pState) protected booleanisSignalSource(BlockState pState) Returns whether this block is capable of emitting redstone signals.protected BlockStatemirror(BlockState pState, Mirror pMirror) Returns the blockstate with the given mirror of the passed blockstate.protected voidneighborChanged(BlockState pState, Level pLevel, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) protected voidonPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) protected voidonRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) protected BlockStaterotate(BlockState pState, Rotation pRotation) Returns the blockstate with the given rotation from the passed blockstate.protected static booleanshouldConnectTo(BlockState pState) protected static booleanshouldConnectTo(BlockState pState, Direction pDirection) private voidspawnParticlesAlongLine(Level pLevel, RandomSource pRandom, BlockPos pPos, Vec3 pParticleVec, Direction pXDirection, Direction pZDirection, float pMin, float pMax) protected voidupdateIndirectNeighbourShapes(BlockState pState, LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) Updates the shapes of indirect neighbors of this block.private voidupdateNeighborsOfNeighboringWires(Level pLevel, BlockPos pPos) private voidupdatePowerStrength(Level pLevel, BlockPos pPos, BlockState pState) protected BlockStateupdateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel, BlockPos pCurrentPos, BlockPos pFacingPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state.private voidupdatesOnShapeChange(Level pLevel, BlockPos pPos, BlockState pOldState, BlockState pNewState) protected InteractionResultuseWithoutItem(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, BlockHitResult pHitResult) Methods inherited from class net.minecraft.world.level.block.Block
appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, 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, setPlacedBy, 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, tick, triggerEvent, useItemOn, useShapeForLightOcclusionMethods 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
-
CODEC
-
NORTH
-
EAST
-
SOUTH
-
WEST
-
POWER
-
PROPERTY_BY_DIRECTION
-
H
protected static final int H- See Also:
-
W
protected static final int W- See Also:
-
E
protected static final int E- See Also:
-
N
protected static final int N- See Also:
-
S
protected static final int S- See Also:
-
SHAPE_DOT
-
SHAPES_FLOOR
-
SHAPES_UP
-
SHAPES_CACHE
-
COLORS
-
PARTICLE_DENSITY
private static final float PARTICLE_DENSITY- See Also:
-
crossState
-
shouldSignal
private boolean shouldSignal
-
-
Constructor Details
-
RedStoneWireBlock
-
-
Method Details
-
codec
-
calculateShape
-
getShape
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) - Overrides:
getShapein classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacementin classBlock
-
getConnectionState
-
getMissingConnections
-
updateShape
protected BlockState updateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel, BlockPos pCurrentPos, BlockPos pFacingPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific direction passed in.- Overrides:
updateShapein classBlockBehaviour
-
isCross
-
isDot
-
updateIndirectNeighbourShapes
protected void updateIndirectNeighbourShapes(BlockState pState, LevelAccessor pLevel, BlockPos pPos, int pFlags, int pRecursionLeft) Updates the shapes of indirect neighbors of this block. This method is analogous tobut where that method affects the 6 direct neighbors of this block, this method affects the indirect neighbors, if any.invalid reference
net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase#updateNeighbourShapesCurrently the only implementation of this method is
updateIndirectNeighbourShapes(net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.LevelAccessor, net.minecraft.core.BlockPos, int, int)where it is used to validate diagonal connections of redstone wire blocks.- Overrides:
updateIndirectNeighbourShapesin classBlockBehaviour
-
getConnectingSide
-
getConnectingSide
private RedstoneSide getConnectingSide(BlockGetter pLevel, BlockPos pPos, Direction pDirection, boolean pNonNormalCubeAbove) -
canSurvive
- Overrides:
canSurvivein classBlockBehaviour
-
canSurviveOn
-
updatePowerStrength
-
calculateTargetStrength
-
getWireSignal
-
checkCornerChangeAt
CallsLevel.updateNeighborsAt(net.minecraft.core.BlockPos, net.minecraft.world.level.block.Block)for all neighboring blocks, but only if the given block is a redstone wire. -
onPlace
protected void onPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) - Overrides:
onPlacein classBlockBehaviour
-
onRemove
protected void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) - Overrides:
onRemovein classBlockBehaviour
-
updateNeighborsOfNeighboringWires
-
neighborChanged
protected void neighborChanged(BlockState pState, Level pLevel, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) - Overrides:
neighborChangedin classBlockBehaviour
-
getDirectSignal
protected int getDirectSignal(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) 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 pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide) 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
-
shouldConnectTo
-
shouldConnectTo
-
isSignalSource
Returns whether this block is capable of emitting redstone signals.- Overrides:
isSignalSourcein classBlockBehaviour
-
getColorForPower
public static int getColorForPower(int pPower) -
spawnParticlesAlongLine
-
animateTick
Called periodically clientside on blocks near the player to show effects (like furnace fire particles).- Overrides:
animateTickin classBlock
-
rotate
Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
rotatein classBlockBehaviour
-
mirror
Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
mirrorin classBlockBehaviour
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinitionin classBlock
-
useWithoutItem
protected InteractionResult useWithoutItem(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, BlockHitResult pHitResult) - Overrides:
useWithoutItemin classBlockBehaviour
-
updatesOnShapeChange
private void updatesOnShapeChange(Level pLevel, BlockPos pPos, BlockState pOldState, BlockState pNewState)
-