Aang23 / AuthMod

A authentication mod for recents forge servers +=1.10.2
Other
3 stars 1 forks source link

commands cannot be registered #11

Closed pgillich closed 6 years ago

pgillich commented 7 years ago

Running an AuthMod command, I got error message, for example:

> /register Abc123
[18:44:54] [Server thread/INFO]: An unknown error occurred while attempting to perform this command
[18:44:54] [Server thread/WARN]: Couldn't process command: 'register Abc123'
java.lang.ClassCastException: net.minecraft.server.dedicated.DedicatedServer cannot be cast to net.minecraft.entity.player.EntityPlayer
        at com.auth.mod.commands.RegisterCommand.func_184881_a(RegisterCommand.java:38) ~[RegisterCommand.class:?]
        at net.minecraft.command.CommandHandler.func_175786_a(CommandHandler.java:119) [k.class:?]
        at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:91) [k.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71333_ah(DedicatedServer.java:420) [lh.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:385) [lh.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]

Related warning messages during server start:

[18:43:38] [Server thread/WARN] [FML]: Missing English translation for authmod: assets/authmod/lang/en_us.lang
java.io.FileNotFoundException: assets/authmod/lang/en_us.lang
(...)
[18:43:39] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, authmod, betterwithaddons, betterwithmods, inventorypets, llibrary, malisiscore, malisisdoors, mantle, mercurius_updater, mowziesmobs, tconstruct, wolfarmor] at SERVER
[18:43:40] [Server thread/ERROR] [authmod]: The mod authmod appears to have an invalid event annotation EventHandler. This annotation can only apply to methods with recognized event arguments - it will not be called
(...)
[18:43:43] [Server thread/INFO]: [STDOUT]: AuthMod is loading!

Server versions: forge-1.11.2-13.20.1.2386-installer.jar forge-1.11.2-13.20.1.2476-installer.jar AuthMod version: AuthMod-2.6-1.11.2.jar Running in itzg/minecraft-server containter.

pgillich commented 7 years ago

Server log with config/AuthMod.cfg:debug=1 is attached: mc.log

Same result with AuthMod-2.5-1.11.2.jar

pgillich commented 7 years ago

Works well in the client shell (T). Shall it work in server shell?

Aang23 commented 7 years ago

No, register and login commands require them to be executed by a player, which is retrieved from the sender... Which cannot be cast to "Player" if that's a Server. I will fix this little issue, just in case. But apparently I will have to fix one of my EventHandler.

Running a command like the /see as the server should work just fine.

Thanks!

Aang23 commented 6 years ago

I will fix this little bug in the next release.

Aang23 commented 6 years ago

Closing. Entire rewrite coming.