fzzyhmstrs / EMI_loot

12 stars 10 forks source link

No support for nested loot tables #53

Closed Partonetrain closed 6 months ago

Partonetrain commented 6 months ago

Mods like Incendium use nested loot tables (entry of type "minecraft:loot_table") in some places, and EMI Loot doesn't show these tables at all. Example from Incendium: data\incendium\loot_tables\artifact\trailblazer_drop.json

{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:loot_table",
          "name": "incendium:artifact/weapon/trailblazer"
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:spectral_arrow",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "type": "minecraft:binomial",
                "n": 72,
                "p": 0.75
              }
            }
          ]
        }
      ]
    }
  ]
}

Minecraft uses them in some places, like for sheep loot, and EMI Loot is hardcoded to check for these cases: https://github.com/fzzyhmstrs/EMI_loot/blob/master/src/main/java/fzzyhmstrs/emi_loot/parser/LootTableParser.java#L107 Ideally it'd be dynamic

fzzyhmstrs commented 6 months ago

EMI Loot does support loot table entries, but maybe that loot table is being used in a way EL doesn't expect. For example, if the loot table referenced doesn't provide a type like "chest", "block", etc, EL won't know how to properly parse it. There is also currently a bug if the type is "gift", "barter", or "archaeology"

Partonetrain commented 6 months ago

I see that Incendium doesn't specify types for its loot tables, so that can be fixed with overriding its data. Thank you for catching my mistake! Although, I am curious what the sheep code is for in this case