Sponge will sometimes throw a MessageChannelEvent.Chat triggered through mod objects and try to cast to a player, now it will check for player instances. Fixes
@@ -305,7 +305,7 @@ static boolean createAndPostForgeEvent(SpongeToForgeEventData spongeEventData) {
private static boolean createAndPostServerChatEvent(SpongeToForgeEventData eventData) {
final MessageChannelEvent.Chat spongeEvent = (MessageChannelEvent.Chat) eventData.getSpongeEvent();
ServerChatEvent forgeEvent = (ServerChatEvent) eventData.getForgeEvent();
- if (forgeEvent == null) {
+ if (forgeEvent == null && spongeEvent.getSource() instanceof EntityPlayerMP) {
final EntityPlayerMP player = (EntityPlayerMP) spongeEvent.getSource();
forgeEvent = new ServerChatEvent(player, spongeEvent.getRawMessage().toPlain(), SpongeTexts.toComponent(spongeEvent.getMessage()));
eventData.setForgeEvent(forgeEvent);
