package net.minecraft.world.level.block;

import javax.annotation.Nullable;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;

public abstract class BaseEntityBlock extends Block implements EntityBlock {
    protected BaseEntityBlock(final Properties c) {
        super(c);
    }
    
    @Override
    public RenderShape getRenderShape(final BlockState byj) {
        return RenderShape.INVISIBLE;
    }
    
    @Override
    public boolean triggerEvent(final BlockState byj, final Level bjw, final BlockPos fk, final int integer4, final int integer5) {
        super.triggerEvent(byj, bjw, fk, integer4, integer5);
        final BlockEntity bwl7 = bjw.getBlockEntity(fk);
        return bwl7 != null && bwl7.triggerEvent(integer4, integer5);
    }
    
    @Nullable
    @Override
    public MenuProvider getMenuProvider(final BlockState byj, final Level bjw, final BlockPos fk) {
        final BlockEntity bwl5 = bjw.getBlockEntity(fk);
        return (bwl5 instanceof MenuProvider) ? bwl5 : null;
    }
}
