1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-18 05:11:32 +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++;
}
ItemStack next = Jobs.getGCManager().guiInfoButton;
ItemMeta meta = next.getItemMeta();
if (Jobs.getGCManager().InfoButtonSlot > 0) {
ItemStack next = Jobs.getGCManager().guiInfoButton;
ItemMeta meta = next.getItemMeta();
meta.setDisplayName(" ");
meta.setLore(Jobs.getLanguage().getMessageList("command.info.gui.infoLore"));
next.setItemMeta(meta);
List<String> l = Jobs.getLanguage().getMessageList("command.info.gui.infoLore");
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;
if (!l.isEmpty())
meta.setDisplayName(l.remove(0));
if (!l.isEmpty())
meta.setLore(l);
next.setItemMeta(meta);
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.open();

View File

@ -1053,6 +1053,7 @@ public class GeneralConfigManager {
item = CMILib.getInstance().getItemManager().getItem(c.get("JobsGUI.NextButton.Material", "ARROW"));
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);
guiInfoButton = item.getCMIType() == CMIMaterial.NONE ? CMIMaterial.ARROW.newItemStack() : item.getItemStack();
item = CMILib.getInstance().getItemManager().getItem(c.get("JobsGUI.InfoButton.Material",