Search in sources :

Example 1 with GfxOp

use of mcjty.rftoolscontrol.blocks.vectorart.GfxOp in project RFToolsControl by McJty.

the class RFToolsSupport method readGfxOp.

private static List<GfxOp> readGfxOp(ByteBuf buf) {
    int size = buf.readInt();
    if (size == 0) {
        return null;
    }
    List<GfxOp> operations = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        GfxOp op = GfxOp.readFromBuf(buf);
        operations.add(op);
    }
    return operations;
}
Also used : GfxOp(mcjty.rftoolscontrol.blocks.vectorart.GfxOp) ArrayList(java.util.ArrayList)

Example 2 with GfxOp

use of mcjty.rftoolscontrol.blocks.vectorart.GfxOp in project RFToolsControl by McJty.

the class ProcessorTileEntity method writeGraphicsOperation.

private void writeGraphicsOperation(NBTTagCompound tagCompound) {
    NBTTagCompound opTag = new NBTTagCompound();
    for (Map.Entry<String, GfxOp> entry : gfxOps.entrySet()) {
        opTag.setTag(entry.getKey(), entry.getValue().writeToNBT());
    }
    tagCompound.setTag("gfxop", opTag);
}
Also used : GfxOp(mcjty.rftoolscontrol.blocks.vectorart.GfxOp) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) NBTTagString(net.minecraft.nbt.NBTTagString)

Example 3 with GfxOp

use of mcjty.rftoolscontrol.blocks.vectorart.GfxOp in project RFToolsControl by McJty.

the class ProcessorRenderer method renderGfx.

private void renderGfx(ProcessorTileEntity tileEntity) {
    long t = System.currentTimeMillis();
    if (t - tileEntity.clientTime > 250) {
        RFToolsCtrlMessages.INSTANCE.sendToServer(new PacketSendServerCommand(RFToolsControl.MODID, CommandHandler.CMD_GETGRAPHICS, Arguments.builder().value(tileEntity.getPos()).build()));
        tileEntity.clientTime = t;
    }
    List<GfxOp> ops = tileEntity.getClientGfxOps();
    if (ops != null) {
        for (GfxOp op : ops) {
            op.render();
        }
    }
}
Also used : GfxOp(mcjty.rftoolscontrol.blocks.vectorart.GfxOp) PacketSendServerCommand(mcjty.lib.network.PacketSendServerCommand)

Example 4 with GfxOp

use of mcjty.rftoolscontrol.blocks.vectorart.GfxOp in project RFToolsControl by McJty.

the class VectorArtClientScreenModule method render.

@Override
public void render(IModuleRenderHelper renderHelper, FontRenderer fontRenderer, int currenty, ModuleDataVectorArt screenData, ModuleRenderInfo renderInfo) {
    GlStateManager.disableLighting();
    GlStateManager.enableDepth();
    GlStateManager.depthMask(false);
    if (screenData != null) {
        List<GfxOp> ops = screenData.getSortedOperations();
        if (ops != null) {
            for (GfxOp op : ops) {
                op.render();
            }
        }
    }
}
Also used : GfxOp(mcjty.rftoolscontrol.blocks.vectorart.GfxOp)

Example 5 with GfxOp

use of mcjty.rftoolscontrol.blocks.vectorart.GfxOp in project RFToolsControl by McJty.

the class PacketGraphicsReady method fromBytes.

@Override
public void fromBytes(ByteBuf buf) {
    pos = NetworkTools.readPos(buf);
    int size = buf.readInt();
    gfxOps = new HashMap<>(size);
    for (int i = 0; i < size; i++) {
        String key = NetworkTools.readString(buf);
        GfxOp gfxOp = GfxOp.readFromBuf(buf);
        gfxOps.put(key, gfxOp);
    }
    size = buf.readInt();
    orderedOps = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        String key = NetworkTools.readString(buf);
        orderedOps.add(key);
    }
}
Also used : GfxOp(mcjty.rftoolscontrol.blocks.vectorart.GfxOp)

Aggregations

GfxOp (mcjty.rftoolscontrol.blocks.vectorart.GfxOp)5 ArrayList (java.util.ArrayList)1 PacketSendServerCommand (mcjty.lib.network.PacketSendServerCommand)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 NBTTagString (net.minecraft.nbt.NBTTagString)1