Improve code quality
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2023-02-11 21:05:54 +01:00
parent 85cecca263
commit 21f613bbe7
3 changed files with 6 additions and 10 deletions

View File

@ -54,7 +54,10 @@ public class HubThat extends JavaPlugin
// Initialize command classes. // Initialize command classes.
debugger.sendDebugMessage(Level.INFO, "Loading classes..."); debugger.sendDebugMessage(Level.INFO, "Loading classes...");
FileUtils fileUtilsInstance = new FileUtils(this); FileUtils fileUtilsInstance = new FileUtils(this);
// todo: ^ this is bad, utils should not be instantiated.
HubThatCommand hubThatCommandInstance = new HubThatCommand(this); HubThatCommand hubThatCommandInstance = new HubThatCommand(this);
HubCommand hubCommandInstance = new HubCommand(this); HubCommand hubCommandInstance = new HubCommand(this);
SpawnCommand spawnCommandInstance = new SpawnCommand(this); SpawnCommand spawnCommandInstance = new SpawnCommand(this);

View File

@ -13,19 +13,14 @@ public enum ConfigEntry
MOVEMENT_DETECTION_ENABLED("movement-detection.enable"), MOVEMENT_DETECTION_ENABLED("movement-detection.enable"),
GAMEMODE_SET_ON_JOIN("gamemode.set-on-join"), GAMEMODE_SET_ON_JOIN("gamemode.set-on-join"),
GAMEMODE("gamemode.mode"), GAMEMODE("gamemode.mode"),
TELEPORTATION_RESPAWN_HANDLER("teleportation.respawn-handler"), TELEPORTATION_RESPAWN_HANDLER("teleportation.respawn-handler"),
TELEPORTATION_TP_HUB_ON_JOIN("teleportation.teleport-to-hub-on-join"), TELEPORTATION_TP_HUB_ON_JOIN("teleportation.teleport-to-hub-on-join"),
TELEPORTATION_TP_MESSAGE_ON_JOIN("teleportation.send-tp-message-on-join"), TELEPORTATION_TP_MESSAGE_ON_JOIN("teleportation.send-tp-message-on-join"),
TELEPORTATION_TP_HUB_ON_RESPAWN("teleportation.teleport-to-hub-on-respawn"), TELEPORTATION_TP_HUB_ON_RESPAWN("teleportation.teleport-to-hub-on-respawn"),
MULTIVERSE_BYPASS("settings.multiverse-bypass"), MULTIVERSE_BYPASS("settings.multiverse-bypass"),
INVISIBILITY_FIX("settings.fix-invisible-after-tp"), INVISIBILITY_FIX("settings.fix-invisible-after-tp"),
; ;

View File

@ -87,8 +87,7 @@ public class UpdateChecker implements Runnable
} catch (IOException e) } catch (IOException e)
{ {
setAndSendErrorCode(e.getMessage(), console);
setAndSendErrorCode("null json", console);
return; return;
} }
@ -97,11 +96,10 @@ public class UpdateChecker implements Runnable
JsonObject json = (JsonObject)jsonParser.parse(new InputStreamReader(jsonIS, StandardCharsets.UTF_8)); JsonObject json = (JsonObject)jsonParser.parse(new InputStreamReader(jsonIS, StandardCharsets.UTF_8));
// Close the input stream... // Close the input stream...
/*try { try {
jsonIS.close(); jsonIS.close();
} catch (IOException ignored) } catch (IOException ignored)
{ {}
}*/
// Check if the "version" String is present... // Check if the "version" String is present...
newVersion = null; newVersion = null;