Class RedstoneTorchBlock
- All Implemented Interfaces:
ItemConvertible
,ToggleableFeature
- Direct Known Subclasses:
WallRedstoneTorchBlock
- Mappings:
Namespace Name official csq
intermediary net/minecraft/class_2459
named net/minecraft/block/RedstoneTorchBlock
-
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
Modifier and TypeFieldDescriptionprivate static final Map<BlockView,
List<RedstoneTorchBlock.BurnoutEntry>> static final int
static final int
static final int
static final BooleanProperty
private static final int
Fields inherited from class net.minecraft.block.TorchBlock
BOUNDING_SHAPE, field_31265, particle
Fields inherited from class net.minecraft.block.Block
field_31022, field_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, SKIP_LIGHTING_UPDATES, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableId, material, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Fields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendProperties
(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.boolean
emitsRedstonePower
(BlockState state) Returns whether the block is capable of emitting redstone power.int
getStrongRedstonePower
(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the strong redstone power emitted from the block.int
getWeakRedstonePower
(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the weak redstone power emitted from the block.private static boolean
isBurnedOut
(World world, BlockPos pos, boolean addNew) void
neighborUpdate
(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Called when a neighboring block is updated.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.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.void
randomDisplayTick
(BlockState state, World world, BlockPos pos, Random random) Called randomly on the client.void
scheduledTick
(BlockState state, ServerWorld world, BlockPos pos, Random random) Called server-side when a block receives a scheduled tick.protected boolean
shouldUnpower
(World world, BlockPos pos, BlockState state) Methods inherited from class net.minecraft.block.TorchBlock
canPlaceAt, getOutlineShape, getStateForNeighborUpdate
Methods inherited from class net.minecraft.block.Block
afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getPlacementState, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createScreenHandlerFactory, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getLootTableId, getMaxHorizontalModelOffset, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSidesShape, getVerticalModelOffsetMultiplier, hasComparatorOutput, hasSidedTransparency, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, mirror, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onSyncedBlockEvent, onUse, prepare, randomTick, rotate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
LIT
- Mappings:
Namespace Name Mixin selector official a
Lcsq;a:Lczk;
intermediary field_11446
Lnet/minecraft/class_2459;field_11446:Lnet/minecraft/class_2746;
named LIT
Lnet/minecraft/block/RedstoneTorchBlock;LIT:Lnet/minecraft/state/property/BooleanProperty;
-
BURNOUT_MAP
- Mappings:
Namespace Name Mixin selector official e
Lcsq;e:Ljava/util/Map;
intermediary field_11445
Lnet/minecraft/class_2459;field_11445:Ljava/util/Map;
named BURNOUT_MAP
Lnet/minecraft/block/RedstoneTorchBlock;BURNOUT_MAP:Ljava/util/Map;
-
field_31227
public static final int field_31227- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lcsq;b:I
intermediary field_31227
Lnet/minecraft/class_2459;field_31227:I
named field_31227
Lnet/minecraft/block/RedstoneTorchBlock;field_31227:I
-
field_31228
public static final int field_31228- See Also:
- Mappings:
Namespace Name Mixin selector official c
Lcsq;c:I
intermediary field_31228
Lnet/minecraft/class_2459;field_31228:I
named field_31228
Lnet/minecraft/block/RedstoneTorchBlock;field_31228:I
-
field_31229
public static final int field_31229- See Also:
- Mappings:
Namespace Name Mixin selector official d
Lcsq;d:I
intermediary field_31229
Lnet/minecraft/class_2459;field_31229:I
named field_31229
Lnet/minecraft/block/RedstoneTorchBlock;field_31229:I
-
SCHEDULED_TICK_DELAY
private static final int SCHEDULED_TICK_DELAY- See Also:
- Mappings:
Namespace Name Mixin selector official f
Lcsq;f:I
intermediary field_31230
Lnet/minecraft/class_2459;field_31230:I
named SCHEDULED_TICK_DELAY
Lnet/minecraft/block/RedstoneTorchBlock;SCHEDULED_TICK_DELAY:I
-
-
Constructor Details
-
RedstoneTorchBlock
- Mappings:
Namespace Name Mixin selector official <init>
Lcys;<init>(Lcys$c;)V
intermediary <init>
Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)V
named <init>
Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
-
-
Method Details
-
onBlockAdded
public 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,AbstractBlock.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)
orAbstractBlock.neighborUpdate(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
AbstractBlock.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:
onBlockAdded
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lcys;b(Lcyt;Lcjw;Lgp;Lcyt;Z)V
intermediary method_9615
Lnet/minecraft/class_4970;method_9615(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V
named onBlockAdded
Lnet/minecraft/block/AbstractBlock;onBlockAdded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
- When activating a redstone component on placement (used along with
-
onStateReplaced
public 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.- Overrides:
onStateReplaced
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lcys;a(Lcyt;Lcjw;Lgp;Lcyt;Z)V
intermediary method_9536
Lnet/minecraft/class_4970;method_9536(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V
named onStateReplaced
Lnet/minecraft/block/AbstractBlock;onStateReplaced(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
-
getWeakRedstonePower
public 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
AbstractBlock.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,
RedstoneBlock
andTargetBlock
emits weak redstone power only.LeverBlock
andButtonBlock
emits both weak and strong redstone power depending on the direction.- Overrides:
getWeakRedstonePower
in classAbstractBlock
- Returns:
- the weak redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lcys;a(Lcyt;Lcjc;Lgp;Lgv;)I
intermediary method_9524
Lnet/minecraft/class_4970;method_9524(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)I
named getWeakRedstonePower
Lnet/minecraft/block/AbstractBlock;getWeakRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)I
-
shouldUnpower
- Mappings:
Namespace Name Mixin selector official a
Lcsq;a(Lcjw;Lgp;Lcyt;)Z
intermediary method_10488
Lnet/minecraft/class_2459;method_10488(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Z
named shouldUnpower
Lnet/minecraft/block/RedstoneTorchBlock;shouldUnpower(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z
-
scheduledTick
Called server-side when a block receives a scheduled tick. This can be used like a timer. Scheduled ticks are added usingWorldAccess.scheduleBlockTick(BlockPos, Block, int)
. Additionally,AbstractBlock.randomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)
by default calls this method; overrideAbstractBlock.randomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)
to disable this behavior.Scheduled ticks are often used inside
AbstractBlock.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)
.Here are some examples:
SugarCaneBlock
checks the placement requirement.DispenserBlock
dispenses its content.CommandBlock
executes its command.FrogspawnBlock
spawns a tadpole.SoulSandBlock
updates a bubble column.FallingBlock
tries to fall.
- Overrides:
scheduledTick
in classAbstractBlock
- See Also:
-
WorldAccess.scheduleBlockTick(BlockPos, Block, int)
AbstractBlock.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)
AbstractBlock.randomTick(net.minecraft.block.BlockState, net.minecraft.server.world.ServerWorld, net.minecraft.util.math.BlockPos, net.minecraft.util.math.random.Random)
- Mappings:
Namespace Name Mixin selector official a
Lcys;a(Lcyt;Lahm;Lgp;Laoh;)V
intermediary method_9588
Lnet/minecraft/class_4970;method_9588(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V
named scheduledTick
Lnet/minecraft/block/AbstractBlock;scheduledTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V
-
neighborUpdate
public 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 asSpongeBlock
which absorbs water.To replace the state of the block itself, override
AbstractBlock.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:
neighborUpdate
in classAbstractBlock
- See Also:
-
AbstractBlock.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)
World.isReceivingRedstonePower(net.minecraft.util.math.BlockPos)
- Mappings:
Namespace Name Mixin selector official a
Lcys;a(Lcyt;Lcjw;Lgp;Lcmt;Lgp;Z)V
intermediary method_9612
Lnet/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)V
named neighborUpdate
Lnet/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)V
-
getStrongRedstonePower
public 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
AbstractBlock.emitsRedstonePower(net.minecraft.block.BlockState)
to returntrue
.AbstractBlock.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,
RedstoneBlock
andTargetBlock
emits weak redstone power only.LeverBlock
andButtonBlock
emits both weak and strong redstone power.- Overrides:
getStrongRedstonePower
in classAbstractBlock
- Returns:
- the strong redstone power emitted from the block
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lcys;b(Lcyt;Lcjc;Lgp;Lgv;)I
intermediary method_9603
Lnet/minecraft/class_4970;method_9603(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)I
named getStrongRedstonePower
Lnet/minecraft/block/AbstractBlock;getStrongRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)I
-
emitsRedstonePower
Returns whether the block is capable of emitting redstone power.This does not return whether the block is currently emitting redstone power. Use
World.isEmittingRedstonePower(net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction)
in that case.- Overrides:
emitsRedstonePower
in classAbstractBlock
- Returns:
- whether the block is capable of emitting redstone power
- See Also:
- Mappings:
Namespace Name Mixin selector official f_
Lcys;f_(Lcyt;)Z
intermediary method_9506
Lnet/minecraft/class_4970;method_9506(Lnet/minecraft/class_2680;)Z
named emitsRedstonePower
Lnet/minecraft/block/AbstractBlock;emitsRedstonePower(Lnet/minecraft/block/BlockState;)Z
-
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:
randomDisplayTick
in classTorchBlock
- Mappings:
Namespace Name Mixin selector official a
Lcmt;a(Lcyt;Lcjw;Lgp;Laoh;)V
intermediary method_9496
Lnet/minecraft/class_2248;method_9496(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V
named randomDisplayTick
Lnet/minecraft/block/Block;randomDisplayTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])
inside the method. SeeProperties
for the list of pre-defined properties.- Overrides:
appendProperties
in classBlock
- Mappings:
Namespace Name Mixin selector official a
Lcmt;a(Lcyu$a;)V
intermediary method_9515
Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
named appendProperties
Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
-
isBurnedOut
- Mappings:
Namespace Name Mixin selector official a
Lcsq;a(Lcjw;Lgp;Z)Z
intermediary method_10489
Lnet/minecraft/class_2459;method_10489(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z
named isBurnedOut
Lnet/minecraft/block/RedstoneTorchBlock;isBurnedOut(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Z)Z
-