Class ShelfBlock
- All Implemented Interfaces:
BlockEntityProvider,FluidDrainable,FluidFillable,InteractibleSlotContainer,SideChaining,Waterloggable,ItemConvertible,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/ShelfBlockintermediary net/minecraft/class_11586official ecg
-
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>Nested classes/interfaces inherited from interface net.minecraft.block.SideChaining
SideChaining.EmptyNeighbor, SideChaining.Neighbor, SideChaining.Neighbors, SideChaining.SideChainNeighbor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ShelfBlock> static final EnumProperty<Direction> static final BooleanPropertyprivate static final Map<Direction, VoxelShape> static final EnumProperty<SideChainPart> static final BooleanPropertyFields inherited from class net.minecraft.block.Block
field_31023, field_31024, field_31025, FORCE_STATE, FORCE_STATE_AND_SKIP_CALLBACKS_AND_DROPS, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_ALL_AND_REDRAW, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_BLOCK_ADDED_CALLBACK, SKIP_BLOCK_ENTITY_REPLACED_CALLBACK, SKIP_DROPS, SKIP_REDRAW_AND_BLOCK_ENTITY_REPLACED_CALLBACK, SKIP_REDSTONE_WIRE_STATE_REPLACEMENT, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, translationKey, 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.booleancanChainWith(BlockState state) protected booleancanPathfindThrough(BlockState state, NavigationType type) Returns if an entity using navigation typetypecan navigate through this block.createBlockEntity(BlockPos pos, BlockState state) Returns a new block entity instance.com.mojang.serialization.MapCodec<ShelfBlock> getCodec()intprotected intgetComparatorOutput(BlockState state, World world, BlockPos pos, Direction direction) Returns the comparator output of the block, from0to15.getFacing(BlockState state) protected FluidStategetFluidState(BlockState state) Returns the state's associated fluid state.intprotected VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) intgetRows()getSideChainPart(BlockState state) protected BlockStategetStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) Returns the state of the block after a neighboring block's state change.protected booleanhasComparatorOutput(BlockState state) Returns whether the block can have a comparator output.protected booleanhasSidedTransparency(BlockState state) Returns whether the block's transparency depends on the side of the block, like slabs.mirror(BlockState state, BlockMirror mirror) Returnsstatemirrored bymirror.protected voidneighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, @Nullable WireOrientation wireOrientation, 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, ServerWorld world, BlockPos pos, boolean moved) protected ActionResultonUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) private voidplaySound(WorldAccess world, BlockPos pos, SoundEvent sound) rotate(BlockState state, BlockRotation rotation) Returnsstaterotated byrotation.private booleanswapAllStacks(World world, BlockPos pos, PlayerInventory playerInventory) private static booleanswapSingleStack(ItemStack stack, PlayerEntity player, ShelfBlockEntity blockEntity, int hitSlot, PlayerInventory playerInventory) withSideChainPart(BlockState state, SideChainPart sideChainPart) Methods inherited from class net.minecraft.block.BlockWithEntity
createScreenHandlerFactory, onSyncedBlockEvent, validateTickerMethods inherited from class net.minecraft.block.Block
afterBreak, asBlock, asItem, canMobSpawnInside, cannotConnect, createColumnShape, createColumnShape, createCubeShape, createCuboidShape, createCuboidShape, createCuboidZShape, createCuboidZShape, createCuboidZShape, createShapeArray, createShapeFunction, createShapeFunction, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, generateBlockInteractLoot, generateLoot, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getRawIdFromState, getRegistryEntry, 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, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createCodec, createSettingsCodec, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getCullingShape, getDefaultMapColor, getDroppedStacks, getHardness, getInsideCollisionShape, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getPickStack, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getStrongRedstonePower, getTranslationKey, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasRandomTicks, isShapeFullCube, isSideInvisible, isTransparent, keepBlockEntityWhenReplacedWith, onBlockBreakStart, onEntityCollision, onExploded, onProjectileHit, onStacksDropped, onUse, prepare, randomTick, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.block.BlockEntityProvider
getGameEventListener, getTickerMethods inherited from interface net.minecraft.block.InteractibleSlotContainer
getHitSlotMethods inherited from interface net.minecraft.block.SideChaining
connectNeighbors, disconnectNeighbors, getPositionsInChain, setSideChainPartMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabledMethods inherited from interface net.minecraft.block.Waterloggable
canFillWithFluid, getBucketFillSound, tryDrainFluid, tryFillWithFluid
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/block/ShelfBlock;CODEC:Lcom/mojang/serialization/MapCodec;intermediary field_61423Lnet/minecraft/class_11586;field_61423:Lcom/mojang/serialization/MapCodec;official aLecg;a:Lcom/mojang/serialization/MapCodec;
-
POWERED
- Mappings:
Namespace Name Mixin selector named POWEREDLnet/minecraft/block/ShelfBlock;POWERED:Lnet/minecraft/state/property/BooleanProperty;intermediary field_61424Lnet/minecraft/class_11586;field_61424:Lnet/minecraft/class_2746;official bLecg;b:Lekd;
-
FACING
- Mappings:
Namespace Name Mixin selector named FACINGLnet/minecraft/block/ShelfBlock;FACING:Lnet/minecraft/state/property/EnumProperty;intermediary field_61425Lnet/minecraft/class_11586;field_61425:Lnet/minecraft/class_2754;official cLecg;c:Lekk;
-
SIDE_CHAIN
- Mappings:
Namespace Name Mixin selector named SIDE_CHAINLnet/minecraft/block/ShelfBlock;SIDE_CHAIN:Lnet/minecraft/state/property/EnumProperty;intermediary field_61426Lnet/minecraft/class_11586;field_61426:Lnet/minecraft/class_2754;official dLecg;d:Lekk;
-
WATERLOGGED
- Mappings:
Namespace Name Mixin selector named WATERLOGGEDLnet/minecraft/block/ShelfBlock;WATERLOGGED:Lnet/minecraft/state/property/BooleanProperty;intermediary field_61427Lnet/minecraft/class_11586;field_61427:Lnet/minecraft/class_2746;official eLecg;e:Lekd;
-
SHAPES
- Mappings:
Namespace Name Mixin selector named SHAPESLnet/minecraft/block/ShelfBlock;SHAPES:Ljava/util/Map;intermediary field_61428Lnet/minecraft/class_11586;field_61428:Ljava/util/Map;official fLecg;f:Ljava/util/Map;
-
-
Constructor Details
-
ShelfBlock
- 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>Lejl;<init>(Lejl$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodecin classBlockWithEntity- 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 aLejl;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 aLejl;a(Lejm;Ldqu;Lja;Lfom;)Lfpc;
-
hasSidedTransparency
Returns whether the block's transparency depends on the side of the block, like slabs.- Overrides:
hasSidedTransparencyin classAbstractBlock- Returns:
- whether the block's transparency depends on the side of the block, like slabs
- See Also:
- Mappings:
Namespace Name Mixin selector named hasSidedTransparencyLnet/minecraft/block/AbstractBlock;hasSidedTransparency(Lnet/minecraft/block/BlockState;)Zintermediary method_9526Lnet/minecraft/class_4970;method_9526(Lnet/minecraft/class_2680;)Zofficial g_Lejl;g_(Lejm;)Z
-
createBlockEntity
Returns a new block entity instance.For example:
@Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { return new MyBlockEntity(pos, state); }- Specified by:
createBlockEntityin interfaceBlockEntityProvider- Returns:
- a new block entity instance
- Implementation Note:
- While this is marked as nullable, in practice this should never return
null.PistonExtensionBlockis the only block in vanilla that returnsnullinside the implementation. - Mappings:
Namespace Name Mixin selector named createBlockEntityLnet/minecraft/block/BlockEntityProvider;createBlockEntity(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/entity/BlockEntity;intermediary method_10123Lnet/minecraft/class_2343;method_10123(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_2586;official aLdxs;a(Lja;Lejm;)Legg;
-
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 aLduv;a(Lejn$a;)V
-
onStateReplaced
- Overrides:
onStateReplacedin classAbstractBlock- Mappings:
Namespace Name Mixin selector named onStateReplacedLnet/minecraft/block/AbstractBlock;onStateReplaced(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Z)Vintermediary method_66388Lnet/minecraft/class_4970;method_66388(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Z)Vofficial aLejl;a(Lejm;Lawx;Lja;Z)V
-
neighborUpdate
protected void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, @Nullable @Nullable WireOrientation wireOrientation, 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.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)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/world/block/WireOrientation;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_9904;Z)Vofficial aLejl;a(Lejm;Ldrq;Lja;Lduv;Lfhi;Z)V
-
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 aLduv;a(Ldlk;)Lejm;
-
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 aLejl;a(Lejm;Lebr;)Lejm;
-
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 aLejl;a(Lejm;Leaa;)Lejm;
-
getRows
public int getRows()- Specified by:
getRowsin interfaceInteractibleSlotContainer- Mappings:
Namespace Name Mixin selector named getRowsLnet/minecraft/block/InteractibleSlotContainer;getRows()Iintermediary method_72586Lnet/minecraft/class_11585;method_72586()Iofficial bLecf;b()I
-
getColumns
public int getColumns()- Specified by:
getColumnsin interfaceInteractibleSlotContainer- Mappings:
Namespace Name Mixin selector named getColumnsLnet/minecraft/block/InteractibleSlotContainer;getColumns()Iintermediary method_72587Lnet/minecraft/class_11585;method_72587()Iofficial cLecf;c()I
-
onUseWithItem
protected ActionResult onUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) - Overrides:
onUseWithItemin classAbstractBlock- Mappings:
Namespace Name Mixin selector named onUseWithItemLnet/minecraft/block/AbstractBlock;onUseWithItem(Lnet/minecraft/item/ItemStack;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;intermediary method_55765Lnet/minecraft/class_4970;method_55765(Lnet/minecraft/class_1799;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;official aLejl;a(Ldhp;Lejm;Ldrq;Lja;Lczl;Lcbp;Lfod;)Lcbq;
-
swapSingleStack
private static boolean swapSingleStack(ItemStack stack, PlayerEntity player, ShelfBlockEntity blockEntity, int hitSlot, PlayerInventory playerInventory) - Mappings:
Namespace Name Mixin selector named swapSingleStackLnet/minecraft/block/ShelfBlock;swapSingleStack(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/block/entity/ShelfBlockEntity;ILnet/minecraft/entity/player/PlayerInventory;)Zintermediary method_72614Lnet/minecraft/class_11586;method_72614(Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;Lnet/minecraft/class_11597;ILnet/minecraft/class_1661;)Zofficial aLecg;a(Ldhp;Lczl;Lehv;ILczk;)Z
-
swapAllStacks
- Mappings:
Namespace Name Mixin selector named swapAllStacksLnet/minecraft/block/ShelfBlock;swapAllStacks(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerInventory;)Zintermediary method_72615Lnet/minecraft/class_11586;method_72615(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1661;)Zofficial aLecg;a(Ldrq;Lja;Lczk;)Z
-
getSideChainPart
- Specified by:
getSideChainPartin interfaceSideChaining- Mappings:
Namespace Name Mixin selector named getSideChainPartLnet/minecraft/block/SideChaining;getSideChainPart(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/enums/SideChainPart;intermediary method_72619Lnet/minecraft/class_11587;method_72619(Lnet/minecraft/class_2680;)Lnet/minecraft/class_11598;official pLecj;p(Lejm;)Leku;
-
withSideChainPart
- Specified by:
withSideChainPartin interfaceSideChaining- Mappings:
Namespace Name Mixin selector named withSideChainPartLnet/minecraft/block/SideChaining;withSideChainPart(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/enums/SideChainPart;)Lnet/minecraft/block/BlockState;intermediary method_72617Lnet/minecraft/class_11587;method_72617(Lnet/minecraft/class_2680;Lnet/minecraft/class_11598;)Lnet/minecraft/class_2680;official aLecj;a(Lejm;Leku;)Lejm;
-
getFacing
- Specified by:
getFacingin interfaceSideChaining- Mappings:
Namespace Name Mixin selector named getFacingLnet/minecraft/block/SideChaining;getFacing(Lnet/minecraft/block/BlockState;)Lnet/minecraft/util/math/Direction;intermediary method_72620Lnet/minecraft/class_11587;method_72620(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2350;official rLecj;r(Lejm;)Ljg;
-
canChainWith
- Specified by:
canChainWithin interfaceSideChaining- Mappings:
Namespace Name Mixin selector named canChainWithLnet/minecraft/block/SideChaining;canChainWith(Lnet/minecraft/block/BlockState;)Zintermediary method_72621Lnet/minecraft/class_11587;method_72621(Lnet/minecraft/class_2680;)Zofficial sLecj;s(Lejm;)Z
-
getMaxSideChainLength
public int getMaxSideChainLength()- Specified by:
getMaxSideChainLengthin interfaceSideChaining- Mappings:
Namespace Name Mixin selector named getMaxSideChainLengthLnet/minecraft/block/SideChaining;getMaxSideChainLength()Iintermediary method_72618Lnet/minecraft/class_11587;method_72618()Iofficial dLecj;d()I
-
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.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)orneighborUpdate(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
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:
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 aLejl;a(Lejm;Ldrq;Lja;Lejm;Z)V
- When activating a redstone component on placement (used along with
-
playSound
- Mappings:
Namespace Name Mixin selector named playSoundLnet/minecraft/block/ShelfBlock;playSound(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/sound/SoundEvent;)Vintermediary method_72616Lnet/minecraft/class_11586;method_72616(Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_3414;)Vofficial aLecg;a(Ldrr;Lja;Lbcd;)V
-
getFluidState
Returns the state's associated fluid state.Waterloggable blocks must override this to return
Fluids.WATER.getStill(false)when waterlogged.- Overrides:
getFluidStatein classAbstractBlock- Returns:
- the state's associated fluid state
- See Also:
- Mappings:
Namespace Name Mixin selector named getFluidStateLnet/minecraft/block/AbstractBlock;getFluidState(Lnet/minecraft/block/BlockState;)Lnet/minecraft/fluid/FluidState;intermediary method_9545Lnet/minecraft/class_4970;method_9545(Lnet/minecraft/class_2680;)Lnet/minecraft/class_3610;official b_Lejl;b_(Lejm;)Lfga;
-
getStateForNeighborUpdate
protected BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) 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 withAbstractBlock.canPlaceAt(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.world.block.WireOrientation, 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 blockworld- the worldpos- the position of this blockdirection- the direction from this block to the neighborneighborPos- the position of the neighbor blockneighborState- the state of the updated 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/world/WorldView;Lnet/minecraft/world/tick/ScheduledTickView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/random/Random;)Lnet/minecraft/block/BlockState;intermediary method_9559Lnet/minecraft/class_4970;method_9559(Lnet/minecraft/class_2680;Lnet/minecraft/class_4538;Lnet/minecraft/class_10225;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_5819;)Lnet/minecraft/class_2680;official aLejl;a(Lejm;Ldrt;Ldsf;Lja;Ljg;Lja;Lejm;Lbfq;)Lejm;
-
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, net.minecraft.util.math.Direction)in that case.- Overrides:
hasComparatorOutputin classAbstractBlock- Returns:
- whether the block can have a comparator output
- See Also:
- Mappings:
Namespace Name Mixin selector named hasComparatorOutputLnet/minecraft/block/AbstractBlock;hasComparatorOutput(Lnet/minecraft/block/BlockState;)Zintermediary method_9498Lnet/minecraft/class_4970;method_9498(Lnet/minecraft/class_2680;)Zofficial c_Lejl;c_(Lejm;)Z
-
getComparatorOutput
Returns the comparator output of the block, from0to15.When overriding this,
hasComparatorOutput(net.minecraft.block.BlockState)must also be overridden.- Overrides:
getComparatorOutputin classAbstractBlock- Returns:
- the comparator output of the block, from
0to15 - See Also:
- Mappings:
Namespace Name Mixin selector named getComparatorOutputLnet/minecraft/block/AbstractBlock;getComparatorOutput(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Iintermediary method_9572Lnet/minecraft/class_4970;method_9572(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)Iofficial aLejl;a(Lejm;Ldrq;Lja;Ljg;)I
-