Kalimero2Team / dclink

Minecraft Plugin/Mod for linking Minecraft Accounts with Discord Accounts using a Discord Bot
MIT License
5 stars 3 forks source link

Plugin crshes velocity, #118

Open NoxVeneficus opened 1 month ago

NoxVeneficus commented 1 month ago

So uhhh. Adding this and seting up confing gives:

`Console 18:10:07

com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) [Guice/ErrorInjectingConstructor]: NullPointerException: Cannot invoke "com.kalimero2.team.dclink.DCLinkConfig.getDatabaseConfiguration()" because "this.dcLinkConfig" is null at VelocityPlugin.(VelocityPlugin.java:18) at VelocityPluginModule.configure(VelocityPluginModule.java:47) while locating VelocityPlugin Learn more: https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR 1 error

Full classname legend:

VelocityPlugin: "com.kalimero2.team.dclink.velocity.VelocityPlugin" VelocityPluginModule: "com.velocitypowered.proxy.plugin.loader.java.VelocityPluginModule"

End of classname legend:

at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1151) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1186) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.createPlugin(JavaPluginLoader.java:131) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:155) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:362) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:239) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.velocitypowered.proxy.Velocity.main(Velocity.java:71) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] Caused by: java.lang.NullPointerException: Cannot invoke "com.kalimero2.team.dclink.DCLinkConfig.getDatabaseConfiguration()" because "this.dcLinkConfig" is null at com.kalimero2.team.dclink.DCLink.init(DCLink.java:52) ~[?:?] at com.kalimero2.team.dclink.velocity.VelocityPlugin.(VelocityPlugin.java:21) ~[?:?] at com.kalimero2.team.dclink.velocity.VelocityPlugin$$FastClassByGuice$$1e6f85.GUICE$TRAMPOLINE() ~[?:?] at com.kalimero2.team.dclink.velocity.VelocityPlugin$$FastClassByGuice$$1e6f85.apply() ~[?:?] at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148) ~[velocity-3.3.0-SNAPSHOT-389.jar:3.3.0-SNAPSHOT (git-1228f147-b389)] ... 6 more WARN StatusConsoleListener [AsyncContext@4f2410ac] Ignoring log event after log4j was shut down: INFO [ooo.foooooooooooo.velocitydiscord.VelocityDiscord] Loading Velocity Discord Bridge v1.8.1 WARN StatusConsoleListener Ignoring log event after log4j was shut down`

volocit then proceeds to crash. unusable will have to remove for now.

byquanton commented 1 month ago

It seems that the config file has formatting errors. There is probably a quote ("), equal ("=") or curly brackets ("{","}") char missing. It should be like this:

database {
    # The Sqlite database filename
    sqlite-file="dclink.db"
}
discord {
    # Guild ID of the Guild where the bot will run
    guild="GUILD_ID"
    # Channel ID of the channel where the bot will send the message with the button to link their account
    link-channel="CHANNEL_ID"
    # Role ID of the role that the bot will give to the linked players (If left blank, the bot will not give any roles)
    link-role="ROLE_ID"
    # Message to show on the bot's status
    status-message=Minecraft
    # Bot Token (see https://discord.com/developers/applications)
    token="TOKEN"
}

linking {
    # Limit of Bedrock Edition accounts that can be linked to one Discord account. Requires Floodgate to be installed
    bedrock-limit=1
    # Limit of Java Edition accounts that can be linked to one Discord account
    java-limit=1
    # If true, the player needs to be linked before they can join the server
    link-required=true
}