for(LPTravelingItem item: pipe.transport.items) {
if(count >= MAX_ITEMS_TO_RENDER) {
break;
}
LPPosition pos = new LPPosition(0.5D, 0.5D, 0.5D);
if(item.getPosition() > 1 || item.getPosition() < 0) {
continue;
}
float fPos = item.getPosition() + item.getSpeed() * f;
if(fPos < 0.5) {
if(item.input == ForgeDirection.UNKNOWN) continue;
if(!pipe.container.renderState.pipeConnectionMatrix.isConnected(item.input.getOpposite())) continue;
pos.moveForward(item.input.getOpposite(), 0.5F - fPos);
} else {
if(item.output == ForgeDirection.UNKNOWN) continue;
if(!pipe.container.renderState.pipeConnectionMatrix.isConnected(item.output)) continue;
pos.moveForward(item.output, fPos - 0.5F);
}
if(item == null || item.getItemIdentifierStack() == null) continue;
if(item.getContainer().xCoord != pipe.container.xCoord || item.getContainer().yCoord != pipe.container.yCoord || item.getContainer().zCoord != pipe.container.zCoord) continue;
ItemStack itemstack = item.getItemIdentifierStack().makeNormalStack();
doRenderItem(itemstack, x + pos.getXD(), y + pos.getYD(), z + pos.getZD(), light, item.getAge(), item.getHoverStart(), 0.7F);
count++;
}
count = 0;
float dist = 0.135F;
LPPosition pos = new LPPosition(0.5D, 0.5D, 0.5D);
pos.moveForward(ForgeDirection.SOUTH, dist);
pos.moveForward(ForgeDirection.EAST, dist);
pos.moveForward(ForgeDirection.UP, dist);
for(Pair<ItemIdentifierStack, Pair<Integer, Integer>> item: pipe.transport._itemBuffer) {
if(item == null || item.getValue1() == null) continue;
ItemStack itemstack = item.getValue1().makeNormalStack();
doRenderItem(itemstack, x + pos.getXD(), y + pos.getYD(), z + pos.getZD(), light, 0, 0, 0.25F);
count++;
if(count >= 27) {
break;
} else if(count % 9 == 0) {
pos.moveForward(ForgeDirection.SOUTH, dist * 2);
pos.moveForward(ForgeDirection.EAST, dist * 2);
pos.moveForward(ForgeDirection.DOWN, dist);
} else if(count % 3 == 0) {
pos.moveForward(ForgeDirection.SOUTH, dist * 2);
pos.moveForward(ForgeDirection.WEST, dist);
} else {
pos.moveForward(ForgeDirection.NORTH, dist);
}
}
GL11.glEnable(2896 /* GL_LIGHTING */);
GL11.glPopMatrix();