Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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;
	}
}

 

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 by Blaez

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.