EpicQuest

EpicQuest

42.2k Downloads

Using /q stats <playername> results in NullPointerException

bigbeno37 opened this issue ยท 4 comments

commented

Recently I took the beast of an onCommand() method from EpicMain and ported it to another file. This meant that I was obliged to test out certain commands. One of them happened to be /q stats bigbeno37 (who else could I test it on). It got to line 513 when it shucked its pants (NullPointerExceptions; yay!) (James Dashner anybody?) The stack trace is below.

[16:49:20] [Server thread/INFO]: Starting minecraft server version 1.8
[16:49:20] [Server thread/INFO]: Loading properties
[16:49:21] [Server thread/INFO]: Default game type: SURVIVAL
[16:49:21] [Server thread/INFO]: Generating keypair
[16:49:21] [Server thread/INFO]: Starting Minecraft server on *:25565
[16:49:23] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-96d09e3 (MC: 1.8) (Implementing API version 1.8-R0.1-SNAPSHOT)
[16:49:23] [Server thread/INFO]: [Vault] Loading Vault v1.5.0-b28
[16:49:23] [Server thread/INFO]: [BarAPI] Loading BarAPI v3.3
[16:49:23] [Server thread/INFO]: [Citizens] Loading Citizens v2.0.14-SNAPSHOT (build 1195)
[16:49:23] [Server thread/INFO]: [Heroes] Loading Heroes v1.5.5.4-SNAPSHOT-b66
[16:49:23] [Server thread/INFO]: [EpicQuest] Loading EpicQuest v3.4.3
[16:49:23] [Server thread/INFO]: [Vault] Enabling Vault v1.5.0-b28
[16:49:23] [Server thread/INFO]: [Vault] [Permission] SuperPermissions loaded as backup permission system.
[16:49:23] [Server thread/INFO]: [Vault] Enabled Version 1.5.0-b28
[16:49:24] [Server thread/INFO]: Preparing level "world"
[16:49:24] [Server thread/INFO]: Preparing start region for level 0 (Seed: 4972223695829082149)
[16:49:25] [Server thread/INFO]: Preparing spawn area: 16%
[16:49:26] [Server thread/INFO]: Preparing spawn area: 64%
[16:49:26] [Server thread/INFO]: Preparing start region for level 1 (Seed: 4972223695829082149)
[16:49:27] [Server thread/INFO]: Preparing spawn area: 20%
[16:49:28] [Server thread/INFO]: Preparing spawn area: 89%
[16:49:28] [Server thread/INFO]: Preparing start region for level 2 (Seed: 4972223695829082149)
[16:49:29] [Server thread/INFO]: [BarAPI] Enabling BarAPI v3.3
[16:49:29] [Server thread/INFO]: [BarAPI] Loaded
[16:49:29] [Server thread/INFO]: [Citizens] Enabling Citizens v2.0.14-SNAPSHOT (build 1195)
[16:49:30] [Server thread/ERROR]: [Citizens] Unable to find Rhino classes - javascript scripts won't see non-CraftBukkit classes
[16:49:30] [Server thread/INFO]: [Heroes] Enabling Heroes v1.5.5.4-SNAPSHOT-b66
[16:49:30] [Server thread/INFO]: [Heroes] You are running Heroes on git-Bukkit-96d09e3 (MC: 1.8)
[16:49:30] [Server thread/INFO]: [Heroes] The detected server mod is BUKKIT. Heroes will use BUKKIT compatibility!
[16:49:30] [Server thread/ERROR]: [Heroes] You are attempting to load Heroes on version v1_8_R1 which is not supported!
[16:49:30] [Server thread/INFO]: [Heroes] Disabling Heroes v1.5.5.4-SNAPSHOT-b66
[16:49:30] [Server thread/INFO]: [Heroes] version 1.5.5.4-SNAPSHOT-b66 is disabled!
[16:49:30] [Server thread/INFO]: [EpicQuest] Enabling EpicQuest v3.4.3
[16:49:31] [Server thread/INFO]: EpicQuest is done loading 20 quests.
[16:49:31] [Server thread/INFO]: EpicQuest version 3.4.3 enabled.
[16:49:31] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[16:49:31] [Server thread/INFO]: Done (7.707s)! For help, type "help" or "?"
[16:49:31] [Server thread/INFO]: [Citizens] Loaded 0 NPCs.
[16:49:32] [pool-3-thread-3/INFO]: [Vault] Checking for Updates ...
[16:49:32] [Timer-0/INFO]: Saving...
[16:49:32] [Timer-0/INFO]: There are no players to save
[16:49:34] [pool-3-thread-3/INFO]: [Vault] No new version available
[16:49:50] [User Authenticator #1/INFO]: UUID of player bigbeno37 is 81ca4297-9da7-4bdd-ad0a-7947d491e865
[16:49:52] [Server thread/INFO]: bigbeno37[/127.0.0.1:9748] logged in with entity id 285 at ([world] -18.433283935894455, 72.0, 238.41490784855822)
[16:49:56] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2005ms behind, skipping 40 tick(s)
[16:50:12] [Server thread/INFO]: bigbeno37 issued server command: /q
[16:50:18] [Server thread/INFO]: bigbeno37 issued server command: /q help
[16:50:27] [Server thread/INFO]: bigbeno37 issued server command: /q help 2
[16:50:46] [Server thread/INFO]: bigbeno37 issued server command: /q party
[16:51:07] [Server thread/INFO]: bigbeno37 issued server command: /q stats bigbeno37
[16:51:07] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'q' in plugin EpicQuest v3.4.3
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:624) ~[craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1058) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:919) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_25]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_25]
at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:643) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506) [craftbukkit-1.8.jar:git-Bukkit-96d09e3]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_25]
Caused by: java.lang.NullPointerException
at randy.listeners.CommandListener.onCommand(CommandListener.java:513) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.8.jar:git-Bukkit-96d09e3]
... 14 more
[16:54:33] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2014ms behind, skipping 40 tick(s)
[16:54:40] [Server thread/INFO]: Stopping the server
[16:54:40] [Server thread/INFO]: Stopping server
[16:54:40] [Server thread/INFO]: [EpicQuest] Disabling EpicQuest v3.4.3
[16:54:40] [Server thread/INFO]: Saving...
[16:54:40] [Server thread/INFO]: [EpicQuest]: saved 1 player(s).
[16:54:40] [Server thread/INFO]: EpicQuest succesfully disabled.
[16:54:40] [Server thread/INFO]: [Citizens] Disabling Citizens v2.0.14-SNAPSHOT (build 1195)
[16:54:40] [Server thread/INFO]: [BarAPI] Disabling BarAPI v3.3
[16:54:40] [Server thread/INFO]: [Vault] Disabling Vault v1.5.0-b28
[16:54:40] [Server thread/INFO]: Saving players
[16:54:40] [Server thread/INFO]: bigbeno37 lost connection: Server closed
[16:54:40] [Server thread/INFO]: bigbeno37 left the game.
[16:54:40] [Server thread/INFO]: Saving worlds
[16:54:40] [Server thread/INFO]: Saving chunks for level 'world'/Overworld
[16:54:41] [Server thread/INFO]: Saving chunks for level 'world_nether'/Nether
[16:54:41] [Server thread/INFO]: Saving chunks for level 'world_the_end'/The End
[16:54:41] [Thread-4/INFO]: Stopping server
[16:54:41] [Thread-4/INFO]: Saving players
[16:54:41] [Thread-4/INFO]: Saving worlds
[16:54:41] [Thread-4/INFO]: Saving chunks for level 'world'/Overworld
[16:54:41] [Thread-4/INFO]: Saving chunks for level 'world_nether'/Nether

Line 513 is player.sendMessage(ChatColor.GOLD + economy.currencyNamePlural() + " earned: " + epicPlayer2.getStatMoneyEarned() + "."); and after having a look, I can't tell where it's going wrong.

commented

Whoops, wrong one!

commented

Might be fixed with recent changes..?

commented

Can this be tested @bigbeno37 ?

commented

Actually fixed now: cd8352a