コード例 #1
0
ファイル: InfoType.java プロジェクト: neilfre/FlansMod
 /** Pack reader */
 protected void read(String[] arg0, TypeFile file) {
   try {
     if (arg0[0].equals("Name")) {
       name = arg0[1];
       for (int i = 0; i < arg0.length - 2; i++) {
         name = name + " " + arg0[i + 2];
       }
     }
     if (arg0[0].equals("ShortName")) {
       shortName = arg0[1];
     }
     if (arg0[0].equals("Colour") || arg0[0].equals("Color")) {
       colour =
           (Integer.parseInt(arg0[1]) << 16)
               + ((Integer.parseInt(arg0[2])) << 8)
               + ((Integer.parseInt(arg0[3])));
     }
     if (arg0[0].equals("ItemID")) {
       itemID = Integer.parseInt(arg0[1]);
     }
     if (arg0[0].equals("Icon")) {
       iconPath = arg0[1];
     }
     if (arg0[0].equals("RecipeOutput")) {
       recipeOutput = Integer.parseInt(arg0[1]);
     }
     if (arg0[0].equals("Recipe")) {
       recipe = new Object[arg0.length + 2];
       for (int i = 0; i < 3; i++) {
         String line = null;
         line = file.readLine();
         if (line == null) {
           continue;
         }
         if (line == null || line.startsWith("//")) {
           i--;
           continue;
         }
         recipe[i] = line;
       }
       recipeLine = arg0;
       shapeless = false;
     }
     if (arg0[0].equals("ShapelessRecipe")) {
       recipeLine = arg0;
       shapeless = true;
     }
     if (arg0[0].equals("SmeltableFrom")) {
       smeltableFrom = arg0[1];
     }
   } catch (Exception e) {
     FlansMod.log("Reading file failed : " + shortName);
     e.printStackTrace();
   }
 }
コード例 #2
0
ファイル: InfoType.java プロジェクト: neilfre/FlansMod
 protected void read(TypeFile file) {
   for (; ; ) {
     String line = null;
     line = file.readLine();
     if (line == null) break;
     if (line.startsWith("//")) continue;
     String[] split = line.split(" ");
     if (split.length < 2) continue;
     read(split, file);
   }
 }