CraftTweaker

CraftTweaker

151M Downloads

[BUG] ? Not working <ore:craftingToolHardHammer>

drenough opened this issue ยท 10 comments

commented

Issue description

Describe the bug:

I'm making my own crafting recipes via CraftTweaker and I'm using gregtech materials to make some recipes harder.

Versions:

Forge: 14.23.5.2855
GTCE: 1.12.2-1.17.1.770
IC2 Classic: 1.12-1.5.5.2.1
CraftTweaker: 1.12-4.1.20.666

Setup:

Playing Solo
New world generated

Expected behavior:

My recipe should say via JustEnoughItems when I click let's say on "Iron Fence" (from IC2 Classic) it should require any crafted hammer to make that item but it accepts only "Darmstadium Hammer" but I set up in recipe this ore:craftingToolHardHammer so it should say that I can craft it with any hammer but it's not working. When I'm using ore:craftingToolScrewdriver it is working but for some reason ore:craftingToolHardHammer isn't.

Basically I removed IC2 Classic crafting recipe for Iron Fences via their config file and than added my own recipe via CraftTweaker which is looking like this:
//IronFence
recipes.addShaped(ic2:blockfenceiron *6, [

[ore:craftingToolScrewdriver, null, ore:craftingToolHardHammer],
[gregtech:meta_item_1:12184, gregtech:meta_item_1:12184, gregtech:meta_item_1:12184],
[gregtech:meta_item_1:12184, gregtech:meta_item_1:12184, gregtech:meta_item_1:12184]]);`

And the "ore:craftingToolHardHammer" isn't working :(

Steps to reproduce

No response

Script used

https://pastebin.com/GDS7EPj7

The crafttweaker.log file

https://pastebin.com/q70uwpW0

Minecraft version

1.12

Forge version

14.23.5.2855

CraftTweaker version

1.12-4.1.20.666

Other relevant information

Mods and their versions are in full lastlog

The latest.log file

https://gist.github.com/drenough/fd1b0fc2bf5a4bb04334c8500c000b7c

commented

Does the recipe work and just display wrong in JEI?

Are you sure there is actually more than one hammer in that oredict?

Are you sure that it is even your recipe that you are looking at?

commented

Recipe doesn't work and when I mouse over that hammer in that recipe it just says name of that hammer and nothing under it but mouse over Screwdriver, under it, it shows there accepts any screwdriver. Hammers should be there because you can craft like 20 types of hammers, like iron, bronze, steel, tungsten and etc.. And yes, I'm sure that is my recipe

//EDIT: now screwdrivers stopped working aswell in my recipes. (weird)

commented

can you use /ct hand while holding one of the hammers (both the one that works and one that doesn't) and post the output

commented

Here is the one that works(he's got 2 datas):

gregtech:meta_tool:6.withTag({"GT.ToolStats":{Material: "darmstadtium"}}) +
ore:craftingToolHardHammer
and here is one that doesn't work and should work too: gregtech:meta_tool:6.withTag({"GT.ToolStats": {Material: "iron"}}) + ore:craftingToolHardHammer

commented

Upload your log to pastebin after doing /ct hand on them, github decimates the formatting.

commented

Gonna post it tomorrow becuase I'm working in the morning so, sorry

commented

I have no idea what they are on about when they say this:

This is an issue between Forge and CraftTweaker. CraftTweaker doesn't respect NBT in OreDicts.

We haven't gotten reports of any mod causing issues with oredict, it has only been GregTech.

If other mods were experiencing the same issues, then they would have some ground to stand on with their statement, but until then, their statement is groundless, and even they themselves are like "yea we could easily fix this", if they can fix it, how is it an issue between Forge and CraftTweaker??

Anyway, closing due:

  1. You have a solution
  2. I'm unable to reproduce with other mods
commented

Here it is on pastbin: https://pastebin.com/9eheCuDZ

//EDIT: I posted this issue on GregTechCE github too: GregTechCE/GregTech#1727
//EDIT2: I tried this quick fix which they told me should work https://gist.github.com/idcppl/c29120b0cbe7ab81fd329eae8802a244 and it is working!

commented

I'm unable to reproduce with other mods

I doubt many mods do what GTCE does.
But the issue (as I understand it) is a difference in behaviour between the forge api and the crafttweaker api.

Using the forge api you can do (pseudo code).

ItemStack is = new ItemStack(item, 1).withNBT(blah);
OreDictionary.registerOre("name",  is);

This will work in a normal recipe referencing it by name with any item stack regardless of the NBT inside the item stack.

But trying to reference that ore dictionary in a crafttweaker recipe will lead to the recipe only accepting items that have matching NBT.

i.e. If you have an ore dictionary that contains item stacks with NBT, it will work differently depending upon whether you register the recipe using the forge api or crafttweaker

The workaround mentioned above makes a new ore dictionary where the item stack is registered with the NBT removed. But this means you have to maintain duplicate dictionaries to make them usable with CT recipes.

The suggested "fix" in GTCE is to remove the NBT before registering the item stack in the ore dictionaries (just like the workaround above).

But this would mean there are "dangling" item stacks with invalid NBT lying around.
These then need to be "fixed" when they are referenced later to give them valid default tags.
This potentially introduces runtime overhead where default NBT tags have to be "generated" on every reference (assuming the item stack in the ore dictionary entry shouldn't be altered).

In fact, GTCE already handles this which is why the workaround linked above works at all.
A different mod that didn't handle it wouldn't have a workaround.

commented