Dropt

Dropt

3M Downloads

Block drop change doesn't work with Tinker Direct Trait

Fireztonez opened this issue ยท 1 comments

commented

Hello,
I just discovered a problem with the drop of the blocks that I changed that with Dropt, when mined with a Tinker Tool with the traits Direct (How teleport the mined things directly into your inventory), like Vibrant Alloy added by EnderIO. You get into your inventory the normal drops from the blocks and not what I have set in my Dropt scripts. Not sure if the problem can be resolve in your end or if this is something how should be fixed in Tinker or possibly EnderIO end, so if you have an idea what it can be, or tel me if I need to link that issue with other issue tracker possibly?

Version:
Forge: 14.23.5.2831
Dropt: 1.14.0
Tinker: 2.12.0.135
EnderIO: 5.0.43
EnderCore: 0.5.57

Thank's
Fireztonez

commented

So this is a bit tricky.

Dropt hooks the BlockEvent.HarvestDropsEvent using @SubscribeEvent(priority = EventPriority.LOWEST). This means that the Dropt code for handling the drops will try to be executed as late as possible. It looks like TiC's trait system hooks the same event with a higher priority. This means that EIO, by way of TiC, will get its hands on the drops before Dropt has a chance to alter them. EIO moves the drops to the players inventory and Dropt never sees them.

Having Dropt hook the event with a low priority was intentionally implemented in order to allow Dropt to manipulate any items / XP that other mods might add to the BlockEvent.HarvestDropsEvent. See this issue.

To solve this, Dropt would have to hook the event before TiC, but after any other mod that might manipulate the event's items / XP and fine-grained event ordering is just not possible with the Forge event system. Changing the hook's priority to be higher than TiC's would re-introduce the problems discussed in the issue linked above and could potentially introduce new problems.

I don't see a clear solution right now.