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

Avoid crashes caused by ME conduits #567

Merged

Conversation

DoctorNefario
Copy link
Contributor

@DoctorNefario DoctorNefario commented Nov 22, 2023

Description

This is a quick change to prevent crashes, and should probably be undone if/when the conduit interface changes.

Fixes #505
Fixes #530
Fixes #560

Steps to reproduce the crash this commit fixes:

  1. Move somewhere that can be unloaded, e.g. /tp 5000 200 0
  2. Place an ME conduit
  3. Unload it by leaving the area, /tp 0 200 0
  4. Load chunk containing the conduit, /tp 5000 200 0

The issue seems to be that conduits objects are reused after onRemoved is called, changing that should also fix the crash.

Checklist:

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you).
  • I have performed a self-review of my own code.
  • I have commented my code in areas it may be challenging to understand.
  • I have made corresponding changes to the documentation.
  • My changes are ready for review from a contributor.

This is a quick change to prevent crashes.
Copy link
Contributor

@justliliandev justliliandev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to reproduce the problem and it seems like this fixes it, I have no idea how many much time I wasted looking into this and not seeing the problem. tysm

@justliliandev justliliandev merged commit f0579d9 into Team-EnderIO:dev/1.20.1 Nov 23, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants