mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-19 03:59:08 +00:00
Better error logging
This commit is contained in:
1 parent
9f61304258
commit
eef4c19a47
7 files changed
+59
-9
No files matched your search
@@ -41,7 +41,13 @@ public class Crucible {
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(ReflectionHelper.getInstance(ThermalHelper.crucibleRecipe, toStack(input), toFluid(output), energy)));
|
||||
RecipeCrucible recipe = ReflectionHelper.getInstance(ThermalHelper.crucibleRecipe, toStack(input), toFluid(output), energy);
|
||||
|
||||
if(recipe != null) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
} else {
|
||||
LogHelper.logError(String.format("Error while creating instance for %s recipe.", name));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition<RecipeCrucible> {
|
||||
|
||||
@@ -41,7 +41,13 @@ public class Furnace {
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(ReflectionHelper.getInstance(ThermalHelper.furanceRecipe, toStack(input), toStack(output), energy)));
|
||||
RecipeFurnace recipe = ReflectionHelper.getInstance(ThermalHelper.furanceRecipe, toStack(input), toStack(output), energy);
|
||||
|
||||
if(recipe != null) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
} else {
|
||||
LogHelper.logError(String.format("Error while creating instance for %s recipe.", name));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition<RecipeFurnace> {
|
||||
|
||||
@@ -46,7 +46,13 @@ public class Pulverizer {
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(ReflectionHelper.getInstance(ThermalHelper.pulverizerRecipe, toStack(input), toStack(output), toStack(secondary), secondaryChance, energy)));
|
||||
RecipePulverizer recipe = ReflectionHelper.getInstance(ThermalHelper.pulverizerRecipe, toStack(input), toStack(output), toStack(secondary), secondaryChance, energy);
|
||||
|
||||
if(recipe != null) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
} else {
|
||||
LogHelper.logError(String.format("Error while creating instance for %s recipe.", name));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition<RecipePulverizer> {
|
||||
|
||||
@@ -46,7 +46,13 @@ public class Sawmill {
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(ReflectionHelper.getInstance(ThermalHelper.sawmillRecipe, toStack(input), toStack(output), toStack(secondary), secondaryChance, energy)));
|
||||
RecipeSawmill recipe = ReflectionHelper.getInstance(ThermalHelper.sawmillRecipe, toStack(input), toStack(output), toStack(secondary), secondaryChance, energy);
|
||||
|
||||
if(recipe != null) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
} else {
|
||||
LogHelper.logError(String.format("Error while creating instance for %s recipe.", name));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition<RecipeSawmill> {
|
||||
|
||||
@@ -46,7 +46,13 @@ public class Smelter {
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(ReflectionHelper.getInstance(ThermalHelper.smelterRecipe, toStack(input), toStack(input2), toStack(output), toStack(output2), chance, energy)));
|
||||
RecipeSmelter recipe = ReflectionHelper.getInstance(ThermalHelper.smelterRecipe, toStack(input), toStack(input2), toStack(output), toStack(output2), chance, energy);
|
||||
|
||||
if(recipe != null) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
} else {
|
||||
LogHelper.logError(String.format("Error while creating instance for %s recipe.", name));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition<RecipeSmelter> {
|
||||
|
||||
@@ -46,7 +46,13 @@ public class Transposer {
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(ReflectionHelper.getInstance(ThermalHelper.transposerRecipe, toStack(input), toStack(output), toFluid(liquid), energy, 100), RecipeType.Fill));
|
||||
RecipeTransposer recipe = ReflectionHelper.getInstance(ThermalHelper.transposerRecipe, toStack(input), toStack(output), toFluid(liquid), energy, 100);
|
||||
|
||||
if(recipe != null) {
|
||||
MineTweakerAPI.apply(new Add(recipe, RecipeType.Fill));
|
||||
} else {
|
||||
LogHelper.logError(String.format("Error while creating instance for %s recipe.", nameFill));
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
@@ -60,8 +66,14 @@ public class Transposer {
|
||||
LogHelper.logWarning(String.format("Duplicate %s Recipe found for %s and %s. Command ignored!", Transposer.nameExtract, InputHelper.getStackDescription(toStack(input)), InputHelper.getStackDescription(toFluid(liquid))));
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(ReflectionHelper.getInstance(ThermalHelper.transposerRecipe, toStack(input), toStack(output), toFluid(liquid), energy, 100), RecipeType.Extract));
|
||||
|
||||
RecipeTransposer recipe = ReflectionHelper.getInstance(ThermalHelper.transposerRecipe, toStack(input), toStack(output), toFluid(liquid), energy, 100);
|
||||
|
||||
if(recipe != null) {
|
||||
MineTweakerAPI.apply(new Add(recipe, RecipeType.Extract));
|
||||
} else {
|
||||
LogHelper.logError(String.format("Error while creating instance for %s recipe.", nameExtract));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition<RecipeTransposer> {
|
||||
|
||||
Reference in new issue
Block a user