More Logging rework

This commit is contained in:
Zixxl committed 2015-07-09 11:28:40 +02:00
1 parent ece7dca426
commit 2dd8e910f4
60 files changed
+464 -322

No files matched your search

@@ -8,7 +8,7 @@ import minetweaker.MineTweakerAPI;
import minetweaker.MineTweakerImplementationAPI;
import minetweaker.api.player.IPlayer;
import minetweaker.api.server.ICommandFunction;
import modtweaker2.helpers.InputHelper;
import modtweaker2.helpers.LogHelper;
import modtweaker2.helpers.StringHelper;
import appeng.api.AEApi;
import appeng.api.features.IGrinderEntry;
@@ -35,12 +35,12 @@ public class AppliedEnergisticsLogger implements ICommandFunction {
if(args.isEmpty() || args.contains("grinder")) {
for(IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) {
MineTweakerAPI.logCommand(String.format("mods.appeng.Grinder.addRecipe(%s, %s, %d, %s, %s, %s, %s);",
InputHelper.getStackDescription(recipe.getInput()),
InputHelper.getStackDescription(recipe.getOutput()),
LogHelper.getStackDescription(recipe.getInput()),
LogHelper.getStackDescription(recipe.getOutput()),
recipe.getEnergyCost(),
InputHelper.getStackDescription(recipe.getOptionalOutput()),
LogHelper.getStackDescription(recipe.getOptionalOutput()),
recipe.getOptionalChance(),
InputHelper.getStackDescription(recipe.getSecondOptionalOutput()),
LogHelper.getStackDescription(recipe.getSecondOptionalOutput()),
recipe.getSecondOptionalChance()));
}
}
@@ -48,10 +48,10 @@ public class AppliedEnergisticsLogger implements ICommandFunction {
if(args.isEmpty() || args.contains("inscriber")) {
for(IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes()) {
MineTweakerAPI.logCommand(String.format("mods.appeng.Inscriber.addRecipe(%s, %s, %s, %s, \"%s\");",
InputHelper.getArrayDescription(recipe.getInputs()),
InputHelper.getStackDescription(recipe.getTopOptional().orNull()),
InputHelper.getStackDescription(recipe.getBottomOptional().orNull()),
InputHelper.getStackDescription(recipe.getOutput()),
LogHelper.getListDescription(recipe.getInputs()),
LogHelper.getStackDescription(recipe.getTopOptional().orNull()),
LogHelper.getStackDescription(recipe.getBottomOptional().orNull()),
LogHelper.getStackDescription(recipe.getOutput()),
recipe.getProcessType().toString()));
}
}
@@ -1,6 +1,5 @@
package modtweaker2.mods.appeng.handlers;
import static modtweaker2.helpers.InputHelper.getStackDescription;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.InputHelper.toStack;
import static modtweaker2.helpers.StackHelper.matches;
@@ -49,7 +48,7 @@ public class Grind {
// Check if the recipe is already present, we don't want to add duplicates
for(IGrinderEntry r : AEApi.instance().registries().grinder().getRecipes()) {
if(r != null && AppliedEnergisticsHelper.equals(r, recipe)) {
LogHelper.logWarning(String.format("Duplicate %s Recipe found for %s. Command ignored!", name, InputHelper.getStackDescription(toStack(input))));
LogHelper.logWarning(String.format("Duplicate %s Recipe found for %s. Command ignored!", name, LogHelper.getStackDescription(toStack(input))));
return;
}
}
@@ -66,7 +65,7 @@ public class Grind {
@Override
public String getRecipeInfo(IGrinderEntry recipe) {
return getStackDescription(recipe.getInput());
return LogHelper.getStackDescription(recipe.getInput());
}
@Override
@@ -109,7 +108,7 @@ public class Grind {
@Override
public String getRecipeInfo(IGrinderEntry recipe) {
return getStackDescription(recipe.getInput());
return LogHelper.getStackDescription(recipe.getInput());
}
}
@@ -1,6 +1,5 @@
package modtweaker2.mods.appeng.handlers;
import static modtweaker2.helpers.InputHelper.getStackDescription;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.InputHelper.toStack;
import static modtweaker2.helpers.InputHelper.toStacks;
@@ -11,7 +10,6 @@ import java.util.LinkedList;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.InputHelper;
import modtweaker2.helpers.LogHelper;
import modtweaker2.mods.appeng.AppliedEnergisticsHelper;
import modtweaker2.utils.ArrayUtils;
@@ -44,7 +42,7 @@ public class Inscriber {
// Check if the recipe is already present, we don't want to add duplicates
for(IInscriberRecipe r : AEApi.instance().registries().inscriber().getRecipes()) {
if(r != null && AppliedEnergisticsHelper.equals(r, recipe)) {
LogHelper.logWarning(String.format("Duplicate %s Recipe found for %s. Command ignored!", Inscriber.name, InputHelper.getStackDescription(toStack(out))));
LogHelper.logWarning(String.format("Duplicate %s Recipe found for %s. Command ignored!", Inscriber.name, LogHelper.getStackDescription(toStack(out))));
return;
}
}
@@ -87,7 +85,7 @@ public class Inscriber {
@Override
public String getRecipeInfo(IInscriberRecipe recipe) {
return getStackDescription(recipe.getOutput());
return LogHelper.getStackDescription(recipe.getOutput());
}
@Override
@@ -156,7 +154,7 @@ public class Inscriber {
@Override
public String getRecipeInfo(IInscriberRecipe recipe) {
return getStackDescription(recipe.getOutput());
return LogHelper.getStackDescription(recipe.getOutput());
}
}
}