Package net.minecraft.block
Class RedstoneWireBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.RedstoneWireBlock
- All Implemented Interfaces:
ItemConvertible
public class RedstoneWireBlock extends Block
-
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 Map<Direction,EnumProperty<WireConnection>>
DIRECTION_TO_WIRE_CONNECTION_PROPERTY
private static VoxelShape
DOT_SHAPE
private BlockState
dotState
private static Map<Direction,VoxelShape>
field_24414
private static Map<Direction,VoxelShape>
field_24415
private Map<BlockState,VoxelShape>
field_24416
private static Vector3f[]
field_24466
static IntProperty
POWER
static EnumProperty<WireConnection>
WIRE_CONNECTION_EAST
static EnumProperty<WireConnection>
WIRE_CONNECTION_NORTH
static EnumProperty<WireConnection>
WIRE_CONNECTION_SOUTH
static EnumProperty<WireConnection>
WIRE_CONNECTION_WEST
private boolean
wiresGivePower
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 RedstoneWireBlock(AbstractBlock.Settings settings)
-
Method Summary
Modifier and Type Method Description protected void
appendProperties(StateManager.Builder<Block,BlockState> builder)
boolean
canPlaceAt(BlockState state, WorldView world, BlockPos pos)
private boolean
canRunOnTop(BlockView world, BlockPos pos, BlockState floor)
protected static boolean
connectsTo(BlockState state)
protected static boolean
connectsTo(BlockState state, Direction dir)
boolean
emitsRedstonePower(BlockState state)
VoxelShape
getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
BlockState
getPlacementState(ItemPlacementContext ctx)
private int
getReceivedRedstonePower(World world, BlockPos pos)
private WireConnection
getRenderConnectionType(BlockView blockView, BlockPos blockPos, Direction direction)
BlockState
getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
int
getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
int
getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
static int
getWireColor(int powerLevel)
private int
increasePower(BlockState state)
private static boolean
isFullyConnected(BlockState state)
private static boolean
isNotConnected(BlockState state)
private BlockState
method_27840(BlockView world, BlockState state, BlockPos pos)
private WireConnection
method_27841(BlockView blockView, BlockPos blockPos, Direction direction, boolean bool)
private BlockState
method_27843(BlockView world, BlockState state, BlockPos pos)
private void
method_27844(World world, BlockPos pos)
private VoxelShape
method_27845(BlockState state)
private void
method_27936(World world, Random random, BlockPos pos, Vector3f vector3f, Direction direction, Direction direction2, float float2, float float3)
private void
method_28482(World world, BlockPos pos, BlockState blockState, BlockState blockState2)
BlockState
mirror(BlockState state, BlockMirror mirror)
void
neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
void
onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
void
onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)
Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)
ifnewState
is different fromstate
.ActionResult
onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
Called when this block is used by a player.void
prepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)
void
randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)
BlockState
rotate(BlockState state, BlockRotation rotation)
Applies a block rotation to a block state.private void
update(World world, BlockPos pos, BlockState state)
private void
updateNeighbors(World world, BlockPos pos)
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, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createScreenHandlerFactory, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getVisualShape, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onSyncedBlockEvent, randomTick, scheduledTick
-
Field Details
-
WIRE_CONNECTION_NORTH
-
WIRE_CONNECTION_EAST
-
WIRE_CONNECTION_SOUTH
-
WIRE_CONNECTION_WEST
-
POWER
-
DIRECTION_TO_WIRE_CONNECTION_PROPERTY
public static final Map<Direction,EnumProperty<WireConnection>> DIRECTION_TO_WIRE_CONNECTION_PROPERTY -
DOT_SHAPE
-
field_24414
-
field_24415
-
field_24466
-
field_24416
-
dotState
-
wiresGivePower
private boolean wiresGivePower
-
-
Constructor Details
-
RedstoneWireBlock
-
-
Method Details
-
method_27845
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShape
in classAbstractBlock
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
-
method_27840
-
method_27843
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)- Overrides:
getStateForNeighborUpdate
in classAbstractBlock
-
isFullyConnected
-
isNotConnected
-
prepare
public void prepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)- Overrides:
prepare
in classAbstractBlock
-
getRenderConnectionType
private WireConnection getRenderConnectionType(BlockView blockView, BlockPos blockPos, Direction direction) -
method_27841
private WireConnection method_27841(BlockView blockView, BlockPos blockPos, Direction direction, boolean bool) -
canPlaceAt
- Overrides:
canPlaceAt
in classAbstractBlock
-
canRunOnTop
-
update
-
getReceivedRedstonePower
-
increasePower
-
updateNeighbors
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAdded
in classAbstractBlock
-
onStateReplaced
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)
ifnewState
is different fromstate
. Vanilla blocks perform removal cleanups here.- Overrides:
onStateReplaced
in classAbstractBlock
-
method_27844
-
neighborUpdate
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)- Overrides:
neighborUpdate
in classAbstractBlock
-
getStrongRedstonePower
public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getStrongRedstonePower
in classAbstractBlock
-
getWeakRedstonePower
public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getWeakRedstonePower
in classAbstractBlock
-
connectsTo
-
connectsTo
-
emitsRedstonePower
- Overrides:
emitsRedstonePower
in classAbstractBlock
-
getWireColor
@Environment(CLIENT) public static int getWireColor(int powerLevel) -
method_27936
-
randomDisplayTick
@Environment(CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)- Overrides:
randomDisplayTick
in classBlock
-
rotate
Applies a block rotation to a block state.By default, this returns the provided block state.
- Overrides:
rotate
in classAbstractBlock
- Returns:
- the rotated block state
-
mirror
- Overrides:
mirror
in classAbstractBlock
-
appendProperties
- Overrides:
appendProperties
in classBlock
-
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.
-
method_28482
private void method_28482(World world, BlockPos pos, BlockState blockState, BlockState blockState2)
-