package net.minecraft.world.level.levelgen.feature.treedecorators;

import net.minecraft.world.level.block.state.AbstractStateHolder;
import net.minecraft.core.Vec3i;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.LevelWriter;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import java.util.Set;
import net.minecraft.core.BlockPos;
import java.util.List;
import java.util.Random;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.util.Serializable;

public abstract class TreeDecorator implements Serializable {
    protected final TreeDecoratorType<?> type;
    
    protected TreeDecorator(final TreeDecoratorType<?> ciu) {
        this.type = ciu;
    }
    
    public abstract void place(final LevelAccessor bjx, final Random random, final List<BlockPos> list3, final List<BlockPos> list4, final Set<BlockPos> set, final BoundingBox clb);
    
    protected void placeVine(final LevelWriter bke, final BlockPos fk, final BooleanProperty bzb, final Set<BlockPos> set, final BoundingBox clb) {
        this.setBlock(bke, fk, ((AbstractStateHolder<O, BlockState>)Blocks.VINE.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)bzb, true), set, clb);
    }
    
    protected void setBlock(final LevelWriter bke, final BlockPos fk, final BlockState byj, final Set<BlockPos> set, final BoundingBox clb) {
        bke.setBlock(fk, byj, 19);
        set.add(fk);
        clb.expand(new BoundingBox(fk, fk));
    }
}
