67 lines
2.1 KiB
Java
67 lines
2.1 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.serialization.MapCodec
|
|
* org.jspecify.annotations.Nullable
|
|
*/
|
|
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.Blocks;
|
|
import net.minecraft.world.level.block.GrowingPlantBodyBlock;
|
|
import net.minecraft.world.level.block.GrowingPlantHeadBlock;
|
|
import net.minecraft.world.level.block.LiquidBlockContainer;
|
|
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;
|
|
|
|
public class KelpPlantBlock
|
|
extends GrowingPlantBodyBlock
|
|
implements LiquidBlockContainer {
|
|
public static final MapCodec<KelpPlantBlock> CODEC = KelpPlantBlock.simpleCodec(KelpPlantBlock::new);
|
|
|
|
public MapCodec<KelpPlantBlock> codec() {
|
|
return CODEC;
|
|
}
|
|
|
|
protected KelpPlantBlock(BlockBehaviour.Properties properties) {
|
|
super(properties, Direction.UP, Shapes.block(), true);
|
|
}
|
|
|
|
@Override
|
|
protected GrowingPlantHeadBlock getHeadBlock() {
|
|
return (GrowingPlantHeadBlock)Blocks.KELP;
|
|
}
|
|
|
|
@Override
|
|
protected FluidState getFluidState(BlockState state) {
|
|
return Fluids.WATER.getSource(false);
|
|
}
|
|
|
|
@Override
|
|
protected boolean canAttachTo(BlockState state) {
|
|
return this.getHeadBlock().canAttachTo(state);
|
|
}
|
|
|
|
@Override
|
|
public boolean canPlaceLiquid(@Nullable LivingEntity user, BlockGetter level, BlockPos pos, BlockState state, Fluid type) {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public boolean placeLiquid(LevelAccessor level, BlockPos pos, BlockState state, FluidState fluidState) {
|
|
return false;
|
|
}
|
|
}
|
|
|