Posted May 6, 20187 yr Someone reported a bug with my mod where you cannot combine the jetpack and the armor plating after you entchanted the the jetpack with a book in an anvil. I also could reproduce this. The strange thing is, that my custom recipe class which is extending ShapelessOreRecipe looks very similar to e.g. CoFH's but their recipes do work with entchanted ingredients and mine don't. I am still using "old" java recipes over the JSON ones, as I did not have the time to look into that and port everything over to this system. "UpgradingRecipeShapeless": Spoiler public class UpgradingRecipeShapeless extends ShapelessOreRecipe { public UpgradingRecipeShapeless(ItemStack result, Object... recipe) { super(null, result, recipe); setRegistryName(SimplyJetpacks.MODID, "upgradeRecipeShapeless" + j); j++; } public ItemStack getCraftingResult(@Nonnull InventoryCrafting inv) { ItemStack inputStack = ItemStack.EMPTY; ItemStack outputStack = output.copy(); IEnergyContainerItem outputItem = (IEnergyContainerItem) outputStack.getItem(); int addedEnergy = 0; ParticleType particleType = null; NBTTagCompound tags = null; for (int i = 0; i < inv.getSizeInventory(); ++i) { ItemStack stack = inv.getStackInSlot(i); if (!stack.isEmpty()) { inputStack = stack; if (inputStack.getItem() instanceof IEnergyContainerItem) { addedEnergy += ((IEnergyContainerItem) inputStack.getItem()).getEnergyStored(inputStack); } else if (OreDictionary.containsMatch(false, CommonProxy.oresListParticles, inputStack)) { particleType = ParticleType.values()[inputStack.getItemDamage()]; } } } if (inputStack.isEmpty()) { return ItemStack.EMPTY; } outputStack = ItemHelper.copyTag(outputStack, inputStack); NBTHelper.setInt(outputStack, "Energy", Math.min(addedEnergy, outputItem.getMaxEnergyStored(outputStack))); if (outputItem instanceof ItemJetpack && particleType != null) { ((ItemJetpack) outputItem).setParticleType(outputStack, particleType); } return outputStack; } @Override public boolean isDynamic() { return true; } }
May 6, 20187 yr honestly for this stuff your better off keeping your old recipes. though if your trying to keep the enchantments ItemStack input = playerIn.getHeldItem(hand); ItemStack morph1 = new ItemStack(Item.getByNameOrId(this.morph), is.getCount(), is.getMetadata()); if (is.hasTagCompound()) { morph1.setTagCompound(is.getTagCompound()); } if (hand == EnumHand.MAIN_HAND) { playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, morph1); }} this might not be entirely related or the best way to handle it but if your wanting it to work with enchanted items you should have it take the nbtdata from the input item and set it to the output something similar to this. there might be better ways but I figured I'd toss this here incase its of help Edited May 6, 20187 yr by Blaez
May 7, 20187 yr Author I am sorry but the problem is not keeping the entchantment (at least as far as I see) but is not even recognized at all.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.