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.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 Map<Direction,EnumProperty<WireConnection>>DIRECTION_TO_WIRE_CONNECTION_PROPERTYprivate static VoxelShapeDOT_SHAPEprivate BlockStatedotStateprivate static Map<Direction,VoxelShape>field_24414private static Map<Direction,VoxelShape>field_24415private Map<BlockState,VoxelShape>field_24416private static Vector3f[]field_24466static IntPropertyPOWERstatic EnumProperty<WireConnection>WIRE_CONNECTION_EASTstatic EnumProperty<WireConnection>WIRE_CONNECTION_NORTHstatic EnumProperty<WireConnection>WIRE_CONNECTION_SOUTHstatic EnumProperty<WireConnection>WIRE_CONNECTION_WESTprivate booleanwiresGivePowerFields 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 RedstoneWireBlock(AbstractBlock.Settings settings) -
Method Summary
Modifier and Type Method Description protected voidappendProperties(StateManager.Builder<Block,BlockState> builder)booleancanPlaceAt(BlockState state, WorldView world, BlockPos pos)private booleancanRunOnTop(BlockView world, BlockPos pos, BlockState floor)protected static booleanconnectsTo(BlockState state)protected static booleanconnectsTo(BlockState state, Direction dir)booleanemitsRedstonePower(BlockState state)VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)BlockStategetPlacementState(ItemPlacementContext ctx)private intgetReceivedRedstonePower(World world, BlockPos pos)private WireConnectiongetRenderConnectionType(BlockView blockView, BlockPos blockPos, Direction direction)BlockStategetStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)intgetStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)intgetWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)static intgetWireColor(int powerLevel)private intincreasePower(BlockState state)private static booleanisFullyConnected(BlockState state)private static booleanisNotConnected(BlockState state)private BlockStatemethod_27840(BlockView world, BlockState state, BlockPos pos)private WireConnectionmethod_27841(BlockView blockView, BlockPos blockPos, Direction direction, boolean bool)private BlockStatemethod_27843(BlockView world, BlockState state, BlockPos pos)private voidmethod_27844(World world, BlockPos pos)private VoxelShapemethod_27845(BlockState state)private voidmethod_27936(World world, Random random, BlockPos pos, Vector3f vector3f, Direction direction, Direction direction2, float float2, float float3)private voidmethod_28482(World world, BlockPos pos, BlockState blockState, BlockState blockState2)BlockStatemirror(BlockState state, BlockMirror mirror)voidneighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)voidonStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate.ActionResultonUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player.voidprepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)voidrandomDisplayTick(BlockState state, World world, BlockPos pos, Random random)BlockStaterotate(BlockState state, BlockRotation rotation)Applies a block rotation to a block state.private voidupdate(World world, BlockPos pos, BlockState state)private voidupdateNeighbors(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, toStringMethods 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:
getOutlineShapein classAbstractBlock
-
getPlacementState
- Overrides:
getPlacementStatein classBlock
-
method_27840
-
method_27843
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)- Overrides:
getStateForNeighborUpdatein classAbstractBlock
-
isFullyConnected
-
isNotConnected
-
prepare
public void prepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)- Overrides:
preparein 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:
canPlaceAtin classAbstractBlock
-
canRunOnTop
-
update
-
getReceivedRedstonePower
-
increasePower
-
updateNeighbors
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAddedin classAbstractBlock
-
onStateReplaced
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate. Vanilla blocks perform removal cleanups here.- Overrides:
onStateReplacedin classAbstractBlock
-
method_27844
-
neighborUpdate
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)- Overrides:
neighborUpdatein classAbstractBlock
-
getStrongRedstonePower
public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getStrongRedstonePowerin classAbstractBlock
-
getWeakRedstonePower
public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)- Overrides:
getWeakRedstonePowerin classAbstractBlock
-
connectsTo
-
connectsTo
-
emitsRedstonePower
- Overrides:
emitsRedstonePowerin 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:
randomDisplayTickin classBlock
-
rotate
Applies a block rotation to a block state.By default, this returns the provided block state.
- Overrides:
rotatein classAbstractBlock- Returns:
- the rotated block state
-
mirror
- Overrides:
mirrorin classAbstractBlock
-
appendProperties
- Overrides:
appendPropertiesin 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:
onUsein 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)
-