Skip to content

Commit

Permalink
Using Logger instead of "System.err"
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneFuture committed Dec 5, 2022
1 parent fbcee9f commit fda026c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public void broadcast(String message) {
public void startForPlayer(Player player) {
MWPlayer mwPlayer = getPlayer(player);
if (mwPlayer == null) {
System.err.println("[MissileWars] Error starting game at player " + player.getName());
Logger.ERROR.log("Error starting game at player " + player.getName());
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@

package de.butzlabben.missilewars.inventory;

import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Objects;
import de.butzlabben.missilewars.Logger;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;

import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Objects;

@Getter
public abstract class OrcInventory {

Expand Down Expand Up @@ -112,7 +114,7 @@ public Inventory getInventory(Player p, String title) {
if (entry.getKey() >= 0 && entry.getKey() < size) {
inv.setItem(entry.getKey(), entry.getValue().getItemStack(p));
} else {
System.err.println("There is a problem with a configured Item!");
Logger.ERROR.log("There is a problem with a configured Item!");
}
}

Expand All @@ -136,7 +138,7 @@ public Inventory getInventory() {
if (entry.getKey() >= 0 && entry.getKey() < size) {
inv.setItem(entry.getKey(), entry.getValue().getItemStack());
} else {
System.err.println("There is a problem with a configured Item!");
Logger.ERROR.log("There is a problem with a configured Item!");
}
}
return inv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package de.butzlabben.missilewars.inventory.pages;

import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.inventory.OrcInventory;
import de.butzlabben.missilewars.inventory.OrcItem;
import de.butzlabben.missilewars.util.version.VersionUtil;
Expand Down Expand Up @@ -62,7 +63,7 @@ public Inventory getInventory(Player p) {

public void addItem(OrcItem item) {
if (i > 36) {
System.err.println("More items than allowed in page view");
Logger.ERROR.log("More items than allowed in page view");
return;
}
addItem(i, item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void close() {
synchronized (lock) {
try {
if (connection == null || connection.isClosed()) {
System.err.println("[MySQL] Connection does not exist or was already closed");
Logger.ERROR.log("[MySQL] Connection does not exist or was already closed");
return;
}
connection.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static void copyFile(String resource, String out) {
InputStream in = MissileWars.getInstance().getResource(resource);
Files.copy(in, file.toPath());
} catch (IOException e) {
System.err.println("Wasn't able to create Config");
Logger.ERROR.log("Wasn't able to create Config");
e.printStackTrace();
}
}
Expand Down

0 comments on commit fda026c

Please sign in to comment.