Add logic to lock rolling machine, allows it to be automated. Closes #1412

This commit is contained in:
modmuss50 2018-04-05 12:37:31 +01:00
parent c17f232bf8
commit ec56914ea7
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
2 changed files with 132 additions and 35 deletions

View file

@ -135,16 +135,25 @@ public class RollingMachineRecipe {
recipes.put(resourceLocation, new ShapelessRecipes("", output, ingredients));
}
public ItemStack findMatchingRecipe(InventoryCrafting inv, World world) {
public ItemStack findMatchingRecipeOutput(InventoryCrafting inv, World world) {
for (IRecipe irecipe : recipes.values()) {
if (irecipe.matches(inv, world)) {
return irecipe.getCraftingResult(inv);
}
}
return ItemStack.EMPTY;
}
public IRecipe findMatchingRecipe(InventoryCrafting inv, World world) {
for (IRecipe irecipe : recipes.values()) {
if (irecipe.matches(inv, world)) {
return irecipe;
}
}
return null;
}
public HashMap<ResourceLocation, IRecipe> getRecipeList() {
return recipes;
}