Add more util methods for Minimessage
This commit is contained in:
parent
7b0fd3a9cb
commit
bc2c38263a
|
|
@ -69,7 +69,7 @@ public enum GuiIcon {
|
|||
}
|
||||
|
||||
private Component format(String s) {
|
||||
return Util.parseMiniMessage(s, null);
|
||||
return Util.parseMiniMessage(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public class HomeGui extends AbstractGui {
|
|||
|
||||
public HomeGui(UUID uuid) {
|
||||
super(uuid);
|
||||
this.inventory = Bukkit.createInventory(this, INV_SIZE, Util.parseMiniMessage("Config.gui.home-title", null));
|
||||
this.inventory = Bukkit.createInventory(this, INV_SIZE, Util.parseMiniMessage("Config.gui.home-title"));
|
||||
initInvContents();
|
||||
makeMenuBar();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class ListPlayersGui extends AbstractGui {
|
|||
private List<UUID> owners;
|
||||
public ListPlayersGui(UUID uuid) {
|
||||
super(uuid);
|
||||
this.inventory = Bukkit.createInventory(this, INV_SIZE, Util.parseMiniMessage("Config.gui.list-players-title", null));
|
||||
this.inventory = Bukkit.createInventory(this, INV_SIZE, Util.parseMiniMessage("Config.gui.list-players-title"));
|
||||
initInvContents();
|
||||
makeMenuBar();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class ShopManagementGui extends AbstractGui {
|
|||
|
||||
public ShopManagementGui(UUID uuid, PlayerShop shop) {
|
||||
super(uuid);
|
||||
this.inventory = Bukkit.createInventory(this, INV_SIZE, Util.parseMiniMessage("Config.gui.management-title", null));
|
||||
this.inventory = Bukkit.createInventory(this, INV_SIZE, Util.parseMiniMessage("Config.gui.management-title"));
|
||||
this.shop = shop;
|
||||
initInvContents();
|
||||
makeMenuBar();
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class Logger {
|
|||
* @param str Message to be logged.
|
||||
*/
|
||||
public static void info(String str) {
|
||||
getLogger().info(Util.parseMiniMessage(str, null));
|
||||
getLogger().info(Util.parseMiniMessage(str));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -22,7 +22,7 @@ public class Logger {
|
|||
* @param str Message to be logged.
|
||||
*/
|
||||
public static void warn(String str) {
|
||||
getLogger().warn(Util.parseMiniMessage(str, null));
|
||||
getLogger().warn(Util.parseMiniMessage(str));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +31,7 @@ public class Logger {
|
|||
* @param str Message to be logged.
|
||||
*/
|
||||
public static void error(String str) {
|
||||
getLogger().error(Util.parseMiniMessage("<red>" + str, null));
|
||||
getLogger().error(Util.parseMiniMessage("<red>" + str));
|
||||
}
|
||||
|
||||
static ComponentLogger getLogger() {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ public class Util {
|
|||
return miniMessage;
|
||||
}
|
||||
|
||||
public static Component parseMiniMessage(String message) {
|
||||
return parseMiniMessage(message, null);
|
||||
}
|
||||
|
||||
public static Component parseMiniMessage(String message, TagResolver tagResolver) {
|
||||
message = parseColors(message);
|
||||
if (tagResolver == null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user