Class EnchantingTableBlock

All Implemented Interfaces:
BlockEntityProvider, ItemConvertible, ToggleableFeature

public class EnchantingTableBlock extends BlockWithEntity
Mappings:
Namespace Name
named net/minecraft/block/EnchantingTableBlock
intermediary net/minecraft/class_2331
official dmz
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<EnchantingTableBlock> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/block/EnchantingTableBlock;CODEC:Lcom/mojang/serialization/MapCodec;
      intermediary field_46342 Lnet/minecraft/class_2331;field_46342:Lcom/mojang/serialization/MapCodec;
      official a Ldmz;a:Lcom/mojang/serialization/MapCodec;
    • SHAPE

      protected static final VoxelShape SHAPE
      Mappings:
      Namespace Name Mixin selector
      named SHAPE Lnet/minecraft/block/EnchantingTableBlock;SHAPE:Lnet/minecraft/util/shape/VoxelShape;
      intermediary field_10951 Lnet/minecraft/class_2331;field_10951:Lnet/minecraft/class_265;
      official b Ldmz;b:Lfcr;
    • POWER_PROVIDER_OFFSETS

      public static final List<BlockPos> POWER_PROVIDER_OFFSETS
      Mappings:
      Namespace Name Mixin selector
      named POWER_PROVIDER_OFFSETS Lnet/minecraft/block/EnchantingTableBlock;POWER_PROVIDER_OFFSETS:Ljava/util/List;
      intermediary field_36535 Lnet/minecraft/class_2331;field_36535:Ljava/util/List;
      official c Ldmz;c:Ljava/util/List;
  • Constructor Details

    • EnchantingTableBlock

      protected EnchantingTableBlock(AbstractBlock.Settings settings)
      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

      public com.mojang.serialization.MapCodec<EnchantingTableBlock> getCodec()
      Specified by:
      getCodec in class BlockWithEntity
      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;
    • canAccessPowerProvider

      public static boolean canAccessPowerProvider(World world, BlockPos tablePos, BlockPos providerOffset)
      Mappings:
      Namespace Name Mixin selector
      named canAccessPowerProvider Lnet/minecraft/block/EnchantingTableBlock;canAccessPowerProvider(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Z
      intermediary method_40445 Lnet/minecraft/class_2331;method_40445(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Z
      official a Ldmz;a(Ldhh;Ljh;Ljh;)Z
    • hasSidedTransparency

      protected boolean hasSidedTransparency(BlockState state)
      Returns whether the block's transparency depends on the side of the block, like slabs.
      Overrides:
      hasSidedTransparency in class AbstractBlock
      Returns:
      whether the block's transparency depends on the side of the block, like slabs
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named hasSidedTransparency Lnet/minecraft/block/AbstractBlock;hasSidedTransparency(Lnet/minecraft/block/BlockState;)Z
      intermediary method_9526 Lnet/minecraft/class_4970;method_9526(Lnet/minecraft/class_2680;)Z
      official g_ Ldxt;g_(Ldxu;)Z
    • getOutlineShape

      protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
      Overrides:
      getOutlineShape in class AbstractBlock
      See Also:
      Mappings:
      Namespace Name Mixin selector
      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;
      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;
      official a Ldxt;a(Ldxu;Ldgm;Ljh;Lfcc;)Lfcr;
    • randomDisplayTick

      public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)
      Called randomly on the client. Blocks may override this to spawn particles. Unlike AbstractBlock.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 class Block
      Mappings:
      Namespace Name Mixin selector
      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
      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
      official a Ldkl;a(Ldxu;Ldhh;Ljh;Lbam;)V
    • getRenderType

      protected 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)
      See Also:
      API Note:
      BlockWithEntity overrides this to return BlockRenderType.INVISIBLE; therefore, custom blocks extending that class must override it again to render the block.
      Mappings:
      Namespace Name Mixin selector
      named getRenderType Lnet/minecraft/block/AbstractBlock;getRenderType(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockRenderType;
      intermediary method_9604 Lnet/minecraft/class_4970;method_9604(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2464;
      official a_ Ldxt;a_(Ldxu;)Ldqu;
    • createBlockEntity

      public 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
      Implementation Note:
      While this is marked as nullable, in practice this should never return null. PistonExtensionBlock is the only block in vanilla that returns null inside the implementation.
      Mappings:
      Namespace Name Mixin selector
      named createBlockEntity Lnet/minecraft/block/BlockEntityProvider;createBlockEntity(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/entity/BlockEntity;
      intermediary method_10123 Lnet/minecraft/class_2343;method_10123(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_2586;
      official a Ldnf;a(Ljh;Ldxu;)Lduw;
    • getTicker

      @Nullable public <T extends BlockEntity> @Nullable BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type)
      Returns the "ticker" for the block's block entity, or null if the block entity does not need to be ticked.

      Ticker is a functional interface called every tick to tick the block entity on both the client and the server.

      Tickers should validate that the passed type is the one this block expects, and return null if it isn't. This is to prevent crashes in rare cases where a mismatch occurs between the position's block and block entity. BlockWithEntity.validateTicker(net.minecraft.block.entity.BlockEntityType<A>, net.minecraft.block.entity.BlockEntityType<E>, net.minecraft.block.entity.BlockEntityTicker<? super E>) can be used to implement the check.

      Example:

      
       public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) {
         if (type != YourMod.MY_BLOCK_ENTITY_TYPE) return null;
         // This should be a static method usable as a BlockEntityTicker.
         return YourBlockEntity::tick;
       }
       
      Returns:
      the "ticker" for the block's block entity, or null if the block entity does not need to be ticked
      Mappings:
      Namespace Name Mixin selector
      named getTicker Lnet/minecraft/block/BlockEntityProvider;getTicker(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/BlockEntityType;)Lnet/minecraft/block/entity/BlockEntityTicker;
      intermediary method_31645 Lnet/minecraft/class_2343;method_31645(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2591;)Lnet/minecraft/class_5558;
      official a Ldnf;a(Ldhh;Ldxu;Lduy;)Ldux;
    • onUse

      protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit)
      Overrides:
      onUse in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      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/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;
      intermediary method_55766 Lnet/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 a Ldxt;a(Ldxu;Ldhh;Ljh;Lcpw;Lfbt;)Lbti;
    • createScreenHandlerFactory

      @Nullable protected @Nullable NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos)
      Returns the screen handler factory or null if screen handler cannot be created.

      This method should be overridden for blocks with screen handlers, such as anvils. The created screen handler is usually passed to PlayerEntity.openHandledScreen(net.minecraft.screen.NamedScreenHandlerFactory). See AnvilBlock.createScreenHandlerFactory(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos) for basic usage. BlockWithEntity delegates this logic to the block entity implementing NamedScreenHandlerFactory. For example, any BlockWithEntity whose block entity extends LockableContainerBlockEntity needs to override LockableContainerBlockEntity.createScreenHandler(int, net.minecraft.entity.player.PlayerInventory) instead of this method.

      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:
      createScreenHandlerFactory in class BlockWithEntity
      Returns:
      the screen handler factory or null if screen handler cannot be created
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named createScreenHandlerFactory Lnet/minecraft/block/AbstractBlock;createScreenHandlerFactory(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/screen/NamedScreenHandlerFactory;
      intermediary method_17454 Lnet/minecraft/class_4970;method_17454(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Lnet/minecraft/class_3908;
      official b Ldxt;b(Ldxu;Ldhh;Ljh;)Lbtk;
    • canPathfindThrough

      protected boolean canPathfindThrough(BlockState state, NavigationType type)
      Returns if an entity using navigation type type can navigate through this block.
      Overrides:
      canPathfindThrough in class AbstractBlock
      Returns:
      if an entity using navigation type type can navigate through this block
      See Also:
      API Note:
      Subclasses may override this to prevent or restrict pathfinding through the block. For example, DoorBlock restricts it to open doors only.
      Mappings:
      Namespace Name Mixin selector
      named canPathfindThrough Lnet/minecraft/block/AbstractBlock;canPathfindThrough(Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/ai/pathing/NavigationType;)Z
      intermediary method_9516 Lnet/minecraft/class_4970;method_9516(Lnet/minecraft/class_2680;Lnet/minecraft/class_10;)Z
      official a Ldxt;a(Ldxu;Leul;)Z