Class LeverBlock
- All Implemented Interfaces:
ItemConvertible,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/LeverBlockintermediary net/minecraft/class_2401official djo
-
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 TypeFieldDescriptionprotected static final VoxelShapeprotected static final VoxelShapestatic final com.mojang.serialization.MapCodec<LeverBlock> protected static final VoxelShapeprotected static final intprotected static final intprotected static final intprotected static final VoxelShapeprotected static final VoxelShapeprotected static final VoxelShapestatic final BooleanPropertyprotected static final VoxelShapeprotected static final VoxelShapeFields inherited from class net.minecraft.block.WallMountedBlock
FACEFields inherited from class net.minecraft.block.HorizontalFacingBlock
FACINGFields 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 TypeMethodDescriptionprotected voidappendProperties(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.protected booleanemitsRedstonePower(BlockState state) Returns whether the block is capable of emitting redstone power.com.mojang.serialization.MapCodec<LeverBlock> getCodec()protected VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) 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.protected voidonExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) 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) voidrandomDisplayTick(BlockState state, World world, BlockPos pos, Random random) Called randomly on the client.private static voidspawnParticles(BlockState state, WorldAccess world, BlockPos pos, float alpha) togglePower(BlockState state, World world, BlockPos pos) private voidupdateNeighbors(BlockState state, World world, BlockPos pos) Methods inherited from class net.minecraft.block.WallMountedBlock
canPlaceAt, canPlaceAt, getDirection, getPlacementState, getStateForNeighborUpdateMethods inherited from class net.minecraft.block.HorizontalFacingBlock
mirror, rotateMethods 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, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onSyncedBlockEvent, onUseWithItem, prepare, 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/LeverBlock;CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_46387Lnet/minecraft/class_2401;field_46387:Lcom/mojang/serialization/MapCodec;official aLdjo;a:Lcom/mojang/serialization/MapCodec;
-
POWERED
- Mappings:
Namespace Name Mixin selector named POWEREDLnet/minecraft/block/LeverBlock;POWERED:Lnet/minecraft/state/property/BooleanProperty;intermediary field_11265Lnet/minecraft/class_2401;field_11265:Lnet/minecraft/class_2746;official bLdjo;b:Ldsv;
-
field_31184
protected static final int field_31184- See Also:
- Mappings:
Namespace Name Mixin selector named field_31184Lnet/minecraft/block/LeverBlock;field_31184:Iintermediary field_31184Lnet/minecraft/class_2401;field_31184:Iofficial cLdjo;c:I
-
field_31185
protected static final int field_31185- See Also:
- Mappings:
Namespace Name Mixin selector named field_31185Lnet/minecraft/block/LeverBlock;field_31185:Iintermediary field_31185Lnet/minecraft/class_2401;field_31185:Iofficial dLdjo;d:I
-
field_31186
protected static final int field_31186- See Also:
- Mappings:
Namespace Name Mixin selector named field_31186Lnet/minecraft/block/LeverBlock;field_31186:Iintermediary field_31186Lnet/minecraft/class_2401;field_31186:Iofficial eLdjo;e:I
-
NORTH_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector named NORTH_WALL_SHAPELnet/minecraft/block/LeverBlock;NORTH_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11267Lnet/minecraft/class_2401;field_11267:Lnet/minecraft/class_265;official fLdjo;f:Lewm;
-
SOUTH_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector named SOUTH_WALL_SHAPELnet/minecraft/block/LeverBlock;SOUTH_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11263Lnet/minecraft/class_2401;field_11263:Lnet/minecraft/class_265;official gLdjo;g:Lewm;
-
WEST_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector named WEST_WALL_SHAPELnet/minecraft/block/LeverBlock;WEST_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11260Lnet/minecraft/class_2401;field_11260:Lnet/minecraft/class_265;official hLdjo;h:Lewm;
-
EAST_WALL_SHAPE
- Mappings:
Namespace Name Mixin selector named EAST_WALL_SHAPELnet/minecraft/block/LeverBlock;EAST_WALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11262Lnet/minecraft/class_2401;field_11262:Lnet/minecraft/class_265;official iLdjo;i:Lewm;
-
FLOOR_Z_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector named FLOOR_Z_AXIS_SHAPELnet/minecraft/block/LeverBlock;FLOOR_Z_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11264Lnet/minecraft/class_2401;field_11264:Lnet/minecraft/class_265;official jLdjo;j:Lewm;
-
FLOOR_X_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector named FLOOR_X_AXIS_SHAPELnet/minecraft/block/LeverBlock;FLOOR_X_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11261Lnet/minecraft/class_2401;field_11261:Lnet/minecraft/class_265;official kLdjo;k:Lewm;
-
CEILING_Z_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector named CEILING_Z_AXIS_SHAPELnet/minecraft/block/LeverBlock;CEILING_Z_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11268Lnet/minecraft/class_2401;field_11268:Lnet/minecraft/class_265;official lLdjo;l:Lewm;
-
CEILING_X_AXIS_SHAPE
- Mappings:
Namespace Name Mixin selector named CEILING_X_AXIS_SHAPELnet/minecraft/block/LeverBlock;CEILING_X_AXIS_SHAPE:Lnet/minecraft/util/shape/VoxelShape;intermediary field_11266Lnet/minecraft/class_2401;field_11266:Lnet/minecraft/class_265;official mLdjo;m:Lewm;
-
-
Constructor Details
-
LeverBlock
- 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>Ldsd;<init>(Ldsd$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodecin classWallMountedBlock- 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 aLdsd;a()Lcom/mojang/serialization/MapCodec;
-
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 aLdsd;a(Ldse;Ldbg;Liz;Levy;)Lewm;
-
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 aLdsd;a(Ldse;Ldca;Liz;Lcmz;Levp;)Lbqw;
-
onExploded
protected void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) - Overrides:
onExplodedin classAbstractBlock- Mappings:
Namespace Name Mixin selector named onExplodedLnet/minecraft/block/AbstractBlock;onExploded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/explosion/Explosion;Ljava/util/function/BiConsumer;)Vintermediary method_55124Lnet/minecraft/class_4970;method_55124(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1927;Ljava/util/function/BiConsumer;)Vofficial aLdsd;a(Ldse;Ldca;Liz;Ldbs;Ljava/util/function/BiConsumer;)V
-
togglePower
- Mappings:
Namespace Name Mixin selector named togglePowerLnet/minecraft/block/LeverBlock;togglePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;intermediary method_21846Lnet/minecraft/class_2401;method_21846(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;official dLdjo;d(Ldse;Ldca;Liz;)Ldse;
-
spawnParticles
- Mappings:
Namespace Name Mixin selector named spawnParticlesLnet/minecraft/block/LeverBlock;spawnParticles(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;F)Vintermediary method_10308Lnet/minecraft/class_2401;method_10308(Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;F)Vofficial aLdjo;a(Ldse;Ldcb;Liz;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:
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 aLdfb;a(Ldse;Ldca;Liz;Lazh;)V
-
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 aLdsd;a(Ldse;Ldca;Liz;Ldse;Z)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,
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 aLdsd;a(Ldse;Ldbg;Liz;Lje;)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,
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 bLdsd;b(Ldse;Ldbg;Liz;Lje;)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:
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_Ldsd;e_(Ldse;)Z
-
updateNeighbors
- Mappings:
Namespace Name Mixin selector named updateNeighborsLnet/minecraft/block/LeverBlock;updateNeighbors(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Vintermediary method_10309Lnet/minecraft/class_2401;method_10309(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Vofficial eLdjo;e(Ldse;Ldca;Liz;)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. 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 aLdfb;a(Ldsf$a;)V
-