MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / shutdown

Method shutdown

The 5zig Mod/src/eu/the5zig/mod/The5zigMod.java:222–254  ·  view source on GitHub ↗

Called from Minecraft internally. Disconnects from the 5zig mod server, destroys the Tray Icon, finishes the AsyncExecutor and closes the sql connection.

()

Source from the content-addressed store, hash-verified

220 * Tray Icon, finishes the AsyncExecutor and closes the sql connection.
221 */
222 public static void shutdown() {
223 logger.info("Stopping The 5zig Mod!");
224 try {
225 if (api != null) {
226 api.getPluginManager().unloadAll();
227 }
228 if (networkManager != null) {
229 networkManager.disconnect();
230 }
231 if (trayManager != null) {
232 trayManager.destroy();
233 }
234 asyncExecutor.finish();
235 if (conversationDatabase != null) {
236 conversationDatabase.closeConnection();
237 }
238 if (datamanager != null) {
239 if (datamanager.getFileTransferManager() != null) {
240 // Cleanup .part files
241 datamanager.getFileTransferManager().cleanUp(new File(modDirectory, "media/" + datamanager.getUniqueId().toString()));
242 }
243 if (datamanager.getKeyboardManager() != null) {
244 datamanager.getKeyboardManager().unInit();
245 }
246 if (datamanager.getITunesManager() != null && datamanager.getITunesManager().getDelegate() instanceof ITunesWindowsDelegate) {
247 ((ITunesWindowsDelegate) datamanager.getITunesManager().getDelegate()).release();
248 }
249 TeamSpeak.getClient().disconnect();
250 }
251 } catch (Throwable throwable) {
252 logger.warn("Could not shutdown The 5zig Mod properly!", throwable);
253 }
254 }
255
256 /**
257 * @return true, if the mod already has been initialized.

Callers 1

onShutdownMethod · 0.95

Calls 15

unloadAllMethod · 0.80
getPluginManagerMethod · 0.80
disconnectMethod · 0.80
destroyMethod · 0.80
finishMethod · 0.80
cleanUpMethod · 0.80
getKeyboardManagerMethod · 0.80
getITunesManagerMethod · 0.80
getDelegateMethod · 0.80
closeConnectionMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected