Search in sources :

Example 6 with BlockDec

use of am2.api.blocks.MultiblockStructureDefinition.BlockDec 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)5 BlockDec (am2.api.blocks.MultiblockStructureDefinition.BlockDec)4 StructureGroup (am2.api.blocks.MultiblockStructureDefinition.StructureGroup)2 ItemStack (net.minecraft.item.ItemStack)2 ArrayList (java.util.ArrayList)1 Block (net.minecraft.block.Block)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1