These are vanilla items blargh
This commit is contained in:
Shadows_of_Fire 2017-08-08 11:05:44 -04:00
parent daefd71504
commit 9aed16c52a
4 changed files with 39 additions and 6 deletions

View file

@ -144,6 +144,11 @@ public final class ActuallyAdditionsAPI{
return methodHandler.addCrusherRecipes(inputs, outputOnes, outputOneAmounts, outputTwos, outputTwoAmounts, outputTwoChance); return methodHandler.addCrusherRecipes(inputs, outputOnes, outputOneAmounts, outputTwos, outputTwoAmounts, outputTwoChance);
} }
//Same thing as above, but with ItemStack outputs.
public static boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance){
return methodHandler.addCrusherRecipes(inputs, outputOne, outputOneAmount, outputTwo, outputTwoAmount, outputTwoChance);
}
/** /**
* Adds a Recipe to the Oil generator * Adds a Recipe to the Oil generator
* *

View file

@ -45,6 +45,8 @@ public interface IMethodHandler{
boolean invokeReconstructor(IAtomicReconstructor tile); boolean invokeReconstructor(IAtomicReconstructor tile);
boolean addCrusherRecipes(List<ItemStack> inputs, List<ItemStack> outputOnes, int outputOneAmounts, List<ItemStack> outputTwos, int outputTwoAmounts, int outputTwoChance); boolean addCrusherRecipes(List<ItemStack> inputs, List<ItemStack> outputOnes, int outputOneAmounts, List<ItemStack> outputTwos, int outputTwoAmounts, int outputTwoChance);
boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance);
IBookletPage generateTextPage(int id); IBookletPage generateTextPage(int id);

View file

@ -71,13 +71,13 @@ public final class CrusherCrafting{
ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), new ItemStack(Items.DYE, 4, 9), null, 0); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), new ItemStack(Items.DYE, 4, 9), null, 0);
MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe());
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreRedstone", false), OreDictionary.getOres("dustRedstone", false), 10, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreRedstone", false), new ItemStack(Items.REDSTONE), 10, null, 0, 0);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreLapis", false), OreDictionary.getOres("gemLapis", false), 12, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreLapis", false), new ItemStack(Items.DYE, 1, 4), 12, null, 0, 0);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("coal", false), OreDictionary.getOres("dustCoal", false), 1, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("coal", false), OreDictionary.getOres("dustCoal", false), 1, null, 0, 0);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreCoal", false), OreDictionary.getOres("coal", false), 3, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreCoal", false), new ItemStack(Items.COAL), 3, null, 0, 0);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("blockCoal", false), OreDictionary.getOres("coal", false), 9, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("blockCoal", false), new ItemStack(Items.COAL), 9, null, 0, 0);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreQuartz", false), OreDictionary.getOres("gemQuartz", false), 3, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreQuartz", false), new ItemStack(Items.QUARTZ), 3, null, 0, 0);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("cobblestone", false), OreDictionary.getOres("sand", false), 1, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("cobblestone", false), new ItemStack(Blocks.SAND), 1, null, 0, 0);
ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT), new ItemStack(Items.FLINT), 50); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT), new ItemStack(Items.FLINT), 50);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("stone", false), OreDictionary.getOres("cobblestone", false), 1, null, 0, 0); ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("stone", false), OreDictionary.getOres("cobblestone", false), 1, null, 0, 0);

View file

@ -285,6 +285,32 @@ public class MethodHandler implements IMethodHandler{
} }
return hasWorkedOnce; return hasWorkedOnce;
} }
@Override
public boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance){
boolean hasWorkedOnce = false;
for(ItemStack input : inputs){
if(StackUtil.isValid(input) && CrusherRecipeRegistry.getRecipeFromInput(input) == null){
if(StackUtil.isValid(outputOne) && !CrusherRecipeRegistry.hasBlacklistedOutput(outputOne, ConfigStringListValues.CRUSHER_OUTPUT_BLACKLIST.getValue())){
ItemStack outputOneCopy = outputOne.copy();
outputOneCopy = StackUtil.setStackSize(outputOneCopy, outputOneAmount);
if(outputTwo == null || outputTwo.isEmpty()){
ActuallyAdditionsAPI.addCrusherRecipe(input, outputOneCopy, StackUtil.getNull(), 0);
hasWorkedOnce = true;
}
else if(StackUtil.isValid(outputTwo) && !CrusherRecipeRegistry.hasBlacklistedOutput(outputTwo, ConfigStringListValues.CRUSHER_OUTPUT_BLACKLIST.getValue())){
ItemStack outputTwoCopy = outputTwo.copy();
outputTwoCopy = StackUtil.setStackSize(outputTwoCopy, outputTwoAmount);
ActuallyAdditionsAPI.addCrusherRecipe(input, outputOneCopy, outputTwoCopy, outputTwoChance);
hasWorkedOnce = true;
}
}
}
}
return hasWorkedOnce;
}
@Override @Override
public IBookletPage generateTextPage(int id){ public IBookletPage generateTextPage(int id){