From 2be6230977a55f3325232bc9c547a40046cb8abf Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sun, 18 Aug 2019 23:09:03 +0100 Subject: [PATCH] Well that didn't merge correctly... temporarily remove custom charging recipe classes These need a bit more work to fit into the new system --- .../recipe/RecipeRechargeWithFlask.java | 54 ------------------- .../wizardry/recipe/package-info.java | 3 -- 2 files changed, 57 deletions(-) delete mode 100644 src/main/java/electroblob/wizardry/recipe/RecipeRechargeWithFlask.java delete mode 100644 src/main/java/electroblob/wizardry/recipe/package-info.java diff --git a/src/main/java/electroblob/wizardry/recipe/RecipeRechargeWithFlask.java b/src/main/java/electroblob/wizardry/recipe/RecipeRechargeWithFlask.java deleted file mode 100644 index f8a7b257..00000000 --- a/src/main/java/electroblob/wizardry/recipe/RecipeRechargeWithFlask.java +++ /dev/null @@ -1,54 +0,0 @@ -package electroblob.wizardry.recipe; - -import electroblob.wizardry.constants.Constants; -import electroblob.wizardry.item.ItemWand; -import electroblob.wizardry.item.ItemWizardArmour; -import electroblob.wizardry.registry.WizardryItems; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.ShapelessOreRecipe; - -public class RecipeRechargeWithFlask extends ShapelessOreRecipe { - public RecipeRechargeWithFlask() { - super(null, ItemStack.EMPTY, ItemStack.EMPTY, WizardryItems.mana_flask); - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting inv) { - ItemStack result = lookupForIngredients(inv, true); - if (!result.isEmpty()) { - result.setItemDamage(Math.max(output.getItemDamage() - Constants.MANA_PER_FLASK, 0)); - } - return result; - } - - @Override - public boolean matches(InventoryCrafting inv, World world) { - return !lookupForIngredients(inv, false).isEmpty(); - } - - /* lookup for the needed ingredients && return the rechargeable itemstack */ - private ItemStack lookupForIngredients(InventoryCrafting inv, boolean copy) { - ItemStack flask = ItemStack.EMPTY; - ItemStack rechargeable = ItemStack.EMPTY; - for (int i = 0; (flask.isEmpty() || rechargeable.isEmpty()) && i < inv.getSizeInventory(); i++) { - ItemStack itemstack = inv.getStackInSlot(i); - if (!itemstack.isEmpty()) { - if (flask.isEmpty() && itemstack.getItem() == WizardryItems.mana_flask) { - flask = itemstack; - } else if (rechargeable.isEmpty() && (itemstack.getItem() instanceof ItemWand || itemstack.getItem() instanceof ItemWizardArmour) && itemstack.getItemDamage() > 0) { - rechargeable = copy ? itemstack.copy() : itemstack; - } else { - return ItemStack.EMPTY; - } - } - } - return flask.isEmpty() || rechargeable.isEmpty() ? ItemStack.EMPTY : rechargeable; - } - - @Override - public boolean isDynamic() { - return true; - } -} diff --git a/src/main/java/electroblob/wizardry/recipe/package-info.java b/src/main/java/electroblob/wizardry/recipe/package-info.java deleted file mode 100644 index a8ed81eb..00000000 --- a/src/main/java/electroblob/wizardry/recipe/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@javax.annotation.ParametersAreNonnullByDefault -@mcp.MethodsReturnNonnullByDefault -package electroblob.wizardry.recipe;