Exemplo n.º 1
0
 private void logProcessorRecipes() {
   for (IProcessorRecipe recipe : RecipeRegisterManager.processorRecipe.getRecipes()) {
     String o = "mods.amt.Processor.addRecipe(" + getItemDeclaration(recipe.getOutput());
     float sec = recipe.getChance();
     boolean ret = recipe.forceReturnContainer();
     if ((recipe.getSecondary() != null) | (sec != 0) | ret) {
       o += ", " + getItemDeclaration(recipe.getSecondary());
     }
     o += ", [";
     boolean first = true;
     for (Object x : recipe.getInput()) {
       if (!first) {
         o += ", ";
       } else {
         first = false;
       }
       o += getObjectDeclaration(x);
     }
     o += "], ";
     if (recipe.isFoodRecipe()) {
       o += "true";
     } else {
       o += "false";
     }
     if ((sec != 0) | ret) {
       o += ", " + sec;
     }
     if (ret) {
       o += ", true";
     }
     MineTweakerAPI.logCommand(o + ");");
   }
 }
Exemplo n.º 2
0
 private void logChocolateRecipes(IPlayer player) {
   for (Map.Entry<Object, ItemStack> entry :
       RecipeRegisterManager.chocoRecipe.getRecipeList().entrySet()) {
     String input = getObjectDeclaration(entry.getKey());
     if (player != null) player.sendChat(input + " ---> " + getItemDeclaration(entry.getValue()));
     MineTweakerAPI.logCommand(
         "mods.amt.Pan.addChocolateRecipe("
             + getItemDeclaration(entry.getValue())
             + ", "
             + input
             + ");");
   }
 }
Exemplo n.º 3
0
 private void logBarrelRecipes(IPlayer player) {
   for (Map.Entry<Fluid, Fluid> entry : BrewingRecipe.instance.recipeMap().entrySet()) {
     if (player != null)
       player.sendChat(
           getItemDeclaration(entry.getKey()) + " ---> " + getItemDeclaration(entry.getValue()));
     MineTweakerAPI.logCommand(
         "mods.amt.Pan.addChocolateRecipe("
             + getItemDeclaration(entry.getValue())
             + ", "
             + getItemDeclaration(entry.getKey())
             + ");");
   }
 }
Exemplo n.º 4
0
 private void logIceRecipes() {
   for (IIceRecipe recipe : RecipeRegisterManager.iceRecipe.getRecipeList()) {
     String output =
         "mods.amt.IceMaker.addRecipe("
             + getItemDeclaration(recipe.getOutput())
             + ", "
             + getItemDeclaration(recipe.getInput());
     ItemStack container = recipe.getContainer();
     if (container != null) output += ", " + getItemDeclaration(container);
     output += ");";
     MineTweakerAPI.logCommand(output);
   }
 }
Exemplo n.º 5
0
 private void logEvaporatorRecipes() {
   for (IEvaporatorRecipe recipe : RecipeRegisterManager.evaporatorRecipe.getRecipeList()) {
     ItemStack input = recipe.getInput();
     ItemStack output = recipe.getOutput();
     FluidStack secondary = recipe.getSecondary();
     String o = "mods.amt.Evaporator.addRecipe(";
     if (output != null) o += getItemDeclaration(output) + ", ";
     if (secondary != null) o += getItemDeclaration(secondary) + ", ";
     o += getItemDeclaration(input);
     if (!recipe.returnContainer()) o += ", false";
     o += ");";
     MineTweakerAPI.logCommand(o);
   }
 }
Exemplo n.º 6
0
 private void logTeaRecipes() {
   for (ITeaRecipe recipe : RecipeRegisterManager.teaRecipe.getRecipeList()) {
     String o = "mods.amt.Processor.addRecipe(" + getItemDeclaration(recipe.getOutput());
     ItemStack milk = recipe.getOutputMilk();
     if (milk != null) {
       o += ", " + getItemDeclaration(milk);
     }
     o += ", " + getItemDeclaration(recipe.getInput()) + ", \"" + recipe.getTex() + "\"";
     if ((milk != null) && (recipe.getTex() != recipe.getMilkTex())) {
       o += ", \"" + recipe.getMilkTex() + "\"";
     }
     MineTweakerAPI.logCommand(o + ");");
   }
 }
Exemplo n.º 7
0
 private void logPlateRecipes() {
   for (IPlateRecipe recipe : RecipeRegisterManager.plateRecipe.getRecipeList()) {
     String o =
         "mods.amt.Plate.addRecipe("
             + getItemDeclaration(recipe.getOutput())
             + ", "
             + getItemDeclaration(recipe.getInput())
             + ", "
             + recipe.cookingTime()
             + ", ";
     if (recipe.useOvenRecipe()) {
       o += "true";
     } else {
       o += "false";
     }
     MineTweakerAPI.logCommand(o + ");");
   }
 }
