Skip to content
This repository has been archived by the owner on Jul 1, 2018. It is now read-only.

Commit

Permalink
Fix JEI's pocket modem recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev committed Mar 2, 2017
1 parent 8ce970e commit 44a0c4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,4 @@ public void init() {
RecipeSorter.register(CCTweaks.RESOURCE_DOMAIN + ":pocket_upgrade_crafting", CraftingPocketUpgrade.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
GameRegistry.addRecipe(this);
}

public static ItemStack setNBT(ItemStack stack, IPocketUpgrade upgrade) {
NBTTagCompound tag = stack.getTagCompound();
if (tag == null) stack.setTagCompound(tag = new NBTTagCompound());

tag.setShort("upgrade", PocketRegistry.FLAG);
tag.setString("upgrade_name", upgrade.getUpgradeID().toString());
return stack;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
import org.squiddev.cctweaks.api.pocket.IPocketUpgrade;
import org.squiddev.cctweaks.core.pocket.CraftingPocketUpgrade;
import org.squiddev.cctweaks.core.pocket.PocketRegistry;

import javax.annotation.Nonnull;
import java.util.Arrays;
Expand All @@ -30,7 +30,7 @@ public PocketUpgradeWrapper(ItemStack inputStack, ItemStack upgradeStack, ItemSt
public PocketUpgradeWrapper(IPocketUpgrade upgrade, ComputerFamily family) {
inputStack = PocketComputerItemFactory.create(-1, null, family, false);
upgradeStack = upgrade.getCraftingItem();
outputStack = CraftingPocketUpgrade.setNBT(inputStack.copy(), upgrade);
PocketRegistry.instance.setToItemStack(outputStack = inputStack.copy(), upgrade);
}

@Override
Expand Down

0 comments on commit 44a0c4c

Please sign in to comment.