(Note - testing with in-dev code so reproducing will be difficult)
Set up a ProjectEX link block, and add items to the output (filter) slots
Put a Refined Storage storage bus on the link block
Get your player killed!
What I expected to happen:
Not to crash
What happened instead:
The getKnowledgeProviderFor() method crashed, since the player's IKnowledgeProvider capability was briefly missing following the player's death. My guess is that the Refined Storage per-tick polling of the link block's item handler happened between the player being cloned after death, and the knowledge provider capability being re-attached.
I'm not sure about the best way to go about handling this; right now your API method just throws an NPE, and catching that does work around the problem (the link block will briefly report no items available). But that's not a pretty solution.
Just to note, this is in code I'm currently porting from 1.12.2; the ProjectEX link blocks allow a set of items to be added to a filter, and presents those items to item handler capability queries, allowing extraction at a cost of a player's personal EMC. It needs to know the owning player's EMC to determine how many virtual items are available via the link block.
Tickets that do not conform to this template will be closed without comment
Exact ProjectE version (do not say "latest", "latest on Curse", or similar): 1.18.2-PE1.0.1
Exact Forge version: 1.18.2-40.1.73
Link to crash log (please use a paste site, do not attach the .txt or paste the log inline): https://gist.github.com/desht/9cdf296a20b3cd1f19531c6f1ce2160e
Steps to reproduce:
What I expected to happen:
Not to crash
What happened instead:
The
getKnowledgeProviderFor()
method crashed, since the player'sIKnowledgeProvider
capability was briefly missing following the player's death. My guess is that the Refined Storage per-tick polling of the link block's item handler happened between the player being cloned after death, and the knowledge provider capability being re-attached.I'm not sure about the best way to go about handling this; right now your API method just throws an NPE, and catching that does work around the problem (the link block will briefly report no items available). But that's not a pretty solution.
Just to note, this is in code I'm currently porting from 1.12.2; the ProjectEX link blocks allow a set of items to be added to a filter, and presents those items to item handler capability queries, allowing extraction at a cost of a player's personal EMC. It needs to know the owning player's EMC to determine how many virtual items are available via the link block.