Skip to content

Commit

Permalink
Do it right
Browse files Browse the repository at this point in the history
  • Loading branch information
DSH105 committed Feb 22, 2014
1 parent 7173e25 commit c6616f0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/io/github/dsh105/echopet/config/ConfigOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.github.dsh105.echopet.menu.selector.SelectorIcon;
import io.github.dsh105.echopet.menu.selector.SelectorLayout;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;


Expand Down Expand Up @@ -127,8 +128,16 @@ public void setDefaults() {
set("petSelector.menu.slot-" + friendlySlot + ".petType", icon.getPetType() == null ? "" : icon.getPetType().toString());
set("petSelector.menu.slot-" + friendlySlot + ".materialId", icon.getMaterialId());
set("petSelector.menu.slot-" + friendlySlot + ".materialData", icon.getMaterialData());
set("petSelector.menu.slot-" + friendlySlot + ".name", icon.getName() == null ? "" : "'" + icon.getName() + "'");
set("petSelector.menu.slot-" + friendlySlot + ".lore", icon.getLore() == null || icon.getLore().length <= 0 ? "" : icon.getLore());
set("petSelector.menu.slot-" + friendlySlot + ".name", (icon.getName() == null ? "" : icon.getName()).replace(ChatColor.COLOR_CHAR, '&'));
String l = null;
for (String s : icon.getLore()) {
if (l == null) {
l = s.replace(ChatColor.COLOR_CHAR, '&');
} else {
l += ";" + s.replace(ChatColor.COLOR_CHAR, '&');
}
}
set("petSelector.menu.slot-" + friendlySlot + ".lore", l == null ? "" : l);
}
}

Expand Down

0 comments on commit c6616f0

Please sign in to comment.