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

Fix containers being openable after destroyed #454

Open
wants to merge 2 commits into
base: 1.12-stable
Choose a base branch
from

Conversation

democat3457
Copy link

Implements the fix stated on https://www.curseforge.com/minecraft/mc-mods/containerfix.

This PR fixes the fact that if you remain in a container's inventory after the container gets destroyed, you don't get booted out of the GUI by adding a check for if the tile entity at that location is still present.

@copygirl
Copy link

This doesn't check the distance, does it?

@democat3457
Copy link
Author

no, but I just tested it, and the GUI was uninteractable after moving farther away using a minecart - would the (possibly redundant) distance check still be useful to put in regardless?

@asiekierka
Copy link
Member

Shouldn't the container's tile entity be invalidated?

@democat3457
Copy link
Author

Shouldn't the container's tile entity be invalidated?

what do you mean? the method doesnt check anything on containerHandler regarding whether it still exists, and the bug definitely exists before this pull request - and the only null check that exists will still return true if the player is the te owner

@asiekierka
Copy link
Member

isOwnerPresent() should be calling the TileEntity's isInvalid() method.

@democat3457
Copy link
Author

Hmm it must be that the TileEntity is never getting invalidate() called when destroyed

@asiekierka
Copy link
Member

It might be that it doesn't propagate to the client side.

@democat3457
Copy link
Author

@asiekierka Could this get merged anyway? It theoretically should be redundant if the invalidate() behavior worked properly, but the bug still exists, and this works as a patch in the meantime.

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

Successfully merging this pull request may close these issues.

3 participants