Class BarrierBlock

All Implemented Interfaces:
FluidDrainable, FluidFillable, Waterloggable, ItemConvertible, ToggleableFeature

public class BarrierBlock extends Block implements Waterloggable
Mappings:
Namespace Name
official cvx
intermediary net/minecraft/class_2213
named net/minecraft/block/BarrierBlock
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<BarrierBlock> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lcvx;a:Lcom/mojang/serialization/MapCodec;
      intermediary field_46266 Lnet/minecraft/class_2213;field_46266:Lcom/mojang/serialization/MapCodec;
      named CODEC Lnet/minecraft/block/BarrierBlock;CODEC:Lcom/mojang/serialization/MapCodec;
    • WATERLOGGED

      public static final BooleanProperty WATERLOGGED
      Mappings:
      Namespace Name Mixin selector
      official b Lcvx;b:Ldjy;
      intermediary field_45144 Lnet/minecraft/class_2213;field_45144:Lnet/minecraft/class_2746;
      named WATERLOGGED Lnet/minecraft/block/BarrierBlock;WATERLOGGED:Lnet/minecraft/state/property/BooleanProperty;
  • Constructor Details

    • BarrierBlock

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

    • getCodec

      public com.mojang.serialization.MapCodec<BarrierBlock> getCodec()
      Overrides:
      getCodec in class Block
      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;
    • isTransparent

      public boolean isTransparent(BlockState state, BlockView world, BlockPos pos)
      Overrides:
      isTransparent in class Block
      Mappings:
      Namespace Name Mixin selector
      official a_ Lcwq;a_(Ldjh;Lcsv;Lhx;)Z
      intermediary method_9579 Lnet/minecraft/class_2248;method_9579(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z
      named isTransparent Lnet/minecraft/block/Block;isTransparent(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z
    • getRenderType

      public BlockRenderType getRenderType(BlockState state)
      Returns the block's render type (invisible, animated, model).
      Overrides:
      getRenderType in class AbstractBlock
      Returns:
      the block's render type (invisible, animated, model)
      Mappings:
      Namespace Name Mixin selector
      official b_ Ldjg;b_(Ldjh;)Ldcv;
      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;
    • getAmbientOcclusionLightLevel

      public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos)
      Overrides:
      getAmbientOcclusionLightLevel in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official d Ldjg;d(Ldjh;Lcsv;Lhx;)F
      intermediary method_9575 Lnet/minecraft/class_4970;method_9575(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)F
      named getAmbientOcclusionLightLevel Lnet/minecraft/block/AbstractBlock;getAmbientOcclusionLightLevel(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F
    • getStateForNeighborUpdate

      public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos)
      Returns the state of the block after a neighboring block's state change.

      Returning Blocks.AIR breaks the block. This is useful to implement supporting block requirement for blocks (if used along with AbstractBlock.canPlaceAt(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.util.math.BlockPos)).

      Side effects like activating a redstone component (but not scheduling a tick) should be performed in AbstractBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean) instead. If the block supports waterlogging and currently has water, this method should be overridden to tick the fluid at the block's position.

      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. This is not called if Block.FORCE_STATE flag is set in the setBlockState call.

      This method can be used for multiple purposes. Here are some examples:

      • FenceBlock uses it to update the fence's connection when a horizontally neighboring block's state is changed.
      • PlantBlock uses it to break the plant if the state change causes it to lose its supporting block.
      • DoorBlock uses it to copy the state of the other half of the door.
      • SlabBlock uses it to schedule the fluid to tick if waterlogged.
      • SoulSandBlock uses it to schedule the water block above to tick so that it becomes a bubble column.
      • FallingBlock uses it to schedule the block to tick so that it can fall if needed.
      Overrides:
      getStateForNeighborUpdate in class AbstractBlock
      Parameters:
      state - the state of this block
      direction - the direction from this block to the neighbor
      neighborState - the state of the updated neighbor block
      world - the world
      pos - the position of this block
      neighborPos - the position of the neighbor block
      Returns:
      the state of the block after a neighboring block's state change
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a(Ldjh;Lic;Ldjh;Lctq;Lhx;Lhx;)Ldjh;
      intermediary method_9559 Lnet/minecraft/class_4970;method_9559(Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;
      named getStateForNeighborUpdate Lnet/minecraft/block/AbstractBlock;getStateForNeighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;
    • getFluidState

      public FluidState getFluidState(BlockState state)
      Returns the state's associated fluid state.

      Waterloggable blocks must override this to return Fluids.WATER.getStill(false) when waterlogged.

      Overrides:
      getFluidState in class AbstractBlock
      Returns:
      the state's associated fluid state
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official c_ Ldjg;c_(Ldjh;)Leer;
      intermediary method_9545 Lnet/minecraft/class_4970;method_9545(Lnet/minecraft/class_2680;)Lnet/minecraft/class_3610;
      named getFluidState Lnet/minecraft/block/AbstractBlock;getFluidState(Lnet/minecraft/block/BlockState;)Lnet/minecraft/fluid/FluidState;
    • getPlacementState

      @Nullable public @Nullable 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;
    • 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
    • tryDrainFluid

      public ItemStack tryDrainFluid(@Nullable @Nullable PlayerEntity player, WorldAccess world, BlockPos pos, BlockState state)
      Specified by:
      tryDrainFluid in interface FluidDrainable
      Specified by:
      tryDrainFluid in interface Waterloggable
      Mappings:
      Namespace Name Mixin selector
      official a Lcwx;a(Lcfi;Lctq;Lhx;Ldjh;)Lcmy;
      intermediary method_9700 Lnet/minecraft/class_2263;method_9700(Lnet/minecraft/class_1657;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_1799;
      named tryDrainFluid Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;
    • canFillWithFluid

      public boolean canFillWithFluid(@Nullable @Nullable PlayerEntity player, BlockView world, BlockPos pos, BlockState state, Fluid fluid)
      Specified by:
      canFillWithFluid in interface FluidFillable
      Specified by:
      canFillWithFluid in interface Waterloggable
      Mappings:
      Namespace Name Mixin selector
      official a Ldbg;a(Lcfi;Lcsv;Lhx;Ldjh;Leeq;)Z
      intermediary method_10310 Lnet/minecraft/class_2402;method_10310(Lnet/minecraft/class_1657;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3611;)Z
      named canFillWithFluid Lnet/minecraft/block/FluidFillable;canFillWithFluid(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/fluid/Fluid;)Z