Class DaylightDetectorBlock

All Implemented Interfaces:
BlockEntityProvider, ItemConvertible, ToggleableFeature

public class DaylightDetectorBlock extends BlockWithEntity
Mappings:
Namespace Name
named net/minecraft/block/DaylightDetectorBlock
intermediary net/minecraft/class_2309
official dgz
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<DaylightDetectorBlock> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/block/DaylightDetectorBlock;CODEC:Lcom/mojang/serialization/MapCodec;
      intermediary field_46331 Lnet/minecraft/class_2309;field_46331:Lcom/mojang/serialization/MapCodec;
      official a Ldgz;a:Lcom/mojang/serialization/MapCodec;
    • POWER

      public static final IntProperty POWER
      Mappings:
      Namespace Name Mixin selector
      named POWER Lnet/minecraft/block/DaylightDetectorBlock;POWER:Lnet/minecraft/state/property/IntProperty;
      intermediary field_10897 Lnet/minecraft/class_2309;field_10897:Lnet/minecraft/class_2758;
      official b Ldgz;b:Ldte;
    • INVERTED

      public static final BooleanProperty INVERTED
      Mappings:
      Namespace Name Mixin selector
      named INVERTED Lnet/minecraft/block/DaylightDetectorBlock;INVERTED:Lnet/minecraft/state/property/BooleanProperty;
      intermediary field_10899 Lnet/minecraft/class_2309;field_10899:Lnet/minecraft/class_2746;
      official c Ldgz;c:Ldsv;
    • SHAPE

      protected static final VoxelShape SHAPE
      Mappings:
      Namespace Name Mixin selector
      named SHAPE Lnet/minecraft/block/DaylightDetectorBlock;SHAPE:Lnet/minecraft/util/shape/VoxelShape;
      intermediary field_10898 Lnet/minecraft/class_2309;field_10898:Lnet/minecraft/class_265;
      official d Ldgz;d:Lewm;
  • Constructor Details

    • DaylightDetectorBlock

      public DaylightDetectorBlock(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> Ldsd;<init>(Ldsd$d;)V
  • Method Details

    • getCodec

      public com.mojang.serialization.MapCodec<DaylightDetectorBlock> 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 Ldsd;a()Lcom/mojang/serialization/MapCodec;
    • 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 Ldsd;a(Ldse;Ldbg;Liz;Levy;)Lewm;
    • 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 f_ Ldsd;f_(Ldse;)Z
    • getWeakRedstonePower

      protected int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction)
      Returns the weak redstone power emitted from the block.

      When overriding this, make sure to also override emitsRedstonePower(net.minecraft.block.BlockState) to return true.

      Weak redstone power is a power that cannot power a redstone wire when a solid block is in between. For example, RedstoneBlock and TargetBlock emits weak redstone power only. LeverBlock and ButtonBlock emits both weak and strong redstone power depending on the direction.

      Overrides:
      getWeakRedstonePower in class AbstractBlock
      Returns:
      the weak redstone power emitted from the block
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getWeakRedstonePower Lnet/minecraft/block/AbstractBlock;getWeakRedstonePower(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)I
      intermediary method_9524 Lnet/minecraft/class_4970;method_9524(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)I
      official a Ldsd;a(Ldse;Ldbg;Liz;Lje;)I
    • updateState

      private static void updateState(BlockState state, World world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      named updateState Lnet/minecraft/block/DaylightDetectorBlock;updateState(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V
      intermediary method_9983 Lnet/minecraft/class_2309;method_9983(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)V
      official d Ldgz;d(Ldse;Ldca;Liz;)V
    • 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 Ldsd;a(Ldse;Ldca;Liz;Lcmz;Levp;)Lbqw;
    • 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_ Ldsd;a_(Ldse;)Ldlh;
    • emitsRedstonePower

      protected boolean emitsRedstonePower(BlockState state)
      Returns whether the block is capable of emitting redstone power.

      This does not return whether the block is currently emitting redstone power. Use RedstoneView.isEmittingRedstonePower(net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction) in that case.

      Overrides:
      emitsRedstonePower in class AbstractBlock
      Returns:
      whether the block is capable of emitting redstone power
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named emitsRedstonePower Lnet/minecraft/block/AbstractBlock;emitsRedstonePower(Lnet/minecraft/block/BlockState;)Z
      intermediary method_9506 Lnet/minecraft/class_4970;method_9506(Lnet/minecraft/class_2680;)Z
      official e_ Ldsd;e_(Ldse;)Z
    • 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 Ldht;a(Liz;Ldse;)Ldpj;
    • 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 Ldht;a(Ldca;Ldse;Ldpl;)Ldpk;
    • tick

      private static void tick(World world, BlockPos pos, BlockState state, DaylightDetectorBlockEntity blockEntity)
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/block/DaylightDetectorBlock;tick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/DaylightDetectorBlockEntity;)V
      intermediary method_31642 Lnet/minecraft/class_2309;method_31642(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2603;)V
      official a Ldgz;a(Ldca;Liz;Ldse;Ldpy;)V
    • 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
      named appendProperties Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
      intermediary method_9515 Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
      official a Ldfb;a(Ldsf$a;)V