This commit is contained in:
hyperdefined
2024-12-17 17:47:14 -05:00
parent 6b263be041
commit 7b12a130a0
4 changed files with 7 additions and 7 deletions

View File

@@ -23,7 +23,7 @@
<groupId>lol.hyper</groupId> <groupId>lol.hyper</groupId>
<artifactId>toolstats</artifactId> <artifactId>toolstats</artifactId>
<version>1.8.4</version> <version>1.8.5</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>ToolStats</name> <name>ToolStats</name>

View File

@@ -64,7 +64,7 @@ public class CraftItem implements Listener {
// if the player shift clicks, send them this warning // if the player shift clicks, send them this warning
if (event.isShiftClick()) { if (event.isShiftClick()) {
Component component = toolStats.configTools.formatLore("shift-click-warning", null, null); Component component = toolStats.configTools.formatLore("shift-click-warning.crafting", null, null);
event.getWhoClicked().sendMessage(component); event.getWhoClicked().sendMessage(component);
} }

View File

@@ -69,10 +69,8 @@ public class VillagerTrade implements Listener {
} }
// if the player shift clicks, show the warning // if the player shift clicks, show the warning
if (event.isShiftClick()) { if (event.isShiftClick()) {
String configMessage = toolStats.config.getString("messages.shift-click-warning.trading"); Component component = toolStats.configTools.formatLore("shift-click-warning.trading", null, null);
if (configMessage != null) { event.getWhoClicked().sendMessage(component);
player.sendMessage(ChatColor.translateAlternateColorCodes('&', configMessage));
}
} }
ItemStack newItem = addLore(item, player); ItemStack newItem = addLore(item, player);
if (newItem != null) { if (newItem != null) {

View File

@@ -107,7 +107,9 @@ public class ConfigTools {
Component component; Component component;
// set the placeholder to the value // set the placeholder to the value
lore = lore.replace(placeHolder, String.valueOf(value)); if (placeHolder != null && value != null) {
lore = lore.replace(placeHolder, String.valueOf(value));
}
// if we match the old color codes, then format them as so // if we match the old color codes, then format them as so
Matcher hexMatcher = CONFIG_HEX_PATTERN.matcher(lore); Matcher hexMatcher = CONFIG_HEX_PATTERN.matcher(lore);