Skip to content

Commit 7b12a13

Browse files
committed
1.8.5
1 parent 6b263be commit 7b12a13

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<groupId>lol.hyper</groupId>
2525
<artifactId>toolstats</artifactId>
26-
<version>1.8.4</version>
26+
<version>1.8.5</version>
2727
<packaging>jar</packaging>
2828

2929
<name>ToolStats</name>

src/main/java/lol/hyper/toolstats/events/CraftItem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void onCraft(CraftItemEvent event) {
6464

6565
// if the player shift clicks, send them this warning
6666
if (event.isShiftClick()) {
67-
Component component = toolStats.configTools.formatLore("shift-click-warning", null, null);
67+
Component component = toolStats.configTools.formatLore("shift-click-warning.crafting", null, null);
6868
event.getWhoClicked().sendMessage(component);
6969
}
7070

src/main/java/lol/hyper/toolstats/events/VillagerTrade.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ public void onTrade(InventoryClickEvent event) {
6969
}
7070
// if the player shift clicks, show the warning
7171
if (event.isShiftClick()) {
72-
String configMessage = toolStats.config.getString("messages.shift-click-warning.trading");
73-
if (configMessage != null) {
74-
player.sendMessage(ChatColor.translateAlternateColorCodes('&', configMessage));
75-
}
72+
Component component = toolStats.configTools.formatLore("shift-click-warning.trading", null, null);
73+
event.getWhoClicked().sendMessage(component);
7674
}
7775
ItemStack newItem = addLore(item, player);
7876
if (newItem != null) {

src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public Component formatLore(String configName, String placeHolder, Object value)
107107
Component component;
108108

109109
// set the placeholder to the value
110-
lore = lore.replace(placeHolder, String.valueOf(value));
110+
if (placeHolder != null && value != null) {
111+
lore = lore.replace(placeHolder, String.valueOf(value));
112+
}
111113

112114
// if we match the old color codes, then format them as so
113115
Matcher hexMatcher = CONFIG_HEX_PATTERN.matcher(lore);

0 commit comments

Comments
 (0)