KubeJS (Old)

KubeJS (Old)

3M Downloads

When item id contains a /, .displayName doesn't work

DUDEbehindDUDE opened this issue · 2 comments

commented

Minecraft Version

1.20.1

KubeJS Version

2001.2.5-build.2

Rhino Version

2001.2.2-build.18

Architectury Version

9.1.12

Forge/Fabric Version

Forge 47.2.17

Describe your issue

When you are setting a displayName of an item made in KubeJS for an item that has a / in the name (say, "kubejs:metal/ingot/cobalt"), .displayName() property does not work at all.
Examples:

// Fluid registry
e.create("nether_sludge")
    .stillTexture("tfc:block/molten_still")
    .flowingTexture("tfc:block/molten_flow")
    .color(0x434127)
    .displayName("Nether Sludge") // works!
    .noBlock();
    
e.create("metal/cobalt")
    .stillTexture("tfc:block/molten_still")
    .flowingTexture("tfc:block/molten_flow")
    .color(0x07276f)
    .displayName("Cobalt") // does not work
    .noBlock();
// Item registry
e.create("metal/ingot/cobalt").displayName("Cobalt Ingot");

image
image
image

If I were to take a guess, the issue is likely that KubeJS treats this in the language file as "fluid.kubejs.metal/cobalt" instead of "fluid.kubejs.metal.cobalt"; this should be as simple as replacing any / with a . if this is the case.

Crash report/logs

No response

commented

圖片
圖片
圖片
While .displayName doesn't work, KubeJS doesn't auto-generate the name either.

commented

Should be fixed with 3b7d06b?