End Remastered [NeoForge/Fabric]

End Remastered [NeoForge/Fabric]

23M Downloads

Providing an invalid loot table id for an eye results in the empty table being modified

Closed this issue ยท 1 comments

commented

You inject a new pool to some loot tables by modifying the loot table in java directly here:

event.getServerResources().fullRegistries().getLootTable(resourceKey).addPool(injectTable.getPool("eye_pool"));

However, if the resourceKey provided does not point to a valid loot table, getLootTable returns LootTable.EMPTY. This is just an instance of LootTable with no pools which does not have any protection against mutation. This leads to your code adding your pool to it, and then whenever someone else passes an invalid loot table id to getLootTable they get the same tainted instance that has your pool in it, resulting in everything that had an invalid loot table now suddenly dropping your eye items.
A simple table != LootTable.EMPTY should suffice to fix this, and you should probably log an error with it too saying that the provided loot table id is invalid.

Video from @BlankMega on neoforge discord showcasing this:
https://discord.com/channels/313125603924639766/1128972595249819769/1361676601720438865

out.mp4
commented

The issue was fixed with commit 8a7082f

Thank you for the bug report!