Class DetectorRailBlock
- All Implemented Interfaces:
FluidDrainable
,FluidFillable
,Waterloggable
,ItemConvertible
,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/DetectorRailBlock
intermediary net/minecraft/class_2313
official dmo
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<DetectorRailBlock> static final BooleanProperty
private static final int
static final EnumProperty
<RailShape> Fields inherited from class net.minecraft.block.AbstractRailBlock
ASCENDING_SHAPE, STRAIGHT_SHAPE, WATERLOGGED
Fields 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, SKIP_REDSTONE_WIRE_STATE_REPLACEMENT, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, translationKey, 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.protected boolean
emitsRedstonePower
(BlockState state) Returns whether the block is capable of emitting redstone power.private Box
private <T extends AbstractMinecartEntity>
List<T> com.mojang.serialization.MapCodec
<DetectorRailBlock> getCodec()
protected int
getComparatorOutput
(BlockState state, World world, BlockPos pos) Returns the comparator output of the block, from0
to15
.protected int
getStrongRedstonePower
(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the strong redstone power emitted from the block.protected int
getWeakRedstonePower
(BlockState state, BlockView world, BlockPos pos, Direction direction) Returns the weak redstone power emitted from the block.protected boolean
hasComparatorOutput
(BlockState state) Returns whether the block can have a comparator output.protected BlockState
mirror
(BlockState state, BlockMirror mirror) Returnsstate
mirrored bymirror
.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.protected void
onEntityCollision
(BlockState state, World world, BlockPos pos, Entity entity) Called when the entity's collision box intersects the block.protected BlockState
rotate
(BlockState state, BlockRotation rotation) Returnsstate
rotated byrotation
.protected void
scheduledTick
(BlockState state, ServerWorld world, BlockPos pos, Random random) Called server-side when a block receives a scheduled tick.protected void
updateNearbyRails
(World world, BlockPos pos, BlockState state, boolean unpowering) private void
updatePoweredStatus
(World world, BlockPos pos, BlockState state) Methods inherited from class net.minecraft.block.AbstractRailBlock
cannotMakeCurves, canPlaceAt, getFluidState, getOutlineShape, getPlacementState, getStateForNeighborUpdate, isRail, isRail, neighborUpdate, onStateReplaced, updateBlockState, updateBlockState, updateCurves
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, getVelocityMultiplier, hasDynamicBounds, hasTopRim, isFaceFullSquare, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createCodec, createScreenHandlerFactory, createSettingsCodec, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getCullingShape, getDefaultMapColor, getDroppedStacks, getHardness, getInsideCollisionShape, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getTranslationKey, getVerticalModelOffsetMultiplier, hasRandomTicks, hasSidedTransparency, isShapeFullCube, isSideInvisible, isTransparent, onBlockBreakStart, onExploded, onProjectileHit, onStacksDropped, onSyncedBlockEvent, onUse, onUseWithItem, prepare, randomTick
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
Methods inherited from interface net.minecraft.block.Waterloggable
canFillWithFluid, getBucketFillSound, tryDrainFluid, tryFillWithFluid
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/block/DetectorRailBlock;CODEC:Lcom/mojang/serialization/MapCodec;
intermediary field_46334
Lnet/minecraft/class_2313;field_46334:Lcom/mojang/serialization/MapCodec;
official d
Ldmo;d:Lcom/mojang/serialization/MapCodec;
-
SHAPE
- Mappings:
Namespace Name Mixin selector named SHAPE
Lnet/minecraft/block/DetectorRailBlock;SHAPE:Lnet/minecraft/state/property/EnumProperty;
intermediary field_10914
Lnet/minecraft/class_2313;field_10914:Lnet/minecraft/class_2754;
official e
Ldmo;e:Ldyr;
-
POWERED
- Mappings:
Namespace Name Mixin selector named POWERED
Lnet/minecraft/block/DetectorRailBlock;POWERED:Lnet/minecraft/state/property/BooleanProperty;
intermediary field_10913
Lnet/minecraft/class_2313;field_10913:Lnet/minecraft/class_2746;
official f
Ldmo;f:Ldyl;
-
SCHEDULED_TICK_DELAY
private static final int SCHEDULED_TICK_DELAY- See Also:
- Mappings:
Namespace Name Mixin selector named SCHEDULED_TICK_DELAY
Lnet/minecraft/block/DetectorRailBlock;SCHEDULED_TICK_DELAY:I
intermediary field_31081
Lnet/minecraft/class_2313;field_31081:I
official g
Ldmo;g:I
-
-
Constructor Details
-
DetectorRailBlock
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
intermediary <init>
Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)V
official <init>
Ldxt;<init>(Ldxt$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodec
in classAbstractRailBlock
- Mappings:
Namespace Name Mixin selector named getCodec
Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;
intermediary method_53969
Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;
official a
Ldxt;a()Lcom/mojang/serialization/MapCodec;
-
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:
emitsRedstonePower
in classAbstractBlock
- Returns:
- whether the block is capable of emitting redstone power
- See Also:
- Mappings:
Namespace Name Mixin selector named emitsRedstonePower
Lnet/minecraft/block/AbstractBlock;emitsRedstonePower(Lnet/minecraft/block/BlockState;)Z
intermediary method_9506
Lnet/minecraft/class_4970;method_9506(Lnet/minecraft/class_2680;)Z
official f_
Ldxt;f_(Ldxu;)Z
-
onEntityCollision
Called when the entity's collision box intersects the block. Therefore, this method is not called for blocks with a collision; useBlock.onSteppedOn(net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.entity.Entity)
for those blocks.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
.Here are some examples:
CactusBlock
damages the entity.AbstractPressurePlateBlock
triggers.CobwebBlock
slows the entity.EndPortalBlock
teleports the entity.HopperBlock
collects the item entity.
- Overrides:
onEntityCollision
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named onEntityCollision
Lnet/minecraft/block/AbstractBlock;onEntityCollision(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;)V
intermediary method_9548
Lnet/minecraft/class_4970;method_9548(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;)V
official a
Ldxt;a(Ldxu;Ldhh;Ljh;Lbvj;)V
-
scheduledTick
Called server-side when a block receives a scheduled tick. This can be used like a timer. Scheduled ticks are added usingScheduledTickView.scheduleBlockTick(BlockPos, Block, int)
.Scheduled ticks are often used inside
AbstractRailBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.world.tick.ScheduledTickView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.util.math.random.Random)
.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:
- Mappings:
Namespace Name Mixin selector 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
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
official a
Ldxt;a(Ldxu;Lash;Ljh;Lbam;)V
-
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,
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 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
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
official a
Ldxt;a(Ldxu;Ldgm;Ljh;Ljm;)I
-
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,
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 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
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
official b
Ldxt;b(Ldxu;Ldgm;Ljh;Ljm;)I
-
updatePoweredStatus
- Mappings:
Namespace Name Mixin selector named updatePoweredStatus
Lnet/minecraft/block/DetectorRailBlock;updatePoweredStatus(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_10002
Lnet/minecraft/class_2313;method_10002(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official a
Ldmo;a(Ldhh;Ljh;Ldxu;)V
-
updateNearbyRails
- Mappings:
Namespace Name Mixin selector named updateNearbyRails
Lnet/minecraft/block/DetectorRailBlock;updateNearbyRails(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
intermediary method_10003
Lnet/minecraft/class_2313;method_10003(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V
official b
Ldmo;b(Ldhh;Ljh;Ldxu;Z)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,AbstractRailBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.world.tick.ScheduledTickView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.util.math.random.Random)
orAbstractRailBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.world.block.WireOrientation, boolean)
should also be overridden. The method is used in the following cases:- When activating a redstone component on placement (used along with
AbstractRailBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.world.block.WireOrientation, 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 classAbstractRailBlock
- See Also:
- Mappings:
Namespace Name Mixin selector 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
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
official b
Ldxt;b(Ldxu;Ldhh;Ljh;Ldxu;Z)V
- When activating a redstone component on placement (used along with
-
getShapeProperty
- Specified by:
getShapeProperty
in classAbstractRailBlock
- Mappings:
Namespace Name Mixin selector named getShapeProperty
Lnet/minecraft/block/AbstractRailBlock;getShapeProperty()Lnet/minecraft/state/property/Property;
intermediary method_9474
Lnet/minecraft/class_2241;method_9474()Lnet/minecraft/class_2769;
official c
Ldka;c()Ldyw;
-
hasComparatorOutput
Returns whether the block can have a comparator output.This does not check the current comparator output of the block. Use
getComparatorOutput(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos)
in that case.- Overrides:
hasComparatorOutput
in classAbstractBlock
- Returns:
- whether the block can have a comparator output
- See Also:
- Mappings:
Namespace Name Mixin selector named hasComparatorOutput
Lnet/minecraft/block/AbstractBlock;hasComparatorOutput(Lnet/minecraft/block/BlockState;)Z
intermediary method_9498
Lnet/minecraft/class_4970;method_9498(Lnet/minecraft/class_2680;)Z
official c_
Ldxt;c_(Ldxu;)Z
-
getComparatorOutput
Returns the comparator output of the block, from0
to15
.When overriding this,
hasComparatorOutput(net.minecraft.block.BlockState)
must also be overridden.- Overrides:
getComparatorOutput
in classAbstractBlock
- Returns:
- the comparator output of the block, from
0
to15
- See Also:
- Mappings:
Namespace Name Mixin selector named getComparatorOutput
Lnet/minecraft/block/AbstractBlock;getComparatorOutput(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I
intermediary method_9572
Lnet/minecraft/class_4970;method_9572(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)I
official a
Ldxt;a(Ldxu;Ldhh;Ljh;)I
-
getCarts
private <T extends AbstractMinecartEntity> List<T> getCarts(World world, BlockPos pos, Class<T> entityClass, Predicate<Entity> entityPredicate) - Mappings:
Namespace Name Mixin selector named getCarts
Lnet/minecraft/block/DetectorRailBlock;getCarts(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Ljava/lang/Class;Ljava/util/function/Predicate;)Ljava/util/List;
intermediary method_10001
Lnet/minecraft/class_2313;method_10001(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Ljava/lang/Class;Ljava/util/function/Predicate;)Ljava/util/List;
official a
Ldmo;a(Ldhh;Ljh;Ljava/lang/Class;Ljava/util/function/Predicate;)Ljava/util/List;
-
getCartDetectionBox
- Mappings:
Namespace Name Mixin selector named getCartDetectionBox
Lnet/minecraft/block/DetectorRailBlock;getCartDetectionBox(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/Box;
intermediary method_10004
Lnet/minecraft/class_2313;method_10004(Lnet/minecraft/class_2338;)Lnet/minecraft/class_238;
official a
Ldmo;a(Ljh;)Lfbs;
-
rotate
Returnsstate
rotated byrotation
.By default, this returns the provided block state.
- Overrides:
rotate
in classAbstractBlock
- Returns:
state
rotated byrotation
- See Also:
- Mappings:
Namespace Name Mixin selector named rotate
Lnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;
intermediary method_9598
Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;
official a
Ldxt;a(Ldxu;Ldrb;)Ldxu;
-
mirror
Returnsstate
mirrored bymirror
.By default, this returns the provided block state.
- Overrides:
mirror
in classAbstractBlock
- Returns:
state
mirrored bymirror
- See Also:
- Mappings:
Namespace Name Mixin selector named mirror
Lnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;
intermediary method_9569
Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;
official a
Ldxt;a(Ldxu;Ldpk;)Ldxu;
-
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 named appendProperties
Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
intermediary method_9515
Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
official a
Ldkl;a(Ldxv$a;)V
-