Class LeverBlock
- All Implemented Interfaces:
ItemConvertible
,ToggleableFeature
- Mappings:
Namespace Name official cxf
intermediary net/minecraft/class_2401
named net/minecraft/block/LeverBlock
-
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.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
protected static final int
protected static final int
protected static final int
protected static final VoxelShape
protected static final VoxelShape
protected static final VoxelShape
static final BooleanProperty
protected static final VoxelShape
protected static final VoxelShape
Fields inherited from class net.minecraft.block.WallMountedBlock
FACE
Fields inherited from class net.minecraft.block.HorizontalFacingBlock
FACING
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, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableId, 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.getOutlineShape
(BlockState state, BlockView world, BlockPos pos, ShapeContext context) 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.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.onUse
(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) Called when this block is used by a player.void
randomDisplayTick
(BlockState state, World world, BlockPos pos, Random random) Called randomly on the client.private static void
spawnParticles
(BlockState state, WorldAccess world, BlockPos pos, float alpha) togglePower
(BlockState state, World world, BlockPos pos) private void
updateNeighbors
(BlockState state, World world, BlockPos pos) Methods inherited from class net.minecraft.block.WallMountedBlock
canPlaceAt, canPlaceAt, getDirection, getPlacementState, getStateForNeighborUpdate
Methods inherited from class net.minecraft.block.HorizontalFacingBlock
mirror, rotate
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, getSoundGroup, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTransparent, 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, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSidesShape, getVerticalModelOffsetMultiplier, hasComparatorOutput, hasSidedTransparency, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onSyncedBlockEvent, prepare, randomTick, scheduledTick
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
-
POWERED
- Mappings:
Namespace Name Mixin selector official a
Lcxf;a:Ldga;
intermediary field_11265
Lnet/minecraft/class_2401;field_11265:Lnet/minecraft/class_2746;
named POWERED
Lnet/minecraft/block/LeverBlock;POWERED:Lnet/minecraft/state/property/BooleanProperty;
-
field_31184
protected static final int field_31184- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lcxf;b:I
intermediary field_31184
Lnet/minecraft/class_2401;field_31184:I
named field_31184
Lnet/minecraft/block/LeverBlock;field_31184:I
-
field_31185
protected static final int field_31185- See Also:
- Mappings:
Namespace Name Mixin selector official c
Lcxf;c:I
intermediary field_31185
Lnet/minecraft/class_2401;field_31185:I
named field_31185
Lnet/minecraft/block/LeverBlock;field_31185:I
-
field_31186
protected static final int field_31186- See Also:
- Mappings:
Namespace Name Mixin selector official d
Lcxf;d:I
intermediary field_31186
Lnet/minecraft/class_2401;field_31186:I
named field_31186
Lnet/minecraft/block/LeverBlock;field_31186:I
-
NORTH_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector official e
Lcxf;e:Leig;
intermediary field_11267
Lnet/minecraft/class_2401;field_11267:Lnet/minecraft/class_265;
named NORTH_WALL_SHAPE
Lnet/minecraft/block/LeverBlock;NORTH_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
SOUTH_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector official f
Lcxf;f:Leig;
intermediary field_11263
Lnet/minecraft/class_2401;field_11263:Lnet/minecraft/class_265;
named SOUTH_WALL_SHAPE
Lnet/minecraft/block/LeverBlock;SOUTH_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
WEST_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector official g
Lcxf;g:Leig;
intermediary field_11260
Lnet/minecraft/class_2401;field_11260:Lnet/minecraft/class_265;
named WEST_WALL_SHAPE
Lnet/minecraft/block/LeverBlock;WEST_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
EAST_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector official h
Lcxf;h:Leig;
intermediary field_11262
Lnet/minecraft/class_2401;field_11262:Lnet/minecraft/class_265;
named EAST_WALL_SHAPE
Lnet/minecraft/block/LeverBlock;EAST_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
FLOOR_Z_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector official i
Lcxf;i:Leig;
intermediary field_11264
Lnet/minecraft/class_2401;field_11264:Lnet/minecraft/class_265;
named FLOOR_Z_AXIS_SHAPE
Lnet/minecraft/block/LeverBlock;FLOOR_Z_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
FLOOR_X_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector official j
Lcxf;j:Leig;
intermediary field_11261
Lnet/minecraft/class_2401;field_11261:Lnet/minecraft/class_265;
named FLOOR_X_AXIS_SHAPE
Lnet/minecraft/block/LeverBlock;FLOOR_X_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
CEILING_Z_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector official k
Lcxf;k:Leig;
intermediary field_11268
Lnet/minecraft/class_2401;field_11268:Lnet/minecraft/class_265;
named CEILING_Z_AXIS_SHAPE
Lnet/minecraft/block/LeverBlock;CEILING_Z_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
CEILING_X_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector official l
Lcxf;l:Leig;
intermediary field_11266
Lnet/minecraft/class_2401;field_11266:Lnet/minecraft/class_265;
named CEILING_X_AXIS_SHAPE
Lnet/minecraft/block/LeverBlock;CEILING_X_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
-
Constructor Details
-
LeverBlock
- Mappings:
Namespace Name Mixin selector official <init>
Ldfi;<init>(Ldfi$d;)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
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) - Overrides:
getOutlineShape
in classAbstractBlock
- Mappings:
Namespace Name Mixin selector official a
Ldfi;a(Ldfj;Lcpb;Lgw;Lehs;)Leig;
intermediary method_9530
Lnet/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;
named getOutlineShape
Lnet/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;
-
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:
onUse
in classAbstractBlock
- Returns:
- an action result that specifies if using the block was successful.
- Mappings:
Namespace Name Mixin selector official a
Ldfi;a(Ldfj;Lcpv;Lgw;Lcbu;Lbgx;Lehj;)Lbgy;
intermediary method_9534
Lnet/minecraft/class_4970;method_9534(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_3965;)Lnet/minecraft/class_1269;
named onUse
Lnet/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/Hand;Lnet/minecraft/util/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;
-
togglePower
- Mappings:
Namespace Name Mixin selector official d
Lcxf;d(Ldfj;Lcpv;Lgw;)Ldfj;
intermediary method_21846
Lnet/minecraft/class_2401;method_21846(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;
named togglePower
Lnet/minecraft/block/LeverBlock;togglePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;
-
spawnParticles
- Mappings:
Namespace Name Mixin selector official a
Lcxf;a(Ldfj;Lcpw;Lgw;F)V
intermediary method_10308
Lnet/minecraft/class_2401;method_10308(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;F)V
named spawnParticles
Lnet/minecraft/block/LeverBlock;spawnParticles(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;F)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:
randomDisplayTick
in classBlock
- Mappings:
Namespace Name Mixin selector official a
Lcsv;a(Ldfj;Lcpv;Lgw;Lasc;)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
-
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
Ldfi;a(Ldfj;Lcpv;Lgw;Ldfj;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
Ldfi;a(Ldfj;Lcpb;Lgw;Lha;)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
-
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
Ldfi;b(Ldfj;Lcpb;Lgw;Lha;)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
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 official f_
Ldfi;f_(Ldfj;)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
-
updateNeighbors
- Mappings:
Namespace Name Mixin selector official e
Lcxf;e(Ldfj;Lcpv;Lgw;)V
intermediary method_10309
Lnet/minecraft/class_2401;method_10309(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)V
named updateNeighbors
Lnet/minecraft/block/LeverBlock;updateNeighbors(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)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
Lcsv;a(Ldfk$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
-