Mc2Discord

Mc2Discord

50.4k Downloads

Exception in server tick loop, server crash when using Account.Policy settings

xhatz opened this issue ยท 2 comments

commented

Describe the bug

Basically as the title says, whenever I set up a required role ID and a role ID to give upon account linking, the server crashes upon starting, giving me the following error:

Exception in server tick loop

java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.util.List (java.lang.Long and java.util.List are in module java.base of loader 'bootstrap')
	at ml.denisd3d.mc2discord.core.config.account.SnowflakeArrayConverter.convertToField(SnowflakeArrayConverter.java:9) ~[mc2discord-forge-1.18.x-3.3.0.jar%2339!/:3.3.0] {re:classloading}
	at com.electronwill.nightconfig.core.conversion.ObjectConverter.convertToObject(ObjectConverter.java:222) ~[core-3.6.4.jar%237!/:?] {}
	at com.electronwill.nightconfig.core.conversion.ObjectConverter.convertConfigsToObject(ObjectConverter.java:413) ~[core-3.6.4.jar%237!/:?] {}
	at com.electronwill.nightconfig.core.conversion.ObjectConverter.convertToObject(ObjectConverter.java:276) ~[core-3.6.4.jar%237!/:?] {}
	at com.electronwill.nightconfig.core.conversion.ObjectConverter.toObject(ObjectConverter.java:101) ~[core-3.6.4.jar%237!/:?] {}
	at ml.denisd3d.mc2discord.repack.ml.denisd3d.config4j.Config4J.mapConfig(Config4J.java:63) ~[mc2discord-forge-1.18.x-3.3.0.jar%2339!/:3.3.0] {re:classloading}
	at ml.denisd3d.mc2discord.repack.ml.denisd3d.config4j.Config4J.load(Config4J.java:45) ~[mc2discord-forge-1.18.x-3.3.0.jar%2339!/:3.3.0] {re:classloading}
	at ml.denisd3d.mc2discord.repack.ml.denisd3d.config4j.Config4J.loadAndCorrect(Config4J.java:34) ~[mc2discord-forge-1.18.x-3.3.0.jar%2339!/:3.3.0] {re:classloading}
	at ml.denisd3d.mc2discord.core.Mc2Discord.<init>(Mc2Discord.java:93) ~[mc2discord-forge-1.18.x-3.3.0.jar%2339!/:3.3.0] {re:mixin,re:classloading}
	at ml.denisd3d.mc2discord.forge.Mc2DiscordForge.onServerStarting(Mc2DiscordForge.java:54) ~[mc2discord-forge-1.18.x-3.3.0.jar%2339!/:3.3.0] {re:classloading}
	at net.minecraftforge.eventbus.ASMEventHandler_2_Mc2DiscordForge_onServerStarting_ServerStartingEvent.invoke(.dynamic) ~[?:?] {}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-5.0.3.jar%232!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%232!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%232!/:?] {}
	at net.minecraftforge.server.ServerLifecycleHooks.handleServerStarting(ServerLifecycleHooks.java:98) ~[forge-1.18.2-40.1.86-universal.jar%2346!/:?] {re:classloading}
	at net.minecraft.server.dedicated.DedicatedServer.m_7038_(DedicatedServer.java:207) ~[server-1.18.2-20220404.173914-srg.jar%2341!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.18.2-20220404.173914-srg.jar%2341!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:261) ~[server-1.18.2-20220404.173914-srg.jar%2341!/:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:833) [?:?] {re:mixin}

I am using the latest version of forge for Minecraft 1.18.2, as well as the latest version of the mod.

Your config file

No response

commented

This looks like you set the value to the id instead of an array of id.
Change your value to [1234567890] instead of 1234567890
If this does not solve your issue, please send your config file without the token

commented

That was the issue haha, thank you very much!