package net.minecraft.world.level.block; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.shapes.Shapes; import org.jspecify.annotations.Nullable; /** * Access widened by fabric-transitive-access-wideners-v1 to accessible */ public class KelpPlantBlock extends GrowingPlantBodyBlock implements LiquidBlockContainer { public static final MapCodec CODEC = simpleCodec(KelpPlantBlock::new); @Override public MapCodec codec() { return CODEC; } /** * Access widened by fabric-transitive-access-wideners-v1 to accessible */ public KelpPlantBlock(final BlockBehaviour.Properties properties) { super(properties, Direction.UP, Shapes.block(), true); } @Override protected GrowingPlantHeadBlock getHeadBlock() { return (GrowingPlantHeadBlock)Blocks.KELP; } @Override protected FluidState getFluidState(final BlockState state) { return Fluids.WATER.getSource(false); } @Override protected boolean canAttachTo(final BlockState state) { return this.getHeadBlock().canAttachTo(state); } @Override public boolean canPlaceLiquid(@Nullable final LivingEntity user, final BlockGetter level, final BlockPos pos, final BlockState state, final Fluid type) { return false; } @Override public boolean placeLiquid(final LevelAccessor level, final BlockPos pos, final BlockState state, final FluidState fluidState) { return false; } }