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

java.lang.IllegalStateException: The ItemStack that is stored has been changed! Made the game crash once and don't know how to reproduce it #10

Open
natanfudge opened this issue Aug 12, 2019 · 5 comments
Labels
type:bug Something isn't working

Comments

@natanfudge
Copy link

This happened when creating a new instance of a block entity that is an inventory provider.
https://hasteb.in/woxupaqa.yaml

@AlexIIL
Copy link
Owner

AlexIIL commented Aug 12, 2019

spatialcrafting.hologram.HologramBlock.activate(HologramBlock.kt:104)

However when I look at the source:

100 | hologramEntity.insertItem(player.getStackInHand(hand)) // is it crashing here?
101 | if (!player.isCreative) player.getStackInHand(hand).count--
102 |  logDebug {
103 |   "Inserted item into hologram. New Content: " + hologramEntity.getItem()
104 |  } // When it ways it's crashing here?
105 | }

Do you know what version of the source this crash report was generated with?

Also, in the title you said it crashed once - has this happened multiple times, or are you just not sure how to make it happen again? (Or are there any other reproduction steps needed to make this happen?)

@AlexIIL AlexIIL added the type:bug Something isn't working label Aug 12, 2019
@natanfudge
Copy link
Author

natanfudge commented Aug 12, 2019

Do you know what version of the source this crash report was generated with?

it had not been pushed yet. I will push it tomorrow.

Also, in the title you said it crashed once - has this happened multiple times, or are you just not sure how to make it happen again? (Or are there any other reproduction steps needed to make this happen?)

The error occured exactly once, during a common operation, seemingly for no reason. It occured when a HologramBlockEntity which is an inventory provider was created as part of a multiblock in my mod.

@natanfudge
Copy link
Author

natanfudge commented Aug 12, 2019

Looking at the stack trace it seems that maybe I had accidentally inserted an item as the hologram was created (which still shouldn’t crash). What does the error you throw here mean about the situation?

@AlexIIL
Copy link
Owner

AlexIIL commented Aug 12, 2019

The first stack trace is the exception that was actually thrown (and crashed the game).

The second stack trace was the first call stack that marked that item stack instance to be "unmodifiable".

(This basically tracks item stack instances to determine if one has been added to an inventory, and then changed without telling the inventory that it should be changed).

@natanfudge
Copy link
Author

natanfudge commented Aug 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants