Search in sources :

Example 6 with BlockCoord

use of am2.api.blocks.MultiblockStructureDefinition.BlockCoord in project ArsMagica2 by Mithion.

the class GuiArcaneCompendium method getMultiblockLayer.

private TreeMap<BlockCoord, ArrayList<BlockDec>> getMultiblockLayer(int layer) {
    TreeMap<BlockCoord, ArrayList<BlockDec>> layerBlocksSorted = new TreeMap<BlockCoord, ArrayList<BlockDec>>();
    for (int mutex : entryMultiblock.getMutexList()) {
        ArrayList<StructureGroup> groups = entryMultiblock.getGroupsForMutex(mutex);
        StructureGroup selected = groups.get(AMGuiHelper.instance.getSlowTicker() % groups.size());
        HashMap<BlockCoord, ArrayList<BlockDec>> layerBlocks = entryMultiblock.getStructureLayer(selected, layer);
        for (BlockCoord bc : layerBlocks.keySet()) {
            layerBlocksSorted.put(bc, layerBlocks.get(bc));
        }
    }
    return layerBlocksSorted;
}
Also used : StructureGroup(am2.api.blocks.MultiblockStructureDefinition.StructureGroup) BlockDec(am2.api.blocks.MultiblockStructureDefinition.BlockDec) BlockCoord(am2.api.blocks.MultiblockStructureDefinition.BlockCoord)

Aggregations

BlockCoord (am2.api.blocks.MultiblockStructureDefinition.BlockCoord)6 BlockDec (am2.api.blocks.MultiblockStructureDefinition.BlockDec)3 StructureGroup (am2.api.blocks.MultiblockStructureDefinition.StructureGroup)2 ItemStack (net.minecraft.item.ItemStack)2 AMVector3 (am2.api.math.AMVector3)1 TileEntityCraftingAltar (am2.blocks.tileentities.TileEntityCraftingAltar)1 ArrayList (java.util.ArrayList)1 Block (net.minecraft.block.Block)1 EntityItem (net.minecraft.entity.item.EntityItem)1 IInventory (net.minecraft.inventory.IInventory)1 TileEntity (net.minecraft.tileentity.TileEntity)1