mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
No longer necessary to synchronize sync events
By: md_5 <git@md-5.net>
This commit is contained in:
parent
10ae864f52
commit
e18807dc04
@ -506,8 +506,6 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
/**
|
||||
* Calls an event with the given details.
|
||||
* <p>
|
||||
* This method only synchronizes when the event is not asynchronous.
|
||||
*
|
||||
* @param event Event details
|
||||
*/
|
||||
@ -520,15 +518,13 @@ public final class SimplePluginManager implements PluginManager {
|
||||
if (server.isPrimaryThread()) {
|
||||
throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from primary server thread.");
|
||||
}
|
||||
fireEvent(event);
|
||||
} else {
|
||||
if (!server.isPrimaryThread()) {
|
||||
throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from another thread.");
|
||||
}
|
||||
synchronized (this) {
|
||||
fireEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
fireEvent(event);
|
||||
}
|
||||
|
||||
private void fireEvent(@NotNull Event event) {
|
||||
|
Loading…
Reference in New Issue
Block a user