Class EndGatewayBlock

All Implemented Interfaces:
BlockEntityProvider, ItemConvertible, ToggleableFeature

public class EndGatewayBlock extends BlockWithEntity
Mappings:
Namespace Name
official crw
intermediary net/minecraft/class_2329
named net/minecraft/block/EndGatewayBlock
  • Constructor Details

    • EndGatewayBlock

      protected EndGatewayBlock(AbstractBlock.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldca;<init>(Ldca$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

    • 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
      Mappings:
      Namespace Name Mixin selector
      official a Lcsb;a(Lgu;Ldcb;)Lczn;
      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.checkType(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
      official a Lcsb;a(Lcmm;Ldcb;Lczp;)Lczo;
      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;
    • 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
      official a Lcpn;a(Ldcb;Lcmm;Lgu;Lapf;)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
      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
    • getPickStack

      public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state)
      Returns the new item stack when using pick block functionality.

      Pick block is available via middle-clicking by default. Blocks without the corresponding BlockItem, such as crops, should override this method to return the correct item stack.

      Overrides:
      getPickStack in class Block
      Returns:
      the new item stack when using pick block functionality
      Mappings:
      Namespace Name Mixin selector
      official a Lcpn;a(Lcls;Lgu;Ldcb;)Lcfz;
      intermediary method_9574 Lnet/minecraft/class_2248;method_9574(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_1799;
      named getPickStack Lnet/minecraft/block/Block;getPickStack(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;
    • canBucketPlace

      public boolean canBucketPlace(BlockState state, Fluid fluid)
      Returns whether a bucket can replace the block with the fluid.

      By default, this checks if the block allows replacing or is not solid. Blocks intended to be unbreakable should override this to implement additional checks.

      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:
      canBucketPlace in class AbstractBlock
      Returns:
      whether a bucket can replace the block with the fluid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldca;a(Ldcb;Ldxd;)Z
      intermediary method_22358 Lnet/minecraft/class_4970;method_22358(Lnet/minecraft/class_2680;Lnet/minecraft/class_3611;)Z
      named canBucketPlace Lnet/minecraft/block/AbstractBlock;canBucketPlace(Lnet/minecraft/block/BlockState;Lnet/minecraft/fluid/Fluid;)Z