Closed erocs closed 8 years ago
[13:40:07 WARN]: [Humbug] Task #23 for Humbug v1.6.9 generated an exception java.lang.NullPointerException at com.untamedears.humbug.DiskMonitor.run(DiskMonitor.java:21) ~[?:?] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot.jar:git-Spigot-d97e08b-880a532]
It keeps throwing an NPE here: https://github.com/Civcraft/Humbug/blob/master/src/main/java/com/untamedears/humbug/DiskMonitor.java#L21
I'll assume I used the Humbug annotation wrong, but where exactly did I go wrong?
Move the @BahHumbug annotation into the Humbug class.
https://github.com/Civcraft/Humbug/commit/c426761b912055de67ac3db1a77aedf583ff4251
Same error:
[19:57:37 WARN]: [Humbug] Task #10 for Humbug v1.6.9 generated an exception java.lang.NullPointerException at com.untamedears.humbug.DiskMonitor.run(DiskMonitor.java:17) ~[?:?] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java :71) ~[spigot_server.jar:git-Spigot-044d928-e8c6403]
This scans the Humbug class. https://github.com/Civcraft/Humbug/blob/master/src/main/java/com/untamedears/humbug/Config.java#L129
Class.getMethods() only returns public methods on the class. http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getMethods()
Move the annotation to a public method.
Okay thanks, after doing that and fixing another NPE it works. Took way longer than it should, but at least it works now.
Start a periodic task, maybe once per minute, that checks available disk space and if it is beneath a threshold, issue a Bukkit.shutdown().