1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-20 14:21:43 +01:00

Correct lore usage

This commit is contained in:
Zrips 2022-11-15 17:29:49 +02:00
parent 30c06bb476
commit 513fc019fd
2 changed files with 22 additions and 15 deletions

View File

@ -206,25 +206,31 @@ public class GuiManager {
i++; i++;
} }
ItemStack next = Jobs.getGCManager().guiInfoButton; if (Jobs.getGCManager().InfoButtonSlot > 0) {
ItemMeta meta = next.getItemMeta(); ItemStack next = Jobs.getGCManager().guiInfoButton;
ItemMeta meta = next.getItemMeta();
meta.setDisplayName(" "); List<String> l = Jobs.getLanguage().getMessageList("command.info.gui.infoLore");
meta.setLore(Jobs.getLanguage().getMessageList("command.info.gui.infoLore"));
next.setItemMeta(meta);
gui.addButton(new CMIGuiButton(Jobs.getGCManager().InfoButtonSlot - 1, next) { if (!l.isEmpty())
@Override meta.setDisplayName(l.remove(0));
public void click(GUIClickType type) { if (!l.isEmpty())
for (String one : Jobs.getGCManager().InfoButtonCommands) { meta.setLore(l);
if (one.equalsIgnoreCase("closeinv!")) { next.setItemMeta(meta);
player.closeInventory();
continue; gui.addButton(new CMIGuiButton(Jobs.getGCManager().InfoButtonSlot - 1, next) {
@Override
public void click(GUIClickType type) {
for (String one : Jobs.getGCManager().InfoButtonCommands) {
if (one.equalsIgnoreCase("closeinv!")) {
player.closeInventory();
continue;
}
CMICommands.performCommand(Bukkit.getConsoleSender(), one.replace("[playerName]", player.getName()));
} }
CMICommands.performCommand(Bukkit.getConsoleSender(), one.replace("[playerName]", player.getName()));
} }
} });
}); }
gui.fillEmptyButtons(); gui.fillEmptyButtons();
gui.open(); gui.open();

View File

@ -1053,6 +1053,7 @@ public class GeneralConfigManager {
item = CMILib.getInstance().getItemManager().getItem(c.get("JobsGUI.NextButton.Material", "ARROW")); item = CMILib.getInstance().getItemManager().getItem(c.get("JobsGUI.NextButton.Material", "ARROW"));
guiNextButton = item.getCMIType() == CMIMaterial.NONE ? CMIMaterial.ARROW.newItemStack() : item.getItemStack(); guiNextButton = item.getCMIType() == CMIMaterial.NONE ? CMIMaterial.ARROW.newItemStack() : item.getItemStack();
c.addComment("JobsGUI.InfoButton.Slot", "Slot for info button. Set it to 0 if you want to disable it","Locale can be customized in locale file under gui->infoLore section");
InfoButtonSlot = c.get("JobsGUI.InfoButton.Slot", 9); InfoButtonSlot = c.get("JobsGUI.InfoButton.Slot", 9);
guiInfoButton = item.getCMIType() == CMIMaterial.NONE ? CMIMaterial.ARROW.newItemStack() : item.getItemStack(); guiInfoButton = item.getCMIType() == CMIMaterial.NONE ? CMIMaterial.ARROW.newItemStack() : item.getItemStack();
item = CMILib.getInstance().getItemManager().getItem(c.get("JobsGUI.InfoButton.Material", item = CMILib.getInstance().getItemManager().getItem(c.get("JobsGUI.InfoButton.Material",