Merged branch master into master
This commit is contained in:
commit
e43a9f482d
5 changed files with 40 additions and 42 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -29,18 +29,18 @@ public class Casting {
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void addBasinRecipe(IItemStack output, ILiquidStack metal, @Optional IItemStack cast) {
|
public static void addBasinRecipe(IItemStack output, ILiquidStack liquid, @Optional IItemStack cast) {
|
||||||
if (metal == null || output == null) {
|
if (liquid == null || output == null) {
|
||||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CastingRecipe rec = new CastingRecipe(toStack(output), RecipeMatch.of(toStack(cast)), toFluid(metal).getFluid(), metal.getAmount());
|
CastingRecipe rec = new CastingRecipe(toStack(output), RecipeMatch.of(toStack(cast)), toFluid(liquid).getFluid(), liquid.getAmount());
|
||||||
MineTweakerAPI.apply(new Add(rec, (LinkedList<CastingRecipe>) TConstructHelper.basinCasting));
|
MineTweakerAPI.apply(new Add(rec, (LinkedList<CastingRecipe>) TConstructHelper.basinCasting));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void addTableRecipe(IItemStack output, ILiquidStack metal, @Optional IItemStack cast) {
|
public static void addTableRecipe(IItemStack output, ILiquidStack liquid, @Optional IItemStack cast) {
|
||||||
if (metal == null || output == null) {
|
if (liquid == null || output == null) {
|
||||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public class Casting {
|
||||||
if (cast != null) {
|
if (cast != null) {
|
||||||
match = RecipeMatch.of(toStack(cast));
|
match = RecipeMatch.of(toStack(cast));
|
||||||
}
|
}
|
||||||
CastingRecipe rec = new CastingRecipe(toStack(output), match, toFluid(metal).getFluid(), metal.getAmount());
|
CastingRecipe rec = new CastingRecipe(toStack(output), match, toFluid(liquid).getFluid(), liquid.getAmount());
|
||||||
MineTweakerAPI.apply(new Add(rec, (LinkedList<CastingRecipe>) TConstructHelper.tableCasting));
|
MineTweakerAPI.apply(new Add(rec, (LinkedList<CastingRecipe>) TConstructHelper.tableCasting));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,24 +68,24 @@ public class Casting {
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void removeTableRecipe(IIngredient output, @Optional IIngredient material, @Optional IIngredient cast) {
|
public static void removeTableRecipe(IIngredient output, @Optional IIngredient liquid, @Optional IIngredient cast) {
|
||||||
removeRecipe(output, material, cast, TConstructHelper.tableCasting);
|
removeRecipe(output, liquid, cast, TConstructHelper.tableCasting);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void removeBasinRecipe(IIngredient output, @Optional IIngredient material, @Optional IIngredient cast) {
|
public static void removeBasinRecipe(IIngredient output, @Optional IIngredient liquid, @Optional IIngredient cast) {
|
||||||
|
|
||||||
removeRecipe(output, material, cast, TConstructHelper.basinCasting);
|
removeRecipe(output, liquid, cast, TConstructHelper.basinCasting);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeRecipe(IIngredient output, IIngredient material, IIngredient cast, List<CastingRecipe> list) {
|
public static void removeRecipe(IIngredient output, IIngredient liquid, IIngredient cast, List<CastingRecipe> list) {
|
||||||
if (output == null) {
|
if (output == null) {
|
||||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (material == null) {
|
if (liquid == null) {
|
||||||
material = IngredientAny.INSTANCE;
|
liquid = IngredientAny.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CastingRecipe> recipes = new LinkedList<CastingRecipe>();
|
List<CastingRecipe> recipes = new LinkedList<CastingRecipe>();
|
||||||
|
@ -97,7 +97,7 @@ public class Casting {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!matches(material, toILiquidStack(recipe.getFluid()))) {
|
if (!matches(liquid, toILiquidStack(recipe.getFluid()))) {
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ public class Casting {
|
||||||
} else
|
} 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 != null ? cast.toString() : null));
|
LogHelper.logWarning(String.format("No %s Recipe found for output %s, material %s and cast %s. Command ignored!", Casting.name, output.toString(), liquid.toString(), cast != null ? cast.toString() : null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class Smeltery {
|
||||||
|
|
||||||
// Adding a TConstruct Melting recipe
|
// Adding a TConstruct Melting recipe
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void addMelting(IIngredient input, ILiquidStack output, int temp, @Optional IItemStack block) {
|
public static void addMelting(ILiquidStack output, IIngredient input, int temp, @Optional IItemStack block) {
|
||||||
|
|
||||||
if (input == null || output == null) {
|
if (input == null || output == null) {
|
||||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", nameMelting));
|
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", nameMelting));
|
||||||
|
@ -210,6 +210,30 @@ public class Smeltery {
|
||||||
* TConstruct Fuel Recipes
|
* TConstruct Fuel Recipes
|
||||||
**********************************************/
|
**********************************************/
|
||||||
|
|
||||||
|
@ZenMethod
|
||||||
|
public static void addFuel(ILiquidStack liquid) {
|
||||||
|
if (liquid == null) {
|
||||||
|
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", nameFuel));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FluidStack> stacks = new ArrayList<FluidStack>();
|
||||||
|
stacks.add(toFluid(liquid));
|
||||||
|
MineTweakerAPI.apply(new AddFuel(stacks));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class AddFuel extends BaseListAddition<FluidStack> {
|
||||||
|
|
||||||
|
public AddFuel(List<FluidStack> recipes) {
|
||||||
|
super(Smeltery.nameFuel, TConstructHelper.fuelList, recipes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRecipeInfo(FluidStack recipe) {
|
||||||
|
return LogHelper.getStackDescription(recipe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void removeFuel(IIngredient input) {
|
public static void removeFuel(IIngredient input) {
|
||||||
|
@ -238,30 +262,4 @@ public class Smeltery {
|
||||||
return LogHelper.getStackDescription(recipe);
|
return LogHelper.getStackDescription(recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@ZenMethod
|
|
||||||
public static void addFuel(ILiquidStack liquid) {
|
|
||||||
if (liquid == null) {
|
|
||||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", nameFuel));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<FluidStack> stacks = new ArrayList<FluidStack>();
|
|
||||||
stacks.add(toFluid(liquid));
|
|
||||||
MineTweakerAPI.apply(new AddFuel(stacks));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class AddFuel extends BaseListAddition<FluidStack> {
|
|
||||||
|
|
||||||
public AddFuel(List<FluidStack> recipes) {
|
|
||||||
super(Smeltery.nameFuel, TConstructHelper.fuelList, recipes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRecipeInfo(FluidStack recipe) {
|
|
||||||
return LogHelper.getStackDescription(recipe);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue