Class RedstoneWireBlock
- All Implemented Interfaces:
ItemConvertible,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/RedstoneWireBlockintermediary net/minecraft/class_2457official dmb
-
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.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RedstoneWireBlock> private static final Vec3d[]private static final Map<Direction, VoxelShape> private static final Map<Direction, VoxelShape> static final Map<Direction, EnumProperty<WireConnection>> private static final VoxelShapeprivate final BlockStateprivate static final floatprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intstatic final IntPropertyprivate static final Map<BlockState, VoxelShape> static final EnumProperty<WireConnection> static final EnumProperty<WireConnection> static final EnumProperty<WireConnection> static final EnumProperty<WireConnection> private booleanFields inherited from class net.minecraft.block.Block
field_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_ALL_AND_REDRAW, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplierFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddPoweredParticles(World world, Random random, BlockPos pos, Vec3d color, Direction direction, Direction direction2, float float2, float float3) protected voidappendProperties(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.protected booleancanPlaceAt(BlockState state, WorldView world, BlockPos pos) Returns whether the block can be placed atpos.private booleancanRunOnTop(BlockView world, BlockPos pos, BlockState floor) protected static booleanconnectsTo(BlockState state) protected static booleanconnectsTo(BlockState state, @Nullable Direction dir) protected booleanemitsRedstonePower(BlockState state) Returns whether the block is capable of emitting redstone power.com.mojang.serialization.MapCodec<RedstoneWireBlock> getCodec()private BlockStategetDefaultWireState(BlockView world, BlockState state, BlockPos pos) protected VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) private BlockStategetPlacementState(BlockView world, BlockState state, BlockPos pos) private intgetReceivedRedstonePower(World world, BlockPos pos) private WireConnectiongetRenderConnectionType(BlockView world, BlockPos pos, Direction direction) private WireConnectiongetRenderConnectionType(BlockView world, BlockPos pos, Direction direction, boolean bool) private VoxelShapegetShapeForState(BlockState state) protected BlockStategetStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) Returns the state of the block after a neighboring block's state change.protected intgetStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the strong redstone power emitted from the block.protected intgetWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the weak redstone power emitted from the block.static intgetWireColor(int powerLevel) private intincreasePower(BlockState state) private static booleanisFullyConnected(BlockState state) private static booleanisNotConnected(BlockState state) protected BlockStatemirror(BlockState state, BlockMirror mirror) Returnsstatemirrored bymirror.protected voidneighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Called when a neighboring block is updated.protected voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Called server-side on the new block when the block state is changed.protected voidonStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) Called server-side on the old block when the block state is changed.protected ActionResultonUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) protected voidprepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Called when the block state changes, before the neighbor-triggered state update on the original block, and after the neighbor-triggered state update on the replaced block.voidrandomDisplayTick(BlockState state, World world, BlockPos pos, Random random) Called randomly on the client.protected BlockStaterotate(BlockState state, BlockRotation rotation) Returnsstaterotated byrotation.private voidupdate(World world, BlockPos pos, BlockState state) private voidupdateForNewState(World world, BlockPos pos, BlockState oldState, BlockState newState) private voidupdateNeighbors(World world, BlockPos pos) private voidupdateOffsetNeighbors(World world, BlockPos pos) Methods inherited from class net.minecraft.block.Block
afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasTopRim, isFaceFullSquare, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createCodec, createScreenHandlerFactory, createSettingsCodec, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getVerticalModelOffsetMultiplier, hasComparatorOutput, hasRandomTicks, hasSidedTransparency, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, isTransparent, onBlockBreakStart, onEntityCollision, onExploded, onProjectileHit, onStacksDropped, onSyncedBlockEvent, onUseWithItem, randomTick, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/block/RedstoneWireBlock;CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_46422Lnet/minecraft/class_2457;field_46422:Lcom/mojang/serialization/MapCodec;official aLdmb;a:Lcom/mojang/serialization/MapCodec;
-
WIRE_CONNECTION_NORTH
- Mappings:
Namespace Name Mixin selector named WIRE_CONNECTION_NORTHLnet/minecraft/block/RedstoneWireBlock;WIRE_CONNECTION_NORTH:Lnet/minecraft/state/property/EnumProperty;intermediary field_11440Lnet/minecraft/class_2457;field_11440:Lnet/minecraft/class_2754;official bLdmb;b:Ldua;
-
WIRE_CONNECTION_EAST
- Mappings:
Namespace Name Mixin selector named WIRE_CONNECTION_EASTLnet/minecraft/block/RedstoneWireBlock;WIRE_CONNECTION_EAST:Lnet/minecraft/state/property/EnumProperty;intermediary field_11436Lnet/minecraft/class_2457;field_11436:Lnet/minecraft/class_2754;official cLdmb;c:Ldua;
-
WIRE_CONNECTION_SOUTH
- Mappings:
Namespace Name Mixin selector named WIRE_CONNECTION_SOUTHLnet/minecraft/block/RedstoneWireBlock;WIRE_CONNECTION_SOUTH:Lnet/minecraft/state/property/EnumProperty;intermediary field_11437Lnet/minecraft/class_2457;field_11437:Lnet/minecraft/class_2754;official dLdmb;d:Ldua;
-
WIRE_CONNECTION_WEST
- Mappings:
Namespace Name Mixin selector named WIRE_CONNECTION_WESTLnet/minecraft/block/RedstoneWireBlock;WIRE_CONNECTION_WEST:Lnet/minecraft/state/property/EnumProperty;intermediary field_11439Lnet/minecraft/class_2457;field_11439:Lnet/minecraft/class_2754;official eLdmb;e:Ldua;
-
POWER
- Mappings:
Namespace Name Mixin selector named POWERLnet/minecraft/block/RedstoneWireBlock;POWER:Lnet/minecraft/state/property/IntProperty;intermediary field_11432Lnet/minecraft/class_2457;field_11432:Lnet/minecraft/class_2758;official fLdmb;f:Lduc;
-
DIRECTION_TO_WIRE_CONNECTION_PROPERTY
public static final Map<Direction,EnumProperty<WireConnection>> DIRECTION_TO_WIRE_CONNECTION_PROPERTY- Mappings:
Namespace Name Mixin selector named DIRECTION_TO_WIRE_CONNECTION_PROPERTYLnet/minecraft/block/RedstoneWireBlock;DIRECTION_TO_WIRE_CONNECTION_PROPERTY:Ljava/util/Map;intermediary field_11435Lnet/minecraft/class_2457;field_11435:Ljava/util/Map;official gLdmb;g:Ljava/util/Map;
-
field_31222
protected static final int field_31222- See Also:
- Mappings:
Namespace Name Mixin selector named field_31222Lnet/minecraft/block/RedstoneWireBlock;field_31222:Iintermediary field_31222Lnet/minecraft/class_2457;field_31222:Iofficial hLdmb;h:I
-
field_31223
protected static final int field_31223- See Also:
- Mappings:
Namespace Name Mixin selector named field_31223Lnet/minecraft/block/RedstoneWireBlock;field_31223:Iintermediary field_31223Lnet/minecraft/class_2457;field_31223:Iofficial iLdmb;i:I
-
field_31224
protected static final int field_31224- See Also:
- Mappings:
Namespace Name Mixin selector named field_31224Lnet/minecraft/block/RedstoneWireBlock;field_31224:Iintermediary field_31224Lnet/minecraft/class_2457;field_31224:Iofficial jLdmb;j:I
-
field_31225
protected static final int field_31225- See Also:
- Mappings:
Namespace Name Mixin selector named field_31225Lnet/minecraft/block/RedstoneWireBlock;field_31225:Iintermediary field_31225Lnet/minecraft/class_2457;field_31225:Iofficial kLdmb;k:I
-
field_31226
protected static final int field_31226- See Also:
- Mappings:
Namespace Name Mixin selector named field_31226Lnet/minecraft/block/RedstoneWireBlock;field_31226:Iintermediary field_31226Lnet/minecraft/class_2457;field_31226:Iofficial lLdmb;l:I
-
DOT_SHAPE
- Mappings:
Namespace Name Mixin selector named DOT_SHAPELnet/minecraft/block/RedstoneWireBlock;DOT_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_24413Lnet/minecraft/class_2457;field_24413:Lnet/minecraft/class_265;official mLdmb;m:Lexv;
-
DIRECTION_TO_SIDE_SHAPE
- Mappings:
Namespace Name Mixin selector named DIRECTION_TO_SIDE_SHAPELnet/minecraft/block/RedstoneWireBlock;DIRECTION_TO_SIDE_SHAPE:Ljava/util/Map;intermediary field_24414Lnet/minecraft/class_2457;field_24414:Ljava/util/Map;official nLdmb;n:Ljava/util/Map;
-
DIRECTION_TO_UP_SHAPE
- Mappings:
Namespace Name Mixin selector named DIRECTION_TO_UP_SHAPELnet/minecraft/block/RedstoneWireBlock;DIRECTION_TO_UP_SHAPE:Ljava/util/Map;intermediary field_24415Lnet/minecraft/class_2457;field_24415:Ljava/util/Map;official oLdmb;o:Ljava/util/Map;
-
SHAPES
- Mappings:
Namespace Name Mixin selector named SHAPESLnet/minecraft/block/RedstoneWireBlock;SHAPES:Ljava/util/Map;intermediary field_24416Lnet/minecraft/class_2457;field_24416:Ljava/util/Map;official FLdmb;F:Ljava/util/Map;
-
COLORS
- Mappings:
Namespace Name Mixin selector named COLORSLnet/minecraft/block/RedstoneWireBlock;COLORS:[Lnet/minecraft/util/math/Vec3d;intermediary field_24466Lnet/minecraft/class_2457;field_24466:[Lnet/minecraft/class_243;official GLdmb;G:[Lexc;
-
field_31221
private static final float field_31221- See Also:
- Mappings:
Namespace Name Mixin selector named field_31221Lnet/minecraft/block/RedstoneWireBlock;field_31221:Fintermediary field_31221Lnet/minecraft/class_2457;field_31221:Fofficial HLdmb;H:F
-
dotState
- Mappings:
Namespace Name Mixin selector named dotStateLnet/minecraft/block/RedstoneWireBlock;dotState:Lnet/minecraft/block/BlockState;intermediary field_24733Lnet/minecraft/class_2457;field_24733:Lnet/minecraft/class_2680;official ILdmb;I:Ldtc;
-
wiresGivePower
private boolean wiresGivePower- Mappings:
Namespace Name Mixin selector named wiresGivePowerLnet/minecraft/block/RedstoneWireBlock;wiresGivePower:Zintermediary field_11438Lnet/minecraft/class_2457;field_11438:Zofficial JLdmb;J:Z
-
-
Constructor Details
-
RedstoneWireBlock
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)Vintermediary <init>Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)Vofficial <init>Ldtb;<init>(Ldtb$d;)V
-
-
Method Details
-
getCodec
- Overrides:
getCodecin classBlock- Mappings:
Namespace Name Mixin selector named getCodecLnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;intermediary method_53969Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;official aLdtb;a()Lcom/mojang/serialization/MapCodec;
-
getShapeForState
- Mappings:
Namespace Name Mixin selector named getShapeForStateLnet/minecraft/block/RedstoneWireBlock;getShapeForState(Lnet/minecraft/block/BlockState;)Lnet/minecraft/util/shape/VoxelShape;intermediary method_27845Lnet/minecraft/class_2457;method_27845(Lnet/minecraft/class_2680;)Lnet/minecraft/class_265;official nLdmb;n(Ldtc;)Lexv;
-
getOutlineShape
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) - Overrides:
getOutlineShapein classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector named getOutlineShapeLnet/minecraft/block/AbstractBlock;getOutlineShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;intermediary method_9530Lnet/minecraft/class_4970;method_9530(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265;official aLdtb;a(Ldtc;Ldcc;Ljd;Lexh;)Lexv;
-
getPlacementState
- Overrides:
getPlacementStatein classBlock- Mappings:
Namespace Name Mixin selector named getPlacementStateLnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;intermediary method_9605Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;official aLdfy;a(Lcyd;)Ldtc;
-
getPlacementState
- Mappings:
Namespace Name Mixin selector named getPlacementStateLnet/minecraft/block/RedstoneWireBlock;getPlacementState(Lnet/minecraft/world/BlockView;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;intermediary method_27840Lnet/minecraft/class_2457;method_27840(Lnet/minecraft/class_1922;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;official aLdmb;a(Ldcc;Ldtc;Ljd;)Ldtc;
-
getDefaultWireState
- Mappings:
Namespace Name Mixin selector named getDefaultWireStateLnet/minecraft/block/RedstoneWireBlock;getDefaultWireState(Lnet/minecraft/world/BlockView;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;intermediary method_27843Lnet/minecraft/class_2457;method_27843(Lnet/minecraft/class_1922;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;official bLdmb;b(Ldcc;Ldtc;Ljd;)Ldtc;
-
getStateForNeighborUpdate
protected BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) Returns the state of the block after a neighboring block's state change.Returning
Blocks.AIRbreaks the block. This is useful to implement supporting block requirement for blocks (if used along withcanPlaceAt(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.util.math.BlockPos)).Side effects like activating a redstone component (but not scheduling a tick) should be performed in
neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)instead. If the block supports waterlogging and currently has water, this method should be overridden to tick the fluid at the block's position.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. This is not called ifBlock.FORCE_STATEflag is set in thesetBlockStatecall.This method can be used for multiple purposes. Here are some examples:
FenceBlockuses it to update the fence's connection when a horizontally neighboring block's state is changed.PlantBlockuses it to break the plant if the state change causes it to lose its supporting block.DoorBlockuses it to copy the state of the other half of the door.SlabBlockuses it to schedule the fluid to tick if waterlogged.SoulSandBlockuses it to schedule the water block above to tick so that it becomes a bubble column.FallingBlockuses it to schedule the block to tick so that it can fall if needed.
- Overrides:
getStateForNeighborUpdatein classAbstractBlock- Parameters:
state- the state of this blockdirection- the direction from this block to the neighborneighborState- the state of the updated neighbor blockworld- the worldpos- the position of this blockneighborPos- the position of the neighbor block- Returns:
- the state of the block after a neighboring block's state change
- See Also:
- Mappings:
Namespace Name Mixin selector named getStateForNeighborUpdateLnet/minecraft/block/AbstractBlock;getStateForNeighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;intermediary method_9559Lnet/minecraft/class_4970;method_9559(Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;official aLdtb;a(Ldtc;Lji;Ldtc;Ldcx;Ljd;Ljd;)Ldtc;
-
isFullyConnected
- Mappings:
Namespace Name Mixin selector named isFullyConnectedLnet/minecraft/block/RedstoneWireBlock;isFullyConnected(Lnet/minecraft/block/BlockState;)Zintermediary method_27846Lnet/minecraft/class_2457;method_27846(Lnet/minecraft/class_2680;)Zofficial oLdmb;o(Ldtc;)Z
-
isNotConnected
- Mappings:
Namespace Name Mixin selector named isNotConnectedLnet/minecraft/block/RedstoneWireBlock;isNotConnected(Lnet/minecraft/block/BlockState;)Zintermediary method_28483Lnet/minecraft/class_2457;method_28483(Lnet/minecraft/class_2680;)Zofficial pLdmb;p(Ldtc;)Z
-
prepare
protected void prepare(BlockState state, WorldAccess world, BlockPos pos, int flags, int maxUpdateDepth) Called when the block state changes, before the neighbor-triggered state update on the original block, and after the neighbor-triggered state update on the replaced block.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.- Overrides:
preparein classAbstractBlock- See Also:
- API Note:
- This is used by
RedstoneWireBlockto update connected redstone wire. - Mappings:
Namespace Name Mixin selector named prepareLnet/minecraft/block/AbstractBlock;prepare(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;II)Vintermediary method_9517Lnet/minecraft/class_4970;method_9517(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;II)Vofficial aLdtb;a(Ldtc;Ldcx;Ljd;II)V
-
getRenderConnectionType
- Mappings:
Namespace Name Mixin selector named getRenderConnectionTypeLnet/minecraft/block/RedstoneWireBlock;getRenderConnectionType(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Lnet/minecraft/block/enums/WireConnection;intermediary method_10477Lnet/minecraft/class_2457;method_10477(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Lnet/minecraft/class_2773;official aLdmb;a(Ldcc;Ljd;Lji;)Lduh;
-
getRenderConnectionType
private WireConnection getRenderConnectionType(BlockView world, BlockPos pos, Direction direction, boolean bool) - Mappings:
Namespace Name Mixin selector named getRenderConnectionTypeLnet/minecraft/block/RedstoneWireBlock;getRenderConnectionType(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Z)Lnet/minecraft/block/enums/WireConnection;intermediary method_27841Lnet/minecraft/class_2457;method_27841(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Z)Lnet/minecraft/class_2773;official aLdmb;a(Ldcc;Ljd;Lji;Z)Lduh;
-
canPlaceAt
Returns whether the block can be placed atpos.Blocks with supporting block requirements should override this method. Note that this should also be checked manually during
getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)in order to break the block that lost its supporting block.This is only checked during the use of block items or by endermen, falling blocks, etc that can place blocks. This does not affect block state changes performed through
World.setBlockState(BlockPos, BlockState)call.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.- Overrides:
canPlaceAtin classAbstractBlock- Returns:
- whether the block can be placed at
pos - See Also:
- Mappings:
Namespace Name Mixin selector named canPlaceAtLnet/minecraft/block/AbstractBlock;canPlaceAt(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;)Zintermediary method_9558Lnet/minecraft/class_4970;method_9558(Lnet/minecraft/class_2680;Lnet/minecraft/class_4538;Lnet/minecraft/class_2338;)Zofficial aLdtb;a(Ldtc;Ldcz;Ljd;)Z
-
canRunOnTop
- Mappings:
Namespace Name Mixin selector named canRunOnTopLnet/minecraft/block/RedstoneWireBlock;canRunOnTop(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Zintermediary method_27937Lnet/minecraft/class_2457;method_27937(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Zofficial aLdmb;a(Ldcc;Ljd;Ldtc;)Z
-
update
- Mappings:
Namespace Name Mixin selector named updateLnet/minecraft/block/RedstoneWireBlock;update(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_10485Lnet/minecraft/class_2457;method_10485(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial aLdmb;a(Ldcw;Ljd;Ldtc;)V
-
getReceivedRedstonePower
- Mappings:
Namespace Name Mixin selector named getReceivedRedstonePowerLnet/minecraft/block/RedstoneWireBlock;getReceivedRedstonePower(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Iintermediary method_27842Lnet/minecraft/class_2457;method_27842(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Iofficial aLdmb;a(Ldcw;Ljd;)I
-
increasePower
- Mappings:
Namespace Name Mixin selector named increasePowerLnet/minecraft/block/RedstoneWireBlock;increasePower(Lnet/minecraft/block/BlockState;)Iintermediary method_10486Lnet/minecraft/class_2457;method_10486(Lnet/minecraft/class_2680;)Iofficial qLdmb;q(Ldtc;)I
-
updateNeighbors
- Mappings:
Namespace Name Mixin selector named updateNeighborsLnet/minecraft/block/RedstoneWireBlock;updateNeighbors(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Vintermediary method_10479Lnet/minecraft/class_2457;method_10479(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Vofficial bLdmb;b(Ldcw;Ljd;)V
-
onBlockAdded
protected void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Called server-side on the new block when the block state is changed. This includes block placement. When overriding this method,getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)orneighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)should also be overridden. The method is used in the following cases:- When activating a redstone component on placement (used along with
neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean) - When resetting a position-dependent state (see
TargetBlock) - When converting a block on placement (see
WetSpongeBlock) - When fire lights a portal
- Overrides:
onBlockAddedin classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector named onBlockAddedLnet/minecraft/block/AbstractBlock;onBlockAdded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)Vintermediary method_9615Lnet/minecraft/class_4970;method_9615(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)Vofficial bLdtb;b(Ldtc;Ldcw;Ljd;Ldtc;Z)V
- When activating a redstone component on placement (used along with
-
onStateReplaced
protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) Called server-side on the old block when the block state is changed. This includes block removal. This is used to update neighboring blocks when an active redstone power source is removed, or to drop the contents of an inventory. The checkstate.isOf(newState.getBlock())can be used to see if the block was removed or not.For most block entities,
ItemScatterer.onStateReplaced(net.minecraft.block.BlockState, net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos)provides a good implementation of this method. Make sure to callsuper.onStateReplaced(state, world, pos, newState, moved);after invokingItemScatterermethods.- Overrides:
onStateReplacedin classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector named onStateReplacedLnet/minecraft/block/AbstractBlock;onStateReplaced(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)Vintermediary method_9536Lnet/minecraft/class_4970;method_9536(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)Vofficial aLdtb;a(Ldtc;Ldcw;Ljd;Ldtc;Z)V
-
updateOffsetNeighbors
- Mappings:
Namespace Name Mixin selector named updateOffsetNeighborsLnet/minecraft/block/RedstoneWireBlock;updateOffsetNeighbors(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Vintermediary method_27844Lnet/minecraft/class_2457;method_27844(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Vofficial cLdmb;c(Ldcw;Ljd;)V
-
neighborUpdate
protected void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Called when a neighboring block is updated. This method should be overridden to perform an action with a side effect, most notably an activation of a redstone component. This can also be used to perform an action changing block states of other blocks, such asSpongeBlockwhich absorbs water.To replace the state of the block itself, override
getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)instead.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.- Overrides:
neighborUpdatein classAbstractBlock- See Also:
- Mappings:
Namespace Name Mixin selector named neighborUpdateLnet/minecraft/block/AbstractBlock;neighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Z)Vintermediary method_9612Lnet/minecraft/class_4970;method_9612(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2338;Z)Vofficial aLdtb;a(Ldtc;Ldcw;Ljd;Ldfy;Ljd;Z)V
-
getStrongRedstonePower
protected int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the strong redstone power emitted from the block.When overriding this, make sure to also override
emitsRedstonePower(net.minecraft.block.BlockState)to returntrue.getWeakRedstonePower(net.minecraft.block.BlockState, net.minecraft.world.BlockView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction)might also need to be overridden.Strong redstone power is a power that can power a redstone wire when a solid block is in between. For example,
RedstoneBlockandTargetBlockemits weak redstone power only.LeverBlockandButtonBlockemits both weak and strong redstone power.- Overrides:
getStrongRedstonePowerin classAbstractBlock- Returns:
- the strong redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector named getStrongRedstonePowerLnet/minecraft/block/AbstractBlock;getStrongRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Iintermediary method_9603Lnet/minecraft/class_4970;method_9603(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Iofficial bLdtb;b(Ldtc;Ldcc;Ljd;Lji;)I
-
getWeakRedstonePower
protected int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the weak redstone power emitted from the block.When overriding this, make sure to also override
emitsRedstonePower(net.minecraft.block.BlockState)to returntrue.Weak redstone power is a power that cannot power a redstone wire when a solid block is in between. For example,
RedstoneBlockandTargetBlockemits weak redstone power only.LeverBlockandButtonBlockemits both weak and strong redstone power depending on the direction.- Overrides:
getWeakRedstonePowerin classAbstractBlock- Returns:
- the weak redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector named getWeakRedstonePowerLnet/minecraft/block/AbstractBlock;getWeakRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Iintermediary method_9524Lnet/minecraft/class_4970;method_9524(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Iofficial aLdtb;a(Ldtc;Ldcc;Ljd;Lji;)I
-
connectsTo
- Mappings:
Namespace Name Mixin selector named connectsToLnet/minecraft/block/RedstoneWireBlock;connectsTo(Lnet/minecraft/block/BlockState;)Zintermediary method_10484Lnet/minecraft/class_2457;method_10484(Lnet/minecraft/class_2680;)Zofficial mLdmb;m(Ldtc;)Z
-
connectsTo
- Mappings:
Namespace Name Mixin selector named connectsToLnet/minecraft/block/RedstoneWireBlock;connectsTo(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;)Zintermediary method_10482Lnet/minecraft/class_2457;method_10482(Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;)Zofficial aLdmb;a(Ldtc;Lji;)Z
-
emitsRedstonePower
Returns whether the block is capable of emitting redstone power.This does not return whether the block is currently emitting redstone power. Use
RedstoneView.isEmittingRedstonePower(net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction)in that case.- Overrides:
emitsRedstonePowerin classAbstractBlock- Returns:
- whether the block is capable of emitting redstone power
- See Also:
- Mappings:
Namespace Name Mixin selector named emitsRedstonePowerLnet/minecraft/block/AbstractBlock;emitsRedstonePower(Lnet/minecraft/block/BlockState;)Zintermediary method_9506Lnet/minecraft/class_4970;method_9506(Lnet/minecraft/class_2680;)Zofficial e_Ldtb;e_(Ldtc;)Z
-
getWireColor
public static int getWireColor(int powerLevel) - Mappings:
Namespace Name Mixin selector named getWireColorLnet/minecraft/block/RedstoneWireBlock;getWireColor(I)Iintermediary method_10487Lnet/minecraft/class_2457;method_10487(I)Iofficial bLdmb;b(I)I
-
addPoweredParticles
private void addPoweredParticles(World world, Random random, BlockPos pos, Vec3d color, Direction direction, Direction direction2, float float2, float float3) - Mappings:
Namespace Name Mixin selector named addPoweredParticlesLnet/minecraft/block/RedstoneWireBlock;addPoweredParticles(Lnet/minecraft/world/World;Lnet/minecraft/util/math/random/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/Direction;FF)Vintermediary method_27936Lnet/minecraft/class_2457;method_27936(Lnet/minecraft/class_1937;Lnet/minecraft/class_5819;Lnet/minecraft/class_2338;Lnet/minecraft/class_243;Lnet/minecraft/class_2350;Lnet/minecraft/class_2350;FF)Vofficial aLdmb;a(Ldcw;Layw;Ljd;Lexc;Lji;Lji;FF)V
-
randomDisplayTick
Called randomly on the client. Blocks may override this to spawn particles. UnlikeAbstractBlock.randomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)this is not affected by a game rule.- Overrides:
randomDisplayTickin classBlock- Mappings:
Namespace Name Mixin selector named randomDisplayTickLnet/minecraft/block/Block;randomDisplayTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)Vintermediary method_9496Lnet/minecraft/class_2248;method_9496(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)Vofficial aLdfy;a(Ldtc;Ldcw;Ljd;Layw;)V
-
rotate
Returnsstaterotated byrotation.By default, this returns the provided block state.
- Overrides:
rotatein classAbstractBlock- Returns:
staterotated byrotation- See Also:
- Mappings:
Namespace Name Mixin selector named rotateLnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;intermediary method_9598Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;official aLdtb;a(Ldtc;Ldmm;)Ldtc;
-
mirror
Returnsstatemirrored bymirror.By default, this returns the provided block state.
- Overrides:
mirrorin classAbstractBlock- Returns:
statemirrored bymirror- See Also:
- Mappings:
Namespace Name Mixin selector named mirrorLnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;intermediary method_9569Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;official aLdtb;a(Ldtc;Ldkv;)Ldtc;
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])inside the method. SeePropertiesfor the list of pre-defined properties.- Overrides:
appendPropertiesin classBlock- Mappings:
Namespace Name Mixin selector named appendPropertiesLnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)Vintermediary method_9515Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)Vofficial aLdfy;a(Ldtd$a;)V
-
onUse
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) - Overrides:
onUsein classAbstractBlock- Mappings:
Namespace Name Mixin selector named onUseLnet/minecraft/block/AbstractBlock;onUse(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;intermediary method_55766Lnet/minecraft/class_4970;method_55766(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_3965;)Lnet/minecraft/class_1269;official aLdtb;a(Ldtc;Ldcw;Ljd;Lcmx;Lewy;)Lbqr;
-
updateForNewState
- Mappings:
Namespace Name Mixin selector named updateForNewStateLnet/minecraft/block/RedstoneWireBlock;updateForNewState(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;)Vintermediary method_28482Lnet/minecraft/class_2457;method_28482(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2680;)Vofficial aLdmb;a(Ldcw;Ljd;Ldtc;Ldtc;)V
-