mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-12 18:31:32 +01:00
Fix issue when the jobs guis not opened
This commit is contained in:
parent
58b045f5e3
commit
93bec7e234
@ -228,7 +228,7 @@ public class CMIGui {
|
||||
|
||||
public void addEmptyButton(int slot) {
|
||||
ItemStack MiscInfo = filler.newItemStack();
|
||||
if (!MiscInfo.getType().isAir()) {
|
||||
if (!MiscInfo.getType().equals(org.bukkit.Material.AIR)) {
|
||||
ItemMeta MiscInfoMeta = MiscInfo.getItemMeta();
|
||||
MiscInfoMeta.setDisplayName(" ");
|
||||
MiscInfo.setItemMeta(MiscInfoMeta);
|
||||
|
@ -16,6 +16,7 @@ import com.gamingmesh.jobs.CMIGUI.CMIGui;
|
||||
import com.gamingmesh.jobs.CMIGUI.CMIGuiButton;
|
||||
import com.gamingmesh.jobs.CMIGUI.GUIManager;
|
||||
import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIClickType;
|
||||
import com.gamingmesh.jobs.CMILib.CMIMaterial;
|
||||
import com.gamingmesh.jobs.container.ActionType;
|
||||
import com.gamingmesh.jobs.container.Boost;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
@ -37,7 +38,7 @@ public class GuiManager {
|
||||
|
||||
CMIGui gui = new CMIGui(player);
|
||||
gui.setTitle(Jobs.getLanguage().getMessage("command.info.gui.pickjob"));
|
||||
gui.setFiller(Jobs.getGCManager().guiFiller);
|
||||
gui.setFiller(CMIMaterial.get(Jobs.getGCManager().guiFiller));
|
||||
|
||||
int GuiSize = Jobs.getGCManager().getJobsGUIRows() * 9;
|
||||
|
||||
@ -287,14 +288,14 @@ public class GuiManager {
|
||||
|
||||
CMIGui gui = new CMIGui(player);
|
||||
gui.setTitle(Jobs.getLanguage().getMessage("command.info.gui.jobinfo", "[jobname]", job.getName()));
|
||||
gui.setFiller(Jobs.getGCManager().guiFiller);
|
||||
gui.setFiller(CMIMaterial.get(Jobs.getGCManager().guiFiller));
|
||||
gui.setInvSize(GuiSize);
|
||||
|
||||
for (int i1 = 0; i1 < items.size(); i1++) {
|
||||
gui.addButton(new CMIGuiButton(i1, items.get(i1)));
|
||||
}
|
||||
|
||||
ItemStack skull = Jobs.getGCManager().guiBackButton.newItemStack();
|
||||
ItemStack skull = Jobs.getGCManager().guiBackButton;
|
||||
|
||||
ItemMeta skullMeta = skull.getItemMeta();
|
||||
skullMeta.setDisplayName(Jobs.getLanguage().getMessage("command.info.gui.back"));
|
||||
|
@ -28,6 +28,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.CMILib.CMIMaterial;
|
||||
@ -121,8 +122,8 @@ public class GeneralConfigManager {
|
||||
|
||||
private String DecimalPlacesMoney, DecimalPlacesExp, DecimalPlacesPoints;
|
||||
|
||||
public CMIMaterial guiBackButton;
|
||||
public CMIMaterial guiFiller;
|
||||
public ItemStack guiBackButton;
|
||||
public ItemStack guiFiller;
|
||||
|
||||
public boolean UsePerPermissionForLeaving, EnableConfirmation, FilterHiddenPlayerFromTabComplete;
|
||||
public int JobsTopAmount, PlaceholdersPage, ConfirmExpiryTime;
|
||||
@ -1009,10 +1010,10 @@ public class GeneralConfigManager {
|
||||
|
||||
CMIMaterial tmat = null;
|
||||
tmat = CMIMaterial.get(c.get("JobsGUI.BackButton.Material", "JACK_O_LANTERN").toUpperCase());
|
||||
guiBackButton = tmat == null ? CMIMaterial.JACK_O_LANTERN : tmat;
|
||||
guiBackButton = tmat == null ? CMIMaterial.JACK_O_LANTERN.newItemStack() : tmat.newItemStack();
|
||||
|
||||
tmat = CMIMaterial.get(c.get("JobsGUI.Filler.Material", "GREEN_STAINED_GLASS_PANE").toUpperCase());
|
||||
guiFiller = tmat == null ? CMIMaterial.GREEN_STAINED_GLASS_PANE : tmat;
|
||||
guiFiller = tmat == null ? CMIMaterial.GREEN_STAINED_GLASS_PANE.newItemStack() : tmat.newItemStack();
|
||||
|
||||
// c.addComment("Schedule.Boost.Enable", "Do you want to enable scheduler for global boost?");
|
||||
// useGlobalBoostScheduler = c.get("Schedule.Boost.Enable", false);
|
||||
|
@ -293,7 +293,7 @@ public class ShopManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
gui.setFiller(Jobs.getGCManager().guiFiller);
|
||||
gui.setFiller(CMIMaterial.get(Jobs.getGCManager().guiFiller));
|
||||
gui.fillEmptyButtons();
|
||||
gui.open();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user