Hi guys, so I'm trying to write to a file when the server gets shutdown but it seems my onDisable() function isn't getting called? I'd be very grateful of a second pair of eyes! Code: public void onDisable() { timeOff = new Date(); try{ try{ final Formatter file = new Formatter(time_file); file.format("%s", timeOff.toString()); file.close(); System.out.println("Hello"); } catch(IOException i){ System.out.println(i); } } catch(Exception e){ System.out.println(e); } }
I think onDiasble() just doesn't get called when shutting down the server. Also see http://bugs.bukkit.org/issues/234
ondisable is called when getPluginLoader().disablePlugin(pluginObject) is called. so it is called when you deactivate the plugin without shuting down the server.
Yeah the problem is, I need to process some stuff when the server goes down, not just when the plugin is disabled.
@Affecting_Nelas : Nope. Tried that xD Jinux, if you comment on the ticket, it could bring more attention to it.
Done now. I would have before hand but I couldn't figure out how to comment it. Then I realised this morning that it was a separate account