How to use IExternalStorageProvider?
pkmnfrk opened this issue ยท 5 comments
Issue description:
I am trying to implement IExternalStorageProvider in my mod to address pkmnfrk/equivalentintegrations#12, but it's behaving weird.
I suspect that I'm doing something wrong, but I do not know what.
My implementation is here: https://github.com/pkmnfrk/equivalentintegrations/tree/rscompat/src/main/java/com/mike_caron/equivalentintegrations/integrations/refinedstorage
What happens:
It seems to count each item I present twice. Eg, if I say there are 1000 Cobblestone, it shows 2000.
I believe it is combining the IStorageExternal with the usual IItemHandler capability, and showing both as external storage.
What you expected to happen:
If an IStorageExternal is present, ignore the IItemHandler.
Steps to reproduce:
- Install my mod (if you check out the repo, it includes a dependency on RS, so you can fire it up)
- Obtain a Soulbound Talisman, and right click to bind yourself
- Obtain an Alchemical Algorithms
- Place a Transmutation Chamber, and place the talisman and algorithms inside
- Hook up a Refined Storage External Storage to the Transmutation Chamber
- Put some items into the system, they will show double.
...
Version (make sure you are on the latest version before reporting):
- Minecraft: 1.12.2
- Forge: 2732
- Refined Storage: 1.6.4-279
Does this issue occur on a server? yes
I did two big things:
-
I validated that my update method was tracking the correct values. It was.
-
I changed my tile entity to pretend not to have the Item Handler capability. When I did that, the numbers in RS suddenly became correct.
The second one was what made me realize that adding an external storage handler was not enough. Am I really expected to not have an Item Handler on the same tile entity? Do I need to create a separate block just for Refined Storage?
No, a external storage handler should be enough. That's the entire reason that API was brought into life.
Number 2 is vital information. Let me check.
Ah, looks like it adds any handler that returns true
for canProvide
.
Fixing that so we have a priority based system.