Class AbstractSkullBlock

All Implemented Interfaces:
BlockEntityProvider, Equipment, ItemConvertible, Vanishable, ToggleableFeature
Direct Known Subclasses:
SkullBlock, WallSkullBlock

public abstract class AbstractSkullBlock extends BlockWithEntity implements Equipment
Mappings:
Namespace Name
official cvm
intermediary net/minecraft/class_2190
named net/minecraft/block/AbstractSkullBlock
  • Field Details

    • POWERED

      public static final BooleanProperty POWERED
      Mappings:
      Namespace Name Mixin selector
      official a Lcvm;a:Ldjy;
      intermediary field_46110 Lnet/minecraft/class_2190;field_46110:Lnet/minecraft/class_2746;
      named POWERED Lnet/minecraft/block/AbstractSkullBlock;POWERED:Lnet/minecraft/state/property/BooleanProperty;
    • type

      private final SkullBlock.SkullType type
      Mappings:
      Namespace Name Mixin selector
      official b Lcvm;b:Lddr$a;
      intermediary field_9867 Lnet/minecraft/class_2190;field_9867:Lnet/minecraft/class_2484$class_2485;
      named type Lnet/minecraft/block/AbstractSkullBlock;type:Lnet/minecraft/block/SkullBlock$SkullType;
  • Constructor Details

    • AbstractSkullBlock

      public AbstractSkullBlock(SkullBlock.SkullType type, AbstractBlock.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcvm;<init>(Lddr$a;Ldjg$d;)V
      intermediary <init> Lnet/minecraft/class_2190;<init>(Lnet/minecraft/class_2484$class_2485;Lnet/minecraft/class_4970$class_2251;)V
      named <init> Lnet/minecraft/block/AbstractSkullBlock;<init>(Lnet/minecraft/block/SkullBlock$SkullType;Lnet/minecraft/block/AbstractBlock$Settings;)V
  • Method Details

    • getCodec

      protected abstract com.mojang.serialization.MapCodec<? extends AbstractSkullBlock> getCodec()
      Specified by:
      getCodec in class BlockWithEntity
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a()Lcom/mojang/serialization/MapCodec;
      intermediary method_53969 Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;
      named getCodec Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;
    • 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);
       }
       
      Specified by:
      createBlockEntity in interface BlockEntityProvider
      Returns:
      a new block entity instance
      Mappings:
      Namespace Name Mixin selector
      official a Lczi;a(Lhx;Ldjh;)Ldgv;
      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;
    • 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;
       }
       
      Specified by:
      getTicker in interface BlockEntityProvider
      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
      official a Lczi;a(Lctp;Ldjh;Ldgx;)Ldgw;
      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;
      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;
    • getSkullType

      public SkullBlock.SkullType getSkullType()
      Mappings:
      Namespace Name Mixin selector
      official b Lcvm;b()Lddr$a;
      intermediary method_9327 Lnet/minecraft/class_2190;method_9327()Lnet/minecraft/class_2484$class_2485;
      named getSkullType Lnet/minecraft/block/AbstractSkullBlock;getSkullType()Lnet/minecraft/block/SkullBlock$SkullType;
    • canPathfindThrough

      public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, 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
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lcsv;Lhx;Lefh;)Z
      intermediary method_9516 Lnet/minecraft/class_4970;method_9516(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_10;)Z
      named canPathfindThrough Lnet/minecraft/block/AbstractBlock;canPathfindThrough(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/ai/pathing/NavigationType;)Z
    • getSlotType

      public EquipmentSlot getSlotType()
      Specified by:
      getSlotType in interface Equipment
      Mappings:
      Namespace Name Mixin selector
      official g Lclz;g()Lbma;
      intermediary method_7685 Lnet/minecraft/class_5151;method_7685()Lnet/minecraft/class_1304;
      named getSlotType Lnet/minecraft/item/Equipment;getSlotType()Lnet/minecraft/entity/EquipmentSlot;
    • 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 Lcwq;a(Ldji$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
    • getPlacementState

      public BlockState getPlacementState(ItemPlacementContext ctx)
      Overrides:
      getPlacementState in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lcwq;a(Lcph;)Ldjh;
      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;
    • neighborUpdate

      public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, 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 as SpongeBlock which absorbs water.

      To replace the state of the block itself, override AbstractBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos) 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:
      neighborUpdate in class AbstractBlock
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lctp;Lhx;Lcwq;Lhx;Z)V
      intermediary method_9612 Lnet/minecraft/class_4970;method_9612(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2338;Z)V
      named neighborUpdate Lnet/minecraft/block/AbstractBlock;neighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Z)V