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;
}
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);
}
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();
}
}
}
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();
}
}
}
}
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);
}
}
Aggregations