Class ChiseledBookshelfBlock

All Implemented Interfaces:
BlockEntityProvider, ItemConvertible, ToggleableFeature

public class ChiseledBookshelfBlock extends BlockWithEntity
Mappings:
Namespace Name
official cty
intermediary net/minecraft/class_7714
named net/minecraft/block/ChiseledBookshelfBlock
  • Field Details

    • MAX_BOOK_COUNT

      private static final int MAX_BOOK_COUNT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official c Lcty;c:I
      intermediary field_41309 Lnet/minecraft/class_7714;field_41309:I
      named MAX_BOOK_COUNT Lnet/minecraft/block/ChiseledBookshelfBlock;MAX_BOOK_COUNT:I
    • BOOK_HEIGHT

      public static final int BOOK_HEIGHT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcty;a:I
      intermediary field_41307 Lnet/minecraft/class_7714;field_41307:I
      named BOOK_HEIGHT Lnet/minecraft/block/ChiseledBookshelfBlock;BOOK_HEIGHT:I
    • SLOT_OCCUPIED_PROPERTIES

      public static final List<BooleanProperty> SLOT_OCCUPIED_PROPERTIES
      Mappings:
      Namespace Name Mixin selector
      official b Lcty;b:Ljava/util/List;
      intermediary field_41308 Lnet/minecraft/class_7714;field_41308:Ljava/util/List;
      named SLOT_OCCUPIED_PROPERTIES Lnet/minecraft/block/ChiseledBookshelfBlock;SLOT_OCCUPIED_PROPERTIES:Ljava/util/List;
  • Constructor Details

    • ChiseledBookshelfBlock

      public ChiseledBookshelfBlock(AbstractBlock.Settings settings)
      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

    • getRenderType

      public BlockRenderType getRenderType(BlockState state)
      Returns the block's render type (invisible, animated, model).
      Overrides:
      getRenderType in class BlockWithEntity
      Returns:
      the block's render type (invisible, animated, model)
      Mappings:
      Namespace Name Mixin selector
      official b_ Ldfi;b_(Ldfj;)Lcza;
      intermediary method_9604 Lnet/minecraft/class_4970;method_9604(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2464;
      named getRenderType Lnet/minecraft/block/AbstractBlock;getRenderType(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockRenderType;
    • 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 class AbstractBlock
      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;
    • getHitPos

      private static Optional<Vec2f> getHitPos(BlockHitResult hit, Direction facing)
      Mappings:
      Namespace Name Mixin selector
      official a Lcty;a(Lehj;Lha;)Ljava/util/Optional;
      intermediary method_47579 Lnet/minecraft/class_7714;method_47579(Lnet/minecraft/class_3965;Lnet/minecraft/class_2350;)Ljava/util/Optional;
      named getHitPos Lnet/minecraft/block/ChiseledBookshelfBlock;getHitPos(Lnet/minecraft/util/hit/BlockHitResult;Lnet/minecraft/util/math/Direction;)Ljava/util/Optional;
    • getSlotForHitPos

      private static int getSlotForHitPos(Vec2f hitPos)
      Mappings:
      Namespace Name Mixin selector
      official a Lcty;a(Lehm;)I
      intermediary method_47580 Lnet/minecraft/class_7714;method_47580(Lnet/minecraft/class_241;)I
      named getSlotForHitPos Lnet/minecraft/block/ChiseledBookshelfBlock;getSlotForHitPos(Lnet/minecraft/util/math/Vec2f;)I
    • getColumn

      private static int getColumn(float x)
      Mappings:
      Namespace Name Mixin selector
      official a Lcty;a(F)I
      intermediary method_47577 Lnet/minecraft/class_7714;method_47577(F)I
      named getColumn Lnet/minecraft/block/ChiseledBookshelfBlock;getColumn(F)I
    • tryAddBook

      private static void tryAddBook(World world, BlockPos pos, PlayerEntity player, ChiseledBookshelfBlockEntity blockEntity, ItemStack stack, int slot)
      Mappings:
      Namespace Name Mixin selector
      official a Lcty;a(Lcpv;Lgw;Lcbu;Ldde;Lcjf;I)V
      intermediary method_45458 Lnet/minecraft/class_7714;method_45458(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_7716;Lnet/minecraft/class_1799;I)V
      named tryAddBook Lnet/minecraft/block/ChiseledBookshelfBlock;tryAddBook(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;Lnet/minecraft/item/ItemStack;I)V
    • tryRemoveBook

      private static void tryRemoveBook(World world, BlockPos pos, PlayerEntity player, ChiseledBookshelfBlockEntity blockEntity, int slot)
      Mappings:
      Namespace Name Mixin selector
      official a Lcty;a(Lcpv;Lgw;Lcbu;Ldde;I)V
      intermediary method_45457 Lnet/minecraft/class_7714;method_45457(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_7716;I)V
      named tryRemoveBook Lnet/minecraft/block/ChiseledBookshelfBlock;tryRemoveBook(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/block/entity/ChiseledBookshelfBlockEntity;I)V
    • createBlockEntity

      @Nullable public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state)
      Returns a new block entity instance.

      For example:

      
       @Override
       public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
         return new MyBlockEntity(pos, state);
       }
       
      Returns:
      a new block entity instance
      Mappings:
      Namespace Name Mixin selector
      official a Lcvj;a(Lgw;Ldfj;)Ldcv;
      intermediary method_10123 Lnet/minecraft/class_2343;method_10123(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_2586;
      named createBlockEntity Lnet/minecraft/block/BlockEntityProvider;createBlockEntity(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/entity/BlockEntity;
    • appendProperties

      protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
      Appends block state properties to this block. To use this, override and call StateManager.Builder.add(net.minecraft.state.property.Property<?>[]) inside the method. See Properties for the list of pre-defined properties.
      Overrides:
      appendProperties in class Block
      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
    • 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 check state.isOf(newState.getBlock()) can be used to see if the block was removed or not.
      Overrides:
      onStateReplaced in class AbstractBlock
      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
    • getPlacementState

      public BlockState getPlacementState(ItemPlacementContext ctx)
      Overrides:
      getPlacementState in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lcsv;a(Lcln;)Ldfj;
      intermediary method_9605 Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;
      named getPlacementState Lnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
    • rotate

      public BlockState rotate(BlockState state, BlockRotation rotation)
      Returns state rotated by rotation.

      By default, this returns the provided block state.

      Overrides:
      rotate in class AbstractBlock
      Returns:
      state rotated by rotation
      Mappings:
      Namespace Name Mixin selector
      official a Ldfi;a(Ldfj;Lczh;)Ldfj;
      intermediary method_9598 Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;
      named rotate Lnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;
    • mirror

      public BlockState mirror(BlockState state, BlockMirror mirror)
      Returns state mirrored by mirror.

      By default, this returns the provided block state.

      Overrides:
      mirror in class AbstractBlock
      Returns:
      state mirrored by mirror
      Mappings:
      Namespace Name Mixin selector
      official a Ldfi;a(Ldfj;Lcxq;)Ldfj;
      intermediary method_9569 Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;
      named mirror Lnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;
    • hasComparatorOutput

      public boolean hasComparatorOutput(BlockState state)
      Returns whether the block can have a comparator output.

      This does not check the current comparator output of the block. Use AbstractBlock.getComparatorOutput(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos) in that case.

      Overrides:
      hasComparatorOutput in class AbstractBlock
      Returns:
      whether the block can have a comparator output
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official d_ Ldfi;d_(Ldfj;)Z
      intermediary method_9498 Lnet/minecraft/class_4970;method_9498(Lnet/minecraft/class_2680;)Z
      named hasComparatorOutput Lnet/minecraft/block/AbstractBlock;hasComparatorOutput(Lnet/minecraft/block/BlockState;)Z
    • getComparatorOutput

      public int getComparatorOutput(BlockState state, World world, BlockPos pos)
      Returns the comparator output of the block, from 0 to 15.

      When overriding this, AbstractBlock.hasComparatorOutput(net.minecraft.block.BlockState) must also be overridden.

      Overrides:
      getComparatorOutput in class AbstractBlock
      Returns:
      the comparator output of the block, from 0 to 15
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldfi;a(Ldfj;Lcpv;Lgw;)I
      intermediary method_9572 Lnet/minecraft/class_4970;method_9572(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)I
      named getComparatorOutput Lnet/minecraft/block/AbstractBlock;getComparatorOutput(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I