mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-17 19:25:02 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
0cc3fa06c2
commit
655636b7e9
231 files changed
+10024
-8585
No files matched your search
@@ -26,36 +26,45 @@ import tconstruct.library.crafting.CastingRecipe;
|
||||
|
||||
@ZenClass("mods.tconstruct.Casting")
|
||||
public class Casting {
|
||||
|
||||
|
||||
protected static final String name = "TConstruct Casting";
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addBasinRecipe(IItemStack output, ILiquidStack metal, @Optional IItemStack cast, @Optional boolean consume, int delay) {
|
||||
if(metal == null || output == null) {
|
||||
public static void addBasinRecipe(IItemStack output, ILiquidStack metal, @Optional IItemStack cast,
|
||||
@Optional boolean consume, int delay) {
|
||||
if (metal == null || output == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(new CastingRecipe(toStack(output), toFluid(metal), toStack(cast), consume, delay, null), TConstructHelper.basinCasting));
|
||||
|
||||
MineTweakerAPI.apply(
|
||||
new Add(
|
||||
new CastingRecipe(toStack(output), toFluid(metal), toStack(cast), consume, delay, null),
|
||||
TConstructHelper.basinCasting));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addTableRecipe(IItemStack output, ILiquidStack metal, @Optional IItemStack cast, @Optional boolean consume, int delay) {
|
||||
if(metal == null || output == null) {
|
||||
public static void addTableRecipe(IItemStack output, ILiquidStack metal, @Optional IItemStack cast,
|
||||
@Optional boolean consume, int delay) {
|
||||
if (metal == null || output == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
MineTweakerAPI.apply(new Add(new CastingRecipe(toStack(output), toFluid(metal), toStack(cast), consume, delay, null), TConstructHelper.tableCasting));
|
||||
|
||||
MineTweakerAPI.apply(
|
||||
new Add(
|
||||
new CastingRecipe(toStack(output), toFluid(metal), toStack(cast), consume, delay, null),
|
||||
TConstructHelper.tableCasting));
|
||||
}
|
||||
|
||||
//Passes the list to the base list implementation, and adds the recipe
|
||||
// Passes the list to the base list implementation, and adds the recipe
|
||||
private static class Add extends BaseListAddition<CastingRecipe> {
|
||||
|
||||
public Add(CastingRecipe recipe, ArrayList<CastingRecipe> list) {
|
||||
super(Casting.name, list);
|
||||
|
||||
|
||||
this.recipes.add(recipe);
|
||||
}
|
||||
|
||||
@@ -68,62 +77,72 @@ public class Casting {
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void removeTableRecipe(IIngredient output, @Optional IIngredient material, @Optional IIngredient cast) {
|
||||
public static void removeTableRecipe(IIngredient output, @Optional IIngredient material,
|
||||
@Optional IIngredient cast) {
|
||||
removeRecipe(output, material, cast, TConstructHelper.tableCasting);
|
||||
}
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void removeBasinRecipe(IIngredient output, @Optional IIngredient material, @Optional IIngredient cast) {
|
||||
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) {
|
||||
|
||||
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) {
|
||||
|
||||
if (material == null) {
|
||||
material = IngredientAny.INSTANCE;
|
||||
}
|
||||
|
||||
if(cast == null) {
|
||||
|
||||
if (cast == null) {
|
||||
cast = IngredientAny.INSTANCE;
|
||||
}
|
||||
|
||||
|
||||
List<CastingRecipe> recipes = new LinkedList<CastingRecipe>();
|
||||
|
||||
for(CastingRecipe recipe : list) {
|
||||
if(recipe != null) {
|
||||
|
||||
for (CastingRecipe recipe : list) {
|
||||
if (recipe != null) {
|
||||
if (!matches(output, toIItemStack(recipe.output))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!matches(material, toILiquidStack(recipe.castingMetal))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!matches(cast, toIItemStack(recipe.cast))) {
|
||||
|
||||
if (!matches(cast, toIItemStack(recipe.cast))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
recipes.add(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
if(!recipes.isEmpty()) {
|
||||
|
||||
if (!recipes.isEmpty()) {
|
||||
MineTweakerAPI.apply(new Remove(list, recipes));
|
||||
} else {
|
||||
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()));
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
// Removes all matching recipes, apply is never the same for anything, so will always need to override it
|
||||
private static class Remove extends BaseListRemoval<CastingRecipe> {
|
||||
|
||||
public Remove(List<CastingRecipe> list, List<CastingRecipe> recipes) {
|
||||
super(Casting.name, list, recipes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo(CastingRecipe recipe) {
|
||||
|
||||
Reference in new issue
Block a user