Search in sources :

Example 11 with CompiledCard

use of mcjty.rftoolscontrol.logic.compiled.CompiledCard in project RFToolsControl by McJty.

the class ProcessorTileEntity method signal.

@Override
public int signal(Tuple location) {
    int cnt = 0;
    for (int i = 0; i < cardInfo.length; i++) {
        CardInfo info = cardInfo[i];
        CompiledCard compiledCard = info.getCompiledCard();
        if (compiledCard != null) {
            for (CompiledEvent event : compiledCard.getEvents(Opcodes.EVENT_GFX_SELECT)) {
                int index = event.getIndex();
                runOrQueueEvent(i, event, null, Parameter.builder().type(ParameterType.PAR_TUPLE).value(ParameterValue.constant(location)).build());
                cnt++;
            }
        }
    }
    return cnt;
}
Also used : CompiledCard(mcjty.rftoolscontrol.logic.compiled.CompiledCard) CompiledEvent(mcjty.rftoolscontrol.logic.compiled.CompiledEvent)

Example 12 with CompiledCard

use of mcjty.rftoolscontrol.logic.compiled.CompiledCard in project RFToolsControl by McJty.

the class RunningProgram method opcodes.

private List<CompiledOpcode> opcodes(ProcessorTileEntity processor) {
    if (opcodeCache == null) {
        CompiledCard card = processor.getCompiledCard(cardIndex);
        opcodeCache = card.getOpcodes();
    }
    return opcodeCache;
}
Also used : CompiledCard(mcjty.rftoolscontrol.logic.compiled.CompiledCard)

Aggregations

CompiledCard (mcjty.rftoolscontrol.logic.compiled.CompiledCard)12 CompiledEvent (mcjty.rftoolscontrol.logic.compiled.CompiledEvent)7 ICompiledOpcode (mcjty.rftoolscontrol.api.code.ICompiledOpcode)6 CompiledOpcode (mcjty.rftoolscontrol.logic.compiled.CompiledOpcode)6 ItemStack (net.minecraft.item.ItemStack)4 NBTTagString (net.minecraft.nbt.NBTTagString)4 DefaultSidedInventory (mcjty.lib.container.DefaultSidedInventory)2 ProgException (mcjty.rftoolscontrol.logic.running.ProgException)2 IInventory (net.minecraft.inventory.IInventory)2 ISidedInventory (net.minecraft.inventory.ISidedInventory)2 IItemHandler (net.minecraftforge.items.IItemHandler)2 RunningProgram (mcjty.rftoolscontrol.logic.running.RunningProgram)1