Wrap firing ServerCustomPayloadEvent in ensureInEventLoop

This commit is contained in:
BlueTree242 2024-04-22 15:50:40 +02:00
parent 96d99c3093
commit a1a2959f03
No known key found for this signature in database
GPG Key ID: BB02183B33B4F258
1 changed files with 4 additions and 2 deletions

View File

@ -141,8 +141,10 @@ public class JavaCustomPayloadTranslator extends PacketTranslator<ClientboundCus
session.sendUpstreamPacket(toSend);
});
} else {
EventBus eventBus = session.getGeyser().eventBus();
eventBus.fire(new ServerCustomPayloadEvent(session, channel, packet.getData()));
session.ensureInEventLoop(() -> {
EventBus eventBus = session.getGeyser().eventBus();
eventBus.fire(new ServerCustomPayloadEvent(session, channel, packet.getData()));
});
}
}