Advanced Peripherals

Advanced Peripherals

29M Downloads

ME Bridge inconsistencies

underscorched opened this issue ยท 10 comments

commented

Describe

[I don't know why the modpack author of my pack used the 1.19.3 version for a 1.19.2 pack but it works either way.]
{If I'm being stupid for any reason, (didnt see something in changelogs, shouldnt do 2 bugs in one post, etc.), please let me know.]

While trying to write a program to push a live item counter to a Display Link, I encountered one bug and one potentially intended thing that might be a bug.

  • getUsedItemStorage() does not account for items held within AE2 Things DISK Drives, it counts as zero.
  • Any get[x]ItemStorage() does not account for items stored externally. (might be intended idk?)

Steps to reproduce

Bug 1:

  1. Have an ME system with a drive containing a DISK Drive
  2. Attach an ME Bridge and computer
  3. Insert items
  4. Call getUsedItemStorage()
  5. Returns zero.

Bug? 2:

  1. Have an ME system with no drives and a storage bus on an inventory
  2. Attach an ME bridge and computer
  3. Insert items
  4. Call any get[x]ItemStorage()
  5. Returns zero.

Multiplayer?

Yes

Version

1.19.3-0.7.29r (Latest 1.19.3)

Minecraft, Forge and maybe other related mods versions

Forge 43.2.14, Minecraft 1.19.2, AE2Things 1.1.1

Screenshots or Videos

No response

Crashlog/log

No response

commented

Feel free to test the changes yourself, you can download the snapshot from here

It fixes your bug(1) and includes the storage bus feature from #491

commented

[I don't know why the modpack author of my pack used the 1.19.3 version for a 1.19.2 pack but it works either way.]
{If I'm being stupid for any reason, (didnt see something in changelogs, shouldnt do 2 bugs in one post, etc.), please let me know.]

My fault, I forgot to add 1.19.2-0.7.29r to the list

Bug? 2:

Have an ME system with no drives and a storage bus on an inventory
Attach an ME bridge and computer
Insert items
Call any get[x]ItemStorage()
Returns zero.

That's not a bug, more like a missing feature

I'll look into your first bug

commented

I found multiple issues with the build.

  • DISK getUsedItemStorage() returns the amount of stored items divided by 8.
  • Storage busses do not count towards getTotalItemStorage() and getAvailableItemStorage()
commented

Storage busses do not count towards getTotalItemStorage() and getAvailableItemStorage()

This is sadly true, it seems that the storage bus components of the AE2 Network do not expose the whole inventory

DISK getUsedItemStorage() returns the amount of stored items divided by 8.

Fixed, you can try this build instead

commented

Fixed, you can try this build instead

Looks like it's working as intended. Thanks!
Too bad about the storage bus thing though :(

commented

Looks like it's working as intended. Thanks! Too bad about the storage bus thing though :(

I opened a feature request, maybe they can add it in the future AppliedEnergistics/Applied-Energistics-2#7287

commented

AE2 dev here. Not sure what you're trying to accomplish... :P

commented

So the thing was that the StorageBusPart does not expose the Inventory it is attached to. I didn't look into this deeper at the time I merged the changes from @michele-grifa since I was in a rush. But he found a solution. So to retrieve an ItemHandler, we just use the position of the StorageBus and then try to access the block it's connected to.

See #495 for more

I am not sure if there is a better solution
but if AE2 offers a better solution, I would love to hear them

commented

Hmmm, we do not have access to this kind of information via our own API, so I can't offer a general solution... Your fix is probably the best choice in that case.

commented

Alright, good to know

And thanks for checking in