I've already written fixes for these commands, but haven't created a pull request just yet (waiting for pull request #43 to go through). This is to let the developers create a ticket without things becoming too confusing.
Here are the three bugs I mentioned in this thread's title:
-
When doing /list -t, the command redundantly checks to see if the sender is admin twice. It accomplishes this by first checking the sender, then checking the player the sender represents. This results in a NullPointerException when attempting to execute the command from a non-player source (such as Telnet) as the sender does not represent a player from those sources:
-
Due to a fuck-up by a developer, /tempban is hardcoded to ban for 24 hours. This explains the inconsistent ban times as noted here: https://forum.totalfreedom.me/d/870-when-a-p…ed-for-24-hours
-
Using /tempban on a player who has joined in the past but isn't currently offline causes the plugin to throw a NullPointerException. This is because the getPlayer method returns null if a player isn't online. The command does verify this, but continues to try to call methods from the null player anyways. Here's the stacktrace:
Quote!```none
:[02:02:19 INFO]: videogamesm12 issued server command: /tempban TheWeeHero
:[02:02:19 ERROR]: nullorg.bukkit.command.CommandException: Unhandled exception executing 'tempban TheWeeHero' in me.totalfreedom.totalfreedommod.command.FreedomCommand$FCommand(tempban)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169)
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:810)
at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2168)
at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:1983)
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1936)
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49)
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:7)
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35)
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109)
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1252)
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1245)
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119)
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1206)
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1120)
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289)
at http://java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException
at me.totalfreedom.totalfreedommod.command.Command_tempban.run(Command_tempban.java:66)
at me.totalfreedom.totalfreedommod.command.FreedomCommand.onCommand(FreedomCommand.java:194)
at me.totalfreedom.totalfreedommod.command.FreedomCommand$FCommand.execute(FreedomCommand.java:356)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159)
... 18 more