Skip to content

Commit

Permalink
Utils - code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneBeee committed Oct 7, 2024
1 parent db8abb9 commit 3b6316e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/java/com/shanebeestudios/coreapi/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,24 @@
/**
* General utility class
*/
@SuppressWarnings("unused")
public class Utils {

private Utils() {
}

private static final CommandSender CONSOLE = Bukkit.getConsoleSender();
private static String CONSOLE_PREFIX = "&7[&bCoreApi&7] ";
private static String PREFIX = "&7[&bCoreApi&7] ";
private static final Pattern HEX_PATTERN = Pattern.compile("<#([A-Fa-f\\d]){6}>");
private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();

/** Set the prefix to be used in messages
/**
* Set the prefix to be used in messages
*
* @param prefix Prefix to be used in messages
*/
public static void setPrefix(String prefix) {
CONSOLE_PREFIX = prefix;
PREFIX = prefix;
}

/**
Expand Down Expand Up @@ -83,7 +86,7 @@ public static void sendTo(CommandSender sender, String message, Object... object
} else {
format = message;
}
sender.sendMessage(getColString(CONSOLE_PREFIX + format));
sender.sendMessage(getColString(PREFIX + format));
}

/**
Expand All @@ -100,7 +103,7 @@ public static void broadcast(String message, Object... objects) {
} else {
format = message;
}
Bukkit.broadcastMessage(getColString(CONSOLE_PREFIX + format));
Bukkit.broadcastMessage(getColString(PREFIX + format));
}

}

0 comments on commit 3b6316e

Please sign in to comment.