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

Use Bukkit's isPrimaryThread check to set event sync status #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NonSwag
Copy link

@NonSwag NonSwag commented Dec 14, 2024

Replaced the hardcoded true for asynchronous event handling with a dynamic !Bukkit.isPrimaryThread() check across all event constructors. This ensures events can be called synchronous or asynchronous based on the server thread context.

Replaced the hardcoded `true` for asynchronous event handling with a dynamic `!Bukkit.isPrimaryThread()` check across all event constructors. This ensures events can be called synchronous or asynchronous based on the server thread context.
@NonSwag
Copy link
Author

NonSwag commented Dec 14, 2024

I only changed that behavior for async events but in theory the sync only events wouldn't cause issues when called from an async context
This change allows users for example to hide holograms from a sync context (which is basically always the case when working with bukkit events)

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.

1 participant