mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 10:12:06 -07:00
@@ -506,8 +506,6 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls an event with the given details.
|
* Calls an event with the given details.
|
||||||
* <p>
|
|
||||||
* This method only synchronizes when the event is not asynchronous.
|
|
||||||
*
|
*
|
||||||
* @param event Event details
|
* @param event Event details
|
||||||
*/
|
*/
|
||||||
@@ -520,16 +518,14 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
if (server.isPrimaryThread()) {
|
if (server.isPrimaryThread()) {
|
||||||
throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from primary server thread.");
|
throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from primary server thread.");
|
||||||
}
|
}
|
||||||
fireEvent(event);
|
|
||||||
} else {
|
} else {
|
||||||
if (!server.isPrimaryThread()) {
|
if (!server.isPrimaryThread()) {
|
||||||
throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from another thread.");
|
throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from another thread.");
|
||||||
}
|
}
|
||||||
synchronized (this) {
|
}
|
||||||
|
|
||||||
fireEvent(event);
|
fireEvent(event);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void fireEvent(@NotNull Event event) {
|
private void fireEvent(@NotNull Event event) {
|
||||||
HandlerList handlers = event.getHandlers();
|
HandlerList handlers = event.getHandlers();
|
||||||
|
Reference in New Issue
Block a user