DenisD3D / Mc2Discord

Link your Minecraft server chat with your Discord (75k downloads)
https://modrinth.com/mod/mc2discord
Apache License 2.0
43 stars 11 forks source link

[1.12.2] Server crashing on wrong `/tellraw` command #89

Closed Krutoy242 closed 9 months ago

Krutoy242 commented 1 year ago

Describe the bug

I testing /tellraw commands on my 1.12.2 MC server.

Command:

/tellraw @a {}

Expected behavior

This how it works without Mc2Discord. Server just typing in chat Invalid json:, with this line in debug.log file:

[Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Invalid json: 

debug.log without crash

Actual behavior

Tested on mc2discord-forge-1.12.2-3.3.0.

Server crashing with log:

Description: Exception in server tick loop

com.google.gson.JsonParseException: Don't know how to turn {} into a Component
    at net.minecraft.util.text.ITextComponent$Serializer.deserialize(ITextComponent.java:145)
    at net.minecraft.util.text.ITextComponent$Serializer.deserialize(ITextComponent.java:43)
    at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
    at net.minecraft.util.JsonUtils.gsonDeserialize(SourceFile:492)
    at net.minecraft.util.JsonUtils.gsonDeserialize(SourceFile:517)
    at net.minecraft.util.text.ITextComponent$Serializer.jsonToComponent(ITextComponent.java:271)
    at ml.denisd3d.mc2discord.forge.Events.onCommandEvent(Events.java:109)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_912_Events_onCommandEvent_CommandEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at com.github.terminatornl.laggoggles.tickcentral.EventBusTransformer.redirectEvent(EventBusTransformer.java:67)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)

crash-2023-08-13_10.14.52-server.txt

Your config file

No response

DenisD3D commented 1 year ago

Hi, Looks like a missing error handling Thanks for reporting, I will fix that as soon as possible

DenisD3D commented 9 months ago

Fixed in 3.3.1