mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-20 04:19:44 +00:00
More Logging rework
This commit is contained in:
1 parent
ece7dca426
commit
2dd8e910f4
60 files changed
+464
-322
No files matched your search
@@ -10,7 +10,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 modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -42,18 +42,18 @@ public class TConstructLogger implements ICommandFunction {
|
||||
if(args.isEmpty() || args.contains("casting")) {
|
||||
for(CastingRecipe recipe : TConstructHelper.basinCasting) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Casting.addBasinRecipe(%s, %s, %s, %s, %d);",
|
||||
InputHelper.getStackDescription(recipe.output),
|
||||
InputHelper.getStackDescription(recipe.castingMetal),
|
||||
InputHelper.getStackDescription(recipe.cast),
|
||||
LogHelper.getStackDescription(recipe.output),
|
||||
LogHelper.getStackDescription(recipe.castingMetal),
|
||||
LogHelper.getStackDescription(recipe.cast),
|
||||
recipe.consumeCast,
|
||||
recipe.coolTime));
|
||||
}
|
||||
|
||||
for(CastingRecipe recipe : TConstructHelper.tableCasting) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Casting.addTableRecipe(%s, %s, %s, %s, %d);",
|
||||
InputHelper.getStackDescription(recipe.output),
|
||||
InputHelper.getStackDescription(recipe.castingMetal),
|
||||
InputHelper.getStackDescription(recipe.cast),
|
||||
LogHelper.getStackDescription(recipe.output),
|
||||
LogHelper.getStackDescription(recipe.castingMetal),
|
||||
LogHelper.getStackDescription(recipe.cast),
|
||||
recipe.consumeCast,
|
||||
recipe.coolTime));
|
||||
}
|
||||
@@ -62,8 +62,8 @@ public class TConstructLogger implements ICommandFunction {
|
||||
if(args.isEmpty() || args.contains("drying")) {
|
||||
for(DryingRecipe recipe : DryingRackRecipes.recipes) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Drying.addRecipe(%s, %s, %d);",
|
||||
InputHelper.getStackDescription(recipe.input),
|
||||
InputHelper.getStackDescription(recipe.result),
|
||||
LogHelper.getStackDescription(recipe.input),
|
||||
LogHelper.getStackDescription(recipe.result),
|
||||
recipe.time));
|
||||
}
|
||||
}
|
||||
@@ -75,21 +75,21 @@ public class TConstructLogger implements ICommandFunction {
|
||||
ItemStack renderItem = TConstructHelper.renderIndex.get(recipe.getKey());
|
||||
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Smeltery.addMelting(%s, %s, %d, %s);",
|
||||
InputHelper.getStackDescription(new ItemStack(recipe.getKey().item, 1, recipe.getKey().meta)),
|
||||
InputHelper.getStackDescription(recipe.getValue()),
|
||||
LogHelper.getStackDescription(new ItemStack(recipe.getKey().item, 1, recipe.getKey().meta)),
|
||||
LogHelper.getStackDescription(recipe.getValue()),
|
||||
temperature,
|
||||
InputHelper.getStackDescription(renderItem)));
|
||||
LogHelper.getStackDescription(renderItem)));
|
||||
}
|
||||
|
||||
for(AlloyMix recipe : TConstructHelper.alloys) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Smeltery.addAlloy(%s, %s);",
|
||||
InputHelper.getStackDescription(recipe.result),
|
||||
InputHelper.getArrayDescription(recipe.mixers)));
|
||||
LogHelper.getStackDescription(recipe.result),
|
||||
LogHelper.getListDescription(recipe.mixers)));
|
||||
}
|
||||
|
||||
for(Entry<Fluid, Integer[]> fuel : TConstructHelper.fuelList.entrySet()) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Smeltery.addFuel(%s, %d, %d);",
|
||||
InputHelper.getStackDescription(new FluidStack(fuel.getKey(), 1)),
|
||||
LogHelper.getStackDescription(new FluidStack(fuel.getKey(), 1)),
|
||||
fuel.getValue()[0],
|
||||
fuel.getValue()[1]));
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.item.IngredientAny;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
@@ -62,7 +61,7 @@ public class Casting {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(CastingRecipe recipe) {
|
||||
return InputHelper.getStackDescription(recipe.output);
|
||||
return LogHelper.getStackDescription(recipe.output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,11 +74,16 @@ public class Casting {
|
||||
|
||||
@ZenMethod
|
||||
public static void removeBasinRecipe(IIngredient output, @Optional IIngredient material, @Optional IIngredient cast) {
|
||||
|
||||
removeRecipe(output, material, cast, TConstructHelper.basinCasting);
|
||||
}
|
||||
|
||||
public static void removeRecipe(IIngredient output, IIngredient material, IIngredient cast, List<CastingRecipe> list) {
|
||||
|
||||
if(output == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
if(material == null) {
|
||||
material = IngredientAny.INSTANCE;
|
||||
}
|
||||
@@ -111,7 +115,7 @@ public class Casting {
|
||||
if(!recipes.isEmpty()) {
|
||||
MineTweakerAPI.apply(new Remove(list, recipes));
|
||||
} else {
|
||||
LogHelper.logWarning(String.format("No %s Recipe found for output %s, meterial %s and cast %s. Command ignored!", Casting.name, output.toString(), material.toString(), cast.toString()));
|
||||
LogHelper.logWarning(String.format("No %s Recipe found for output %s, material %s and cast %s. Command ignored!", Casting.name, output.toString(), material.toString(), cast.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +127,7 @@ public class Casting {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(CastingRecipe recipe) {
|
||||
return InputHelper.getStackDescription(recipe.output);
|
||||
return LogHelper.getStackDescription(recipe.output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import java.util.List;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
@@ -45,7 +44,7 @@ public class Drying {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(DryingRecipe recipe) {
|
||||
return InputHelper.getStackDescription(recipe.result);
|
||||
return LogHelper.getStackDescription(recipe.result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +76,7 @@ public class Drying {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(DryingRecipe recipe) {
|
||||
return InputHelper.getStackDescription(recipe.result);
|
||||
return LogHelper.getStackDescription(recipe.result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
@@ -66,7 +65,7 @@ public class Smeltery {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(AlloyMix recipe) {
|
||||
return InputHelper.getStackDescription(recipe.result);
|
||||
return LogHelper.getStackDescription(recipe.result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ public class Smeltery {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(AlloyMix recipe) {
|
||||
return InputHelper.getStackDescription(recipe.result);
|
||||
return LogHelper.getStackDescription(recipe.result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +156,7 @@ public class Smeltery {
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo(MeltingRecipe recipe) {
|
||||
return InputHelper.getStackDescription(recipe.input);
|
||||
return LogHelper.getStackDescription(recipe.input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +211,7 @@ public class Smeltery {
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo(MeltingRecipe recipe) {
|
||||
return InputHelper.getStackDescription(recipe.input);
|
||||
return LogHelper.getStackDescription(recipe.input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +267,7 @@ public class Smeltery {
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo(Entry<Fluid, Integer[]> recipe) {
|
||||
return InputHelper.getStackDescription(new FluidStack(recipe.getKey(), 1));
|
||||
return LogHelper.getStackDescription(new FluidStack(recipe.getKey(), 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +294,7 @@ public class Smeltery {
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo(Entry<Fluid, Integer[]> recipe) {
|
||||
return InputHelper.getStackDescription(new FluidStack(recipe.getKey(), 1));
|
||||
return LogHelper.getStackDescription(new FluidStack(recipe.getKey(), 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
import modtweaker2.utils.BaseListAddition;
|
||||
import modtweaker2.utils.BaseListRemoval;
|
||||
@@ -78,7 +78,7 @@ public class TiCTweaks {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(ItemKey recipe) {
|
||||
return InputHelper.getStackDescription(new ItemStack(recipe.item, 1, recipe.damage));
|
||||
return LogHelper.getStackDescription(new ItemStack(recipe.item, 1, recipe.damage));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class TiCTweaks {
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(ItemKey recipe) {
|
||||
return InputHelper.getStackDescription(new ItemStack(recipe.item, 1, recipe.damage));
|
||||
return LogHelper.getStackDescription(new ItemStack(recipe.item, 1, recipe.damage));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user