Pyrotech

Pyrotech

897k Downloads

Worktable deleting Silent's Gear items on creatiom

Opened this issue · 4 comments

commented

Issue Description

When creating certain NBT-based items from Silent Gear using the Pyrotech Stone or Wood Worktable, the Recipe output HUD displays an untextured(purple/black) item icon, and when the item is crafted in the worktable, the ingredients are consumed but no item is rendered/dropped on the table.

What Happens

  1. Install Pyrotech and Silent's Gear (q
  2. Get Worktable, Hammer, And any Silent Gear Blueprint that requires a 3x3 grid to craft. (Mattock Blueprint and 4 bricks is a good example, but results are same for most others that require a 3x3 grid recipe)
  3. Place item recipe on Worktable Grid, and observe untextured output icon in HUD.
  4. Craft Recipe using Hammer, observe as materials are consumed, but no item renders or drops onto Worktable.
  5. Repeat steps 1-4 using any standard Crafting Grid Gui(Vanilla table, Silent's Gear Work Station, etc) and observe that the output renders correctly, and item does not delete upon being crafted.

What You Expect to Happen

Item(Terracotta Mattock Head, Iron Excavator Head, etc) should render correctly in HUD, and item drops into world correctly when crafted in Worktable.

Possible Causes

Silent's Gear is unique in that Tool Heads, the items most prominently causing this issue, are NBT/Metadata dependent. An Iron Axe Head and a Stone Axe Head are the same item with different NBT Tags to define their properties, including The item’s texture and rendering.
The Worktable seems to ignore the NBT data entirely and may attempt to create the base item only, which Silent’s Gear tries to prevent in order to prevent Null Exceptions.

Possible Solutions

-Make Sure Worktable is mindful of NBT data.
-Add Config Options to Worktable that changes how recipe Output is created. Instead of dropping on top of table, items could be given directly to the player, as with /give command.
-Add Config option to output items to the “Tool Slots" below the Worktable Grid.

Affected Versions

  • Minecraft: 1.12.2
  • Forge: 14.21.1.2387
  • Silent's Gear: 1.12.2-0.6.7+76
  • Pyrotech: 1.12.2-1.4.16
  • Athenaeum: 1.12.2-1.17.4

Sent with GitHawk

commented

Thank you for the report. I believe this is the same as #252

commented

image

commented

As stated, this behavior persists, but only with certain recipes, like Hammers. And I haven't been able to find a correlation or pattern to what is and isn't accepted by the worktable. The closest I can theorize is that it's something related to the material list, and how Silent's Gear adds modular/generated recipes to the game, and the Worktable simply can't interpret those materials.

Sent with GitHawk

commented

This occurs because Silent's RecipeBaseSL#getRemainingItems implementation is wrong. The method should not directly modify the given inventory and should return a NonNullList with a size equal to the given inventory's size. If there are no remaining items, the returned list is expected to be full of empty items and not just an empty list.

https://github.com/SilentChaos512/SilentLib/blob/1.12/src/main/java/net/silentchaos512/lib/recipe/RecipeBaseSL.java#L38

Because an empty list is returned and a non-empty list is expected, this happens:

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_144]
	at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_144]
	at net.minecraft.util.NonNullList.get(NonNullList.java:51) ~[NonNullList.class:?]
[...]

I can put in a check to force Pyrotech to work around this problem.

2020-02-16_09-56-00

The item rendering in Waila is broken, but that's on Waila -- I can't fix it.

2020-02-16_10-22-36

Will be fixed in 1.4.21