コード例 #1
0
 private void getSteam(World world, int x, int y, int z) {
   // for (int i = 0; i < 6; i++) {
   ForgeDirection dir = this.getFacing(); // dirs[i];
   int dx = x + dir.offsetX;
   int dy = y + dir.offsetY;
   int dz = z + dir.offsetZ;
   ReactorTiles rt = ReactorTiles.getTE(world, dx, dy, dz);
   if (rt == ReactorTiles.STEAMLINE) {
     TileEntitySteamLine te = (TileEntitySteamLine) world.getTileEntity(dx, dy, dz);
     int ds = te.getSteam() - steam;
     if (ds > 0) {
       int rm = ds / 4 + 1;
       steam += rm * te.getWorkingFluid().efficiency;
       te.removeSteam(rm);
     }
   }
   // }
 }
コード例 #2
0
 public final ArrayList<String> getMessages(World world, int x, int y, int z, int side) {
   ArrayList<String> li = new ArrayList();
   if (this instanceof Temperatured) {
     String s =
         String.format(
             "%s %s: %dC",
             this.getTEName(), Variables.TEMPERATURE, ((Temperatured) this).getTemperature());
     li.add(s);
   } else if (this instanceof ThermalMachine) {
     String s =
         String.format(
             "%s %s: %dC",
             this.getTEName(), Variables.TEMPERATURE, ((ThermalMachine) this).getTemperature());
     // li.add(s);
   } else if (this instanceof TemperatureTE) {
     String s =
         String.format(
             "%s %s: %dC",
             this.getTEName(), Variables.TEMPERATURE, ((TemperatureTE) this).getTemperature());
     li.add(s);
   }
   if (this instanceof TileEntityReactorPiping) {
     TileEntityReactorPiping rp = (TileEntityReactorPiping) this;
     if (rp.getLevel() <= 0) {
       String s = String.format("%s is empty.", this.getTEName());
       li.add(s);
     } else {
       String s =
           String.format(
               "%s contains %d mB of %s",
               this.getTEName(), rp.getLevel(), rp.getFluidType().getLocalizedName());
       li.add(s);
     }
   }
   if (this instanceof TileEntitySolenoidMagnet) {
     ShaftPowerReceiver sp = (ShaftPowerReceiver) this;
     String pre = ReikaEngLibrary.getSIPrefix(sp.getPower());
     double base = ReikaMathLibrary.getThousandBase(sp.getPower());
     li.add(
         String.format(
             "%s receiving %.3f %sW @ %d rad/s.", sp.getName(), base, pre, sp.getOmega()));
   }
   if (this instanceof TileEntityReactorGenerator) {
     TileEntityReactorGenerator sp = (TileEntityReactorGenerator) this;
     li.add(
         String.format(
             "%s generating %.3f %s/t.", sp.getName(), sp.getGenUnits(), sp.getUnitSymbol()));
   }
   if (this instanceof TileEntityTurbineCore) {
     TileEntityTurbineCore sp = (TileEntityTurbineCore) this;
     long power = sp.getPower();
     String pre = ReikaEngLibrary.getSIPrefix(power);
     double base = ReikaMathLibrary.getThousandBase(power);
     li.add(
         String.format(
             "%s producing %.3f %sW @ %d rad/s.", sp.getName(), base, pre, sp.getOmega()));
     li.add(String.format("Lubricant level %d mB per block.", sp.getLubricant()));
   }
   if (this instanceof TileEntitySteamLine) {
     TileEntitySteamLine sl = (TileEntitySteamLine) this;
     String s = String.format("%s contains %d m^3 of steam.", this.getTEName(), sl.getSteam());
     li.add(s);
   }
   return li;
 }