@SideOnly(Side.CLIENT)
 @Override
 public void addInformation(ItemStack is, EntityPlayer ep, List li, boolean verbose) {
   int i = is.getItemDamage();
   if (i < MaterialRegistry.matList.length) {
     if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
       MaterialRegistry mat = MaterialRegistry.matList[i];
       double torque = mat.getMaxShaftTorque();
       double speed = mat.getMaxShaftSpeed();
       li.add(
           String.format(
               "Max Speed: %.3f %srad/s",
               ReikaMathLibrary.getThousandBase(speed), ReikaEngLibrary.getSIPrefix(speed)));
       li.add(
           String.format(
               "Max Torque: %.3f %sNm",
               ReikaMathLibrary.getThousandBase(torque), ReikaEngLibrary.getSIPrefix(torque)));
     } else {
       StringBuilder sb = new StringBuilder();
       sb.append("Hold ");
       sb.append(EnumChatFormatting.GREEN.toString());
       sb.append("Shift");
       sb.append(EnumChatFormatting.GRAY.toString());
       sb.append(" for load data");
       li.add(sb.toString());
     }
   }
 }
示例#2
0
 protected void doRenderMachine(double x, double y, HandbookEntry he) {
   HandbookRegistry h = (HandbookRegistry) he;
   MachineRegistry m = h.getMachine();
   if (m == null) return;
   MaterialRegistry[] mats = MaterialRegistry.values();
   TileEntity te = m.createTEInstanceForRender(0);
   int timeStep = (int) ((System.nanoTime() / SECOND) % mats.length);
   int r = (int) (System.nanoTime() / 20000000) % 360;
   float variable = 0;
   if (h.isEngine() && h != HandbookRegistry.SOLAR) {
     // ((TileEntityEngine)te).type = EngineType.engineList[h.getOffset()];
     // variable = -1000F*(h.getOffset()+1);
     EngineType type = EngineType.engineList[h.getOffset()];
     te = type.getTEInstanceForRender();
     ((TileEntityEngine) te).setType(type.getCraftedProduct());
   }
   if (h == HandbookRegistry.SHAFT) {
     variable = -1000F * (timeStep + 1);
   }
   if (h == HandbookRegistry.FLYWHEEL) {
     int tick = (int) ((System.nanoTime() / SECOND) % RotaryNames.getNumberFlywheelTypes());
     variable = 500 - 1000F * (tick + 1);
   }
   if (h == HandbookRegistry.GEARBOX) {
     variable = -1000F * (timeStep + 1);
   }
   if (h == HandbookRegistry.WORM) {
     variable = -1000F;
   }
   if (h == HandbookRegistry.CVT) {
     variable = -2000F;
   }
   if (h == HandbookRegistry.COIL) {
     int tick = (int) ((System.nanoTime() / SECOND) % 2);
     if (tick == 1) ((TileEntityAdvancedGear) te).setBedrock(true);
     variable = -3000F;
   }
   double sc = 48;
   GL11.glPushMatrix();
   if (m.hasModel() && !m.isPipe()) {
     double dx = x;
     double dy = y + 21;
     double dz = 0;
     GL11.glTranslated(dx, dy, dz);
     GL11.glScaled(sc, -sc, sc);
     GL11.glRotatef(renderq, 1, 0, 0);
     GL11.glRotatef(r, 0, 1, 0);
     TileEntityRendererDispatcher.instance.renderTileEntityAt(te, -0.5, 0, -0.5, variable);
   } else {
     double dx = x;
     double dy = y;
     double dz = 0;
     GL11.glTranslated(dx, dy, dz);
     GL11.glScaled(sc, -sc, sc);
     GL11.glRotatef(renderq, 1, 0, 0);
     GL11.glRotatef(r, 0, 1, 0);
     ReikaTextureHelper.bindTerrainTexture();
     rb.renderBlockAsItem(m.getBlock(), m.getBlockMetadata(), 1);
   }
   GL11.glPopMatrix();
 }