public class RedstoneWireBlock extends Block
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and 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 |
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
RedstoneWireBlock(AbstractBlock.Settings settings) |
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
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
public static final EnumProperty<WireConnection> WIRE_CONNECTION_NORTH
public static final EnumProperty<WireConnection> WIRE_CONNECTION_EAST
public static final EnumProperty<WireConnection> WIRE_CONNECTION_SOUTH
public static final EnumProperty<WireConnection> WIRE_CONNECTION_WEST
public static final IntProperty POWER
public static final Map<Direction,EnumProperty<WireConnection>> DIRECTION_TO_WIRE_CONNECTION_PROPERTY
private static final VoxelShape DOT_SHAPE
private static final Map<Direction,VoxelShape> field_24414
private static final Map<Direction,VoxelShape> field_24415
private static final Vector3f[] field_24466
private final Map<BlockState,VoxelShape> field_24416
private final BlockState dotState
private boolean wiresGivePower
public RedstoneWireBlock(AbstractBlock.Settings settings)
private VoxelShape method_27845(BlockState state)
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getOutlineShape
in class AbstractBlock
public BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState
in class Block
private BlockState method_27840(BlockView world, BlockState state, BlockPos pos)
private BlockState method_27843(BlockView world, BlockState state, BlockPos pos)
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate
in class AbstractBlock
private static boolean isFullyConnected(BlockState state)
private static boolean isNotConnected(BlockState state)
public void prepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth)
prepare
in class AbstractBlock
private WireConnection getRenderConnectionType(BlockView blockView, BlockPos blockPos, Direction direction)
private WireConnection method_27841(BlockView blockView, BlockPos blockPos, Direction direction, boolean bool)
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos)
canPlaceAt
in class AbstractBlock
private boolean canRunOnTop(BlockView world, BlockPos pos, BlockState floor)
private void update(World world, BlockPos pos, BlockState state)
private int increasePower(BlockState state)
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
onBlockAdded
in class AbstractBlock
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)
WorldChunk.setBlockState(BlockPos, BlockState, boolean)
if newState
is different from state
. Vanilla blocks perform removal cleanups here.onStateReplaced
in class AbstractBlock
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
neighborUpdate
in class AbstractBlock
public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
getStrongRedstonePower
in class AbstractBlock
public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
getWeakRedstonePower
in class AbstractBlock
protected static boolean connectsTo(BlockState state)
protected static boolean connectsTo(BlockState state, @Nullable Direction dir)
public boolean emitsRedstonePower(BlockState state)
emitsRedstonePower
in class AbstractBlock
@Environment(value=CLIENT) public static int getWireColor(int powerLevel)
@Environment(value=CLIENT) private void method_27936(World world, Random random, BlockPos pos, Vector3f vector3f, Direction direction, Direction direction2, float float2, float float3)
@Environment(value=CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)
randomDisplayTick
in class Block
public BlockState rotate(BlockState state, BlockRotation rotation)
By default, this returns the provided block state.
rotate
in class AbstractBlock
public BlockState mirror(BlockState state, BlockMirror mirror)
mirror
in class AbstractBlock
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
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.
onUse
in class AbstractBlock
private void method_28482(World world, BlockPos pos, BlockState blockState, BlockState blockState2)