codetaylor / artisan-worktables-1.12

Themed worktables with a tool slot.
Other
17 stars 6 forks source link

AW couldn't compatible with item.withtag #248

Closed VVVHY closed 4 years ago

VVVHY commented 4 years ago

Expected Behavior

Add a recipe which would carve "Animania's beef to steak by carving knife in Chef Worktable while installing FoodFunk.

Current Behavior

While Foodfunk installing, would become .withTag({Rot: {start: 0 as long, time: 0 as long}}). The recipe didn't work in AW worktable, but work in Vanilla worktable. The rot tag would be changing by time so hard to write it in the recipe.

Steps to Reproduce (for bugs)

1.Install Food Funk 2. become .withTag({Rot: {start: 0 as long, time: 0 as long}}) 3.The recipe don't work

Script

https://paste.ubuntu.com/p/rmh8V8KS8q/

Your Environment

codetaylor commented 4 years ago

I can't reproduce this in a minimal testing environment.

AW will ignore NBT data on an ingredient if the ingredient in the recipe has no NBT data, otherwise it will match NBT.

This is illustrated with the following script:

import mods.artisanworktables.builder.RecipeBuilder;

// produces item with NBT
RecipeBuilder.get("basic")
  .setShapeless([<minecraft:beef>])
  .addTool(<minecraft:stone_axe>, 1)
  .addOutput(<minecraft:diamond>.withTag({Rot: {start: 234545 as long, time: 345656 as long}}))
  .create();

// consumes item regardless of NBT
RecipeBuilder.get("basic")
  .setShapeless([<minecraft:diamond>])
  .addTool(<minecraft:stone_axe>, 1)
  .addOutput(<minecraft:string>)
  .create();

// consumes only item with specific NBT
RecipeBuilder.get("basic")
  .setShapeless([<minecraft:gravel>, <minecraft:diamond>.withTag({Rot: {start: 234545 as long, time: 345656 as long}})])
  .addTool(<minecraft:stone_axe>, 1)
  .addOutput(<minecraft:emerald>)
  .create();
codetaylor commented 4 years ago

Tested with Food Funk mod installed.

Used <minecraft:beef>.withTag({Rot: {start: 21840 as long, time: 168000 as long}}) as the ingredient and the recipe below behaves as expected.

import mods.artisanworktables.builder.RecipeBuilder;

RecipeBuilder.get("basic")
  .setShapeless([<minecraft:beef>])
  .addTool(<minecraft:stone_axe>, 1)
  .addOutput(<minecraft:diamond>)
  .create();