Exemplo n.º 8
0
 private void logPanRecipes() {
   for (IPanRecipe recipe : RecipeRegisterManager.panRecipe.getRecipeList()) {
     ItemStack jpoutput = recipe.getOutputJP();
     String o = "mods.amt.Pan.addRecipe(" + getItemDeclaration(recipe.getOutput());
     if (jpoutput != null) {
       o += ", " + getItemDeclaration(jpoutput);
     }
     o +=
         ", "
             + getItemDeclaration(recipe.getInput())
             + ", \""
             + recipe.getTex()
             + "\", \""
             + recipe.getDisplayName()
             + "\");";
     MineTweakerAPI.logCommand(o);
   }
 }
Exemplo n.º 9
0
 private void logBoth(IPlayer player, String s) {
   MineTweakerAPI.logCommand(s);
   if (player != null) player.sendChat(s);
 }
Exemplo n.º 10
0
 @Override
 public void execute(String[] arguments, IPlayer player) {
   if (arguments.length > 0) {
     if (arguments[0].equalsIgnoreCase("charge")) {
       logBoth(player, "Battery:");
       for (IChargeItem i : ChargeItemManager.chargeItem.getChargeItemList()) {
         String s = getItemDeclaration(i.getItem());
         if (i.returnItem() != null) {
           s += " --> " + getItemDeclaration(i.returnItem());
         }
         s += " --- " + i.getItem().getDisplayName() + " (" + i.chargeAmount() + ")";
         logBoth(player, s);
       }
       logBoth(player, "Ice Maker:");
       for (IChargeIce i : RecipeRegisterManager.iceRecipe.getChargeItemList()) {
         logBoth(
             player,
             getItemDeclaration(i.getItem())
                 + " --- "
                 + i.getItem().getDisplayName()
                 + " ("
                 + i.chargeAmount()
                 + ")");
       }
     } else if (arguments[0].equalsIgnoreCase("choco")) {
       logBoth(player, "Chocolate Recipes:");
       logChocolateRecipes(player);
       /*
       for (Map.Entry<Object, ItemStack> entry: RecipeRegisterManager.chocoRecipe.getRecipeList().entrySet()) {
           String input = "";
           if (entry.getKey() instanceof String) {
               input = "<ore:" + (String) entry.getKey() + ">";
           } else {
               input = getItemDeclaration((ItemStack) entry.getKey());
           }
           player.sendChat(input + " ---> " + getItemDeclaration(entry.getValue()));
           MineTweakerAPI.logCommand("mods.amt.Pan.addChocolateRecipe(" + getItemDeclaration(entry.getValue()) + ", " + input + ");");
       }
       */
     } else if (arguments[0].equalsIgnoreCase("heat")) {
       logBoth(player, "Pan:");
       for (ItemStack i : RecipeRegisterManager.panRecipe.getHeatSourceList()) {
         logBoth(player, getItemDeclaration(i) + " -- " + i.getDisplayName());
       }
       logBoth(player, "Plate:");
       for (ItemStack i : RecipeRegisterManager.plateRecipe.getHeatSourceList()) {
         logBoth(player, getItemDeclaration(i) + " -- " + i.getDisplayName());
       }
     } else if (arguments[0].equalsIgnoreCase("recipes")) {
       MineTweakerAPI.logCommand("Barrel brewing recipes:");
       logBarrelRecipes(null);
       MineTweakerAPI.logCommand("Chocolate fondue recipes:");
       logChocolateRecipes(null);
       MineTweakerAPI.logCommand("Evaporator recipes:");
       logEvaporatorRecipes();
       MineTweakerAPI.logCommand("Ice Maker recipes:");
       logIceRecipes();
       MineTweakerAPI.logCommand("Pan recipes:");
       logPanRecipes();
       MineTweakerAPI.logCommand("Plate recipes:");
       logPlateRecipes();
       MineTweakerAPI.logCommand("Processor recipes:");
       logProcessorRecipes();
       MineTweakerAPI.logCommand("Teamaker recipes:");
       logTeaRecipes();
       player.sendChat("AMT recipes have been written to the MineTweaker log.");
     } else if (arguments[0].equalsIgnoreCase("slag")) {
       for (int l = 1; l <= 5; l++) {
         logBoth(player, "Tier " + l + ":");
         for (ItemStack i : RecipeRegisterManager.slagLoot.getLootList(l)) {
           logBoth(player, getItemDeclaration(i) + " -- " + i.getDisplayName());
         }
       }
     } else {
       player.sendChat("Unknown subcommand: " + arguments[0]);
     }
   } else {
     player.sendChat("Please use a subcommand.");
   }
 }