No longer necessary to synchronize sync events

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2020-01-29 09:23:40 +11:00
parent 10ae864f52
commit e18807dc04

View File

@ -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) {