Search in sources :

Example 6 with SchematicBlock

use of buildcraft.api.blueprints.SchematicBlock in project BuildCraft by BuildCraft.

the class IndexRequirementMap method add.

public void add(BuildingSlotBlock b, IBuilderContext context) {
    if (b.schematic instanceof SchematicBlock) {
        BlockPos index = b.pos;
        Set<BlockPos> prereqs = ((SchematicBlock) b.schematic).getPrerequisiteBlocks(context);
        if (prereqs != null && prereqs.size() > 0) {
            for (BlockPos i : prereqs) {
                BlockPos ia = i.add(index);
                if (ia.equals(index) || !context.surroundingBox().contains(Utils.convert(ia))) {
                    continue;
                }
                requirements.put(index, ia);
                requirementsInv.put(ia, index);
            }
        }
    }
}
Also used : SchematicBlock(buildcraft.api.blueprints.SchematicBlock) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

SchematicBlock (buildcraft.api.blueprints.SchematicBlock)6 BlockPos (net.minecraft.util.math.BlockPos)3 IBlockState (net.minecraft.block.state.IBlockState)2 SchematicEntity (buildcraft.api.blueprints.SchematicEntity)1 BuildingSlotBlock (buildcraft.core.builders.BuildingSlotBlock)1 BuildingSlotEntity (buildcraft.core.builders.BuildingSlotEntity)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 LinkedList (java.util.LinkedList)1 Block (net.minecraft.block.Block)1 ItemStack (net.minecraft.item.ItemStack)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ITickable (net.minecraft.util.ITickable)1