package net.minecraft.world.level.block;

import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.core.Vec3i;
import net.minecraft.world.entity.vehicle.Boat;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.phys.shapes.VoxelShape;

public class WaterlilyBlock extends BushBlock {
    protected static final VoxelShape AABB;
    
    protected WaterlilyBlock(final Properties c) {
        super(c);
    }
    
    @Override
    public void entityInside(final BlockState cfj, final Level bqb, final BlockPos fu, final Entity aom) {
        super.entityInside(cfj, bqb, fu, aom);
        if (bqb instanceof ServerLevel && aom instanceof Boat) {
            bqb.destroyBlock(new BlockPos(fu), true, aom);
        }
    }
    
    @Override
    public VoxelShape getShape(final BlockState cfj, final BlockGetter bpg, final BlockPos fu, final CollisionContext der) {
        return WaterlilyBlock.AABB;
    }
    
    @Override
    protected boolean mayPlaceOn(final BlockState cfj, final BlockGetter bpg, final BlockPos fu) {
        final FluidState cxa5 = bpg.getFluidState(fu);
        final FluidState cxa6 = bpg.getFluidState(fu.above());
        return (cxa5.getType() == Fluids.WATER || cfj.getMaterial() == Material.ICE) && cxa6.getType() == Fluids.EMPTY;
    }
    
    static {
        AABB = Block.box(1.0, 0.0, 1.0, 15.0, 1.5, 15.0);
    }
}
