Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20] Black Hole Units (Item Change Bug) #1399

Closed
SD-ITLab opened this issue Jan 6, 2024 · 2 comments · Fixed by #1434
Closed

[1.20] Black Hole Units (Item Change Bug) #1399

SD-ITLab opened this issue Jan 6, 2024 · 2 comments · Fixed by #1434

Comments

@SD-ITLab
Copy link

SD-ITLab commented Jan 6, 2024

Industrial Foregoing Version:
1.20.1-3.5.12

Titanium Version:
1.20.1-3.8.25

Crashlog If Applicable (Upload to pastebin/gist):
Hello dear IF team,

My friend is using the Black Hole Units from Industrial Foregoing as storage locations for items.
(Due to the high quantities for individual items)

These are connected to the ME system via the storage bus.
However, problems have occurred several times.

Example:
Black hole unit filled with 200 million Infernium Essence, but after a while (when exactly I can't say, maybe after a restart?) the item suddenly changed to something else.
This has not happened with all units so far... out of currently 20 / 30 units there are 3 that showed the error.

We have already tried to work with filters in the StorageBus to only pull the specific item in/out... This did not bring any improvement.
Unfortunately I cannot reproduce this exactly.

@SD-ITLab SD-ITLab changed the title [1.20] Issue Title [1.20] Black Hole Units (Item Change Bug) Jan 6, 2024
@Skylla7629
Copy link

I am having the exact same issue with:

Industrial Foregoing Version:
1.19.2-3.3.2.3-7

Titanium Version:
1.19.2-3.7.4-28

I was also able to reproduce this bug:

It occurs if you move a large quantity of Items of different type in the ME System (e. g. with an IO Port clearing discs) into the Black Hole controller.
I have also tied disabeling Viod Items in the Black Hole unit, aswell as setting the Filter in the Black Hole Units themselves both leads to the same issue still.

The changed items as of now are:

Soul Sand
Cobbled Deepslate
Lapis Lazuli
Diorite
Scoria (Create)
Prosperity Shard (Mystical Agriculture)
Inferium Essence (Mystical Agriculture)

to

Dirt
Magma Block
Prosperity Shard (Mystical Agriculture) (yes, I got some back again (: )

All items are stored in the same Black Hole Controller

I also had a look at the nbt tags after this bug and even though the canged Items are in a different Black hole Unit than the one the item is actually supposed to be in, the items still have the exact same nbt as they should have, and no remnants of the old nbts are visible.

Additionally: I had this happen with the Supreme and Simple Black Hole Units mixed together, although item changes also appeared when only 1 type was used.

@notcake
Copy link
Contributor

notcake commented May 13, 2024

I've run into this issue twice now.

I think Black Hole Units will enter a buggy state that allows for item transmutation when the last insert operation's quantity is <= 0 when casted to a signed byte. The cast happens inside ItemStack.serializeNBT().

Reproduction Steps

Black Hole Units

  1. Insert x items in one operation, where (byte)x <= 0, eg. 128. The easiest way to do this is to cancel a large AE2 crafting operation.
  2. Break the Black Hole Unit.
  3. Place the Black Hole Unit. The Black Hole Unit is now bugged. I think ItemStack.isEmpty() returns true inside BlackHoleHandler.isItemValid() and allows anything to be inserted.
  4. Insert an arbitrary item. The Black Hole Unit now contains the new item, with a combined count of the previous item and the new item.

Unloading and reloading the chunk containing the Black Hole Unit might also work instead of steps 2 and 3.

Black Hole Units within a Black Hole Controller

  1. Insert x items in one operation, where (byte)x <= 0, eg. 128. The easiest way to do this is to cancel a large AE2 crafting operation.
  2. The Black Hole Unit is now bugged. I think ItemStack.isEmpty() returns true inside BLHBlockItemHandlerItemStack .isItemValid() and allows anything to be inserted.
  3. Insert an arbitrary item. The Black Hole Unit now contains the new item, with a combined count of the previous item and the new item.

notcake added a commit to notcake/Industrial-Foregoing that referenced this issue May 16, 2024
Fix a bug where Black Hole Units could accept arbitrary items and
transmute the original items when the last insert operation had a
size of 128 or larger.

Fixes InnovativeOnlineIndustries#1399.
Buuz135 pushed a commit that referenced this issue May 19, 2024
Fix a bug where Black Hole Units could accept arbitrary items and
transmute the original items when the last insert operation had a
size of 128 or larger.

Fixes #1399.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants