Skip to content

Commit

Permalink
Fixed an issue where strings sometimes did not display properly if th…
Browse files Browse the repository at this point in the history
…ey contained "\n".
  • Loading branch information
7sat committed Dec 19, 2023
1 parent 586dd3f commit 7e11d0c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.sat7</groupId>
<artifactId>DynamicShop</artifactId>
<version>3.16.0</version>
<version>3.16.1</version>
<packaging>jar</packaging>

<name>DynamicShop</name>
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/me/sat7/dynamicshop/guis/InGameUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,20 @@ protected ItemStack CreateButton(int slotIndex, Material icon, String name, int
@SuppressWarnings({"UnusedReturnValue", "SameParameterValue"})
protected ItemStack CreateButton(int slotIndex, Material icon, String name, ArrayList<String> lore, int amount)
{
ItemStack itemStack = ItemsUtil.createItemStack(icon, null, name, lore, amount);
ArrayList<String> finalLore = new ArrayList<>();
for(String loreLine : lore)
{
if (loreLine.contains("\n"))
{
finalLore.addAll(Arrays.asList(loreLine.split("\n")));
}
else
{
finalLore.add(loreLine);
}
}

ItemStack itemStack = ItemsUtil.createItemStack(icon, null, name, finalLore, amount);
inventory.setItem(slotIndex, itemStack);

return itemStack;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/sat7/dynamicshop/guis/ShopSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public Inventory getGui(Player player, String shopName)
// 거래 UI 설정
ArrayList<String> tradeUILore = new ArrayList<>();
tradeUILore.add("§9" + t(null, "CUR_STATE") + ": " + (confSec_Options.contains("tradeUI") ? confSec_Options.get("tradeUI") : t(player,"NULL")));
tradeUILore.add(t(player, "SHOP_SETTING.TRADE_UI_LORE"));
tradeUILore.add(t(player, "SHOP_SETTING.TRADE_UI_LORE_2"));
CreateButton(TRADE_UI_SETTING, Material.EMERALD, t(player, "SHOP_SETTING.TRADE_UI"), tradeUILore);

return inventory;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/sat7/dynamicshop/utilities/LangUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static void setupLangFile(String lang)
ccLang.get().addDefault("SHOP_SETTING.COMMAND_LORE1", "§e좌클릭: 설정");
ccLang.get().addDefault("SHOP_SETTING.COMMAND_LORE3", "§e씨프트 우클릭: 마지막 항목 삭제");
ccLang.get().addDefault("SHOP_SETTING.TRADE_UI", "§f거래 UI 설정");
ccLang.get().addDefault("SHOP_SETTING.TRADE_UI_LORE", "§e좌클릭: 편집\n우클릭: 초기화");
ccLang.get().addDefault("SHOP_SETTING.TRADE_UI_LORE_2", "§e좌클릭: 편집\n§e우클릭: 초기화");

ccLang.get().addDefault("ROTATION_EDITOR_TITLE", "§3로테이션 에디터");
ccLang.get().addDefault("ROTATION_EDITOR.ENABLED", "§a로테이션 켜짐");
Expand Down Expand Up @@ -596,7 +596,7 @@ public static void setupLangFile(String lang)
ccLang.get().addDefault("SHOP_SETTING.COMMAND_LORE1", "§eLMB: Set");
ccLang.get().addDefault("SHOP_SETTING.COMMAND_LORE3", "§eShift RMB: Delete last item");
ccLang.get().addDefault("SHOP_SETTING.TRADE_UI", "§fEdit Trade UI");
ccLang.get().addDefault("SHOP_SETTING.TRADE_UI_LORE", "§eLMB: Edit\nRMB: Reset");
ccLang.get().addDefault("SHOP_SETTING.TRADE_UI_LORE_2", "§eLMB: Edit\n§eRMB: Reset");

ccLang.get().addDefault("ROTATION_EDITOR_TITLE", "§3Rotation Editor");
ccLang.get().addDefault("ROTATION_EDITOR.ENABLED", "§aEnabled");
Expand Down

0 comments on commit 7e11d0c

Please sign in to comment.