Darkhax-Minecraft / ItemStages

Allows items to be put into stages.
GNU Lesser General Public License v2.1
7 stars 18 forks source link

Items with NBT data are not properly staged #40

Closed xkforce closed 5 years ago

xkforce commented 6 years ago

Anything with nbt data can't be hidden by either mod staging or item staging.

Darkhax commented 6 years ago

Are you using the latest version of this mod? The following script works perfectly fine.

mods.ItemStages.addItemStage("one", <minecraft:potion>.withTag({Potion: "minecraft:strong_harming"}));
xkforce commented 6 years ago

I'm using version 2.0.43. It appears that some items with nbt data are being hidden (like vanilla potions) and some aren't. Actually there are a lot of things that either aren't being staged or aren't being hidden in JEI if they are that goes beyond items with nbt data on them.

For example, actuallyadditions I can stage everything but the liquids and a couple items: ct liquids gives: Liquids:

, Canola Oil , Crystallized Oil , Empowered Oil , Lava , Refined Canola Oil , Water So I added the following lines to the staging zenscript file: mods.ItemStages.stageLiquid("one", ); mods.ItemStages.stageLiquid("one", ); mods.ItemStages.stageLiquid("one", ); mods.ItemStages.stageLiquid("one", ); Which doesn't appear to hide those liquids. but adding the liquid block itself to an ore dictionary hides the liquid block but adding the forge liquid buckets the same way doesn't. I actually haven't found a way to hide the forge buckets for those liquids. There are also two blocks that are being staged but not hidden: and Forestry and Binnie's mods are having issues as well although most of that looks like interference from another mod.
Darkhax commented 5 years ago

To hide a liquid you need to use CraftTweaker's liquid bracket handler. So <liquid:water> instead of liquid:water. Fluids also don't have NBT.

As for the other things, JEI items are only hidden if you can provide the exact same item. It's annoying but that's how JEI works. My mod allows partial NBT to be used when staging an item, which is useful for many weird edge case items. For example this line will hide all enchantment books with level 5, even if the enchantment isn't exact. However JEI does not allow for the same flexibility.

mods.ItemStages.addItemStage("one", <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 5 as short}]}));

Edit: The way most packs work around this issue, such as SevTech, has been to get the item from JEI and use the command /ct hand which prints out the exact info for that item. This can then be used in the script as a separate entry to ensure the item has been staged.