Fix Forge events not firing Sponge events on integrated server
We cannot cache this check, since we still want to fire events on the
server thread of the integrated server.
// Because Forge can't be bothered to keep track of this information itself
private static Map<IEventListener, Class<? extends Event>> forgeListenerRegistry = new HashMap<>();
private static Set<Class<? extends Event>> forgeListenerEventClasses = new HashSet<>();
- @Nullable private Boolean isClient;
@Shadow @Final private int busID;
@Shadow private IEventExceptionHandler exceptionHandler;
@@ -102,12 +101,8 @@ private boolean isEventAllowed(Event event) {
}
private boolean isClientPlatform() {
- if (this.isClient == null) {
// This can be called before Sponge is initialied, so use this hack
- this.isClient = SpongeModPlatform.staticGetExecutionType().isClient();
- }
-
- return this.isClient;
+ return SpongeModPlatform.staticGetExecutionType().isClient();
}
private boolean isIgnoredEvent(Event event) {
