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: Moa render crashing if a Moa is rendered before its type is set #992

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

Drullkus
Copy link
Contributor

No description provided.

@bconlon1 bconlon1 added status/pending-review The issue references a pull request which is pending review. feat/entity This issue is associated with a mob feature. labels Feb 20, 2023
@Jonathing
Copy link
Contributor

I think it would be worth trying to somehow enforce the user (developer) to set the moa type upon the moa's creation before it is freshly added to the world. This is a good workaround in case something goes horribly wrong, though.

@Drullkus
Copy link
Contributor Author

The real crash this PR fixes is when the client has not received Moa’s information in time for it to begin rendering. It’s basically a race condition and this PR eliminates the root cause.

I would’ve actually just short-circuited the main render method for it to render nothing if the type were null, but I settled for just passing a default texture instead instead of writing a render method override

Copy link
Contributor

@bconlon1 bconlon1 left a comment

Choose a reason for hiding this comment

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

lgtm

@bconlon1 bconlon1 merged commit 0350d83 into 1.19 Feb 21, 2023
@bconlon1 bconlon1 deleted the fix/drullkus/null_moa_texture_crash branch February 21, 2023 18:43
@Jonathing
Copy link
Contributor

Ah, ok. Was wondering what the issue would've been in that case. A client desync sounds like a normal case to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/entity This issue is associated with a mob feature. status/pending-review The issue references a pull request which is pending review.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants