Dungeon Gears does not use the loot table from the context when generating loot
TelepathicGrunt opened this issue · 5 comments
Hello! I gotten a report on my mod Repurposed Structures about my mod no longer importing Dungeon Gear's modded loot from vanilla loot tables.
TelepathicGrunt/RepurposedStructures#121
After looking closely and debugging, I found the reason why rolling vanilla's loot tables in my GLM does not spawn Dungeons Gear's loot is because Dungeon Gear is checking the loot table of the block directly.
You actually do not need to do that at all. The loot table to spawn is already in the LootContext context
parameter and can be grabbed by doing context.getQueriedLootTableId()
. If you switch to using that, it'll help simplify your code a bit and make my mod's modded loot importing work again with Dungeon Gears. It may also help with compat for other mods that tries to roll loot table loot outside of chests to try and analyze the loot outputs or something unique or wacky.
This is my code I do for rolling vanilla loot tables
https://github.com/TelepathicGrunt/RepurposedStructures/blob/f435358cda49a3f5743fab9769ed0dca5b1671db/src/main/java/com/telepathicgrunt/repurposedstructures/misc/StructureModdedLootImporter.java#L159-L160
This is the Dungeons Gear part that is grabbing my chest's loot table instead of using the passed in loot table in context.
https://github.com/Thelnfamous1/Dungeons-Gear/blob/117c4db96bacb42ae0a454b329287297f43c52c4/src/main/java/com/infamous/dungeons_gear/loot/GlobalLootModifier.java#L202-L222
This is because the loot table id in context wasn’t a thing in the version of forge this mod was compiled against. Will need to update my Forge version to latest to get this fixed.