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.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 byj, final Level bjw, final BlockPos fk, final Entity akq) {
        super.entityInside(byj, bjw, fk, akq);
        if (bjw instanceof ServerLevel && akq instanceof Boat) {
            bjw.destroyBlock(new BlockPos(fk), true, akq);
        }
    }
    
    @Override
    public VoxelShape getShape(final BlockState byj, final BlockGetter bjg, final BlockPos fk, final CollisionContext cvq) {
        return WaterlilyBlock.AABB;
    }
    
    @Override
    protected boolean mayPlaceOn(final BlockState byj, final BlockGetter bjg, final BlockPos fk) {
        final FluidState coj5 = bjg.getFluidState(fk);
        return coj5.getType() == Fluids.WATER || byj.getMaterial() == Material.ICE;
    }
    
    static {
        AABB = Block.box(1.0, 0.0, 1.0, 15.0, 1.5, 15.0);
    }
}
