Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaljaz committed Jan 2, 2024
1 parent 1109e77 commit 1dfb38a
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void onEnable() {
try {
config = new Config(new BukkitConfigLoader(this.getConfig()));
} catch (EmptyConfigFieldException exception) {
getLogger().severe(String.format("[%s] %s", getDescription().getName(), exception.getMessage()));
getLogger().severe(exception.getMessage());
Bukkit.getPluginManager().disablePlugin(this);
return;
}
Expand All @@ -43,20 +43,20 @@ public void onCommand(String command) {
long executionTime = endTime - startTime;

if (executionTime < 1_000_000) {
log("Command executed in " + executionTime + " ns: " + command);
getLogger().info("Command executed in " + executionTime + " ns: " + command);
} else {
log("Command executed in " + (executionTime / 1_000_000) + " ms: " + command);
getLogger().info("Command executed in " + (executionTime / 1_000_000) + " ms: " + command);
}
}

@Override
public void onOpen(ServerHandshake serverHandshake) {
log("Connection opened");
getLogger().info("Connection opened");
}

@Override
public void onClose(int code, String reason, boolean remote) {
log("Connection closed");
getLogger().info("Connection closed");
new BukkitRunnable() {
@Override
public void run() {
Expand Down Expand Up @@ -86,8 +86,4 @@ public void onDisable() {
socket.close();
}
}

void log(String message){
getLogger().info("[ShopMC] " + message);
}
}

0 comments on commit 1dfb38a

Please sign in to comment.