1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-30 21:07:48 +01:00

Return missing method to remove shop gui viewer

This commit is contained in:
Zrips 2017-02-15 11:53:32 +02:00
parent b98c0b87d6
commit 9c62c2605d
2 changed files with 16 additions and 4 deletions

View File

@ -69,7 +69,7 @@ public class NameTranslatorManager {
for (NameList one : ListOfEntities) {
String ids = one.getId();
if (ids.equalsIgnoreCase(String.valueOf(info.getId())) && !one.getId().equalsIgnoreCase("0")) {
return materialName = one.getName();
return one.getName();
}
}
break;

View File

@ -140,7 +140,8 @@ public class JobsListener implements Listener {
}
@EventHandler(priority = EventPriority.LOWEST)
public void onShopClick(InventoryClickEvent event) {
public void onShopGuiClick(InventoryClickEvent event) {
if (Jobs.getShopManager().GuiList.isEmpty())
return;
@ -160,13 +161,24 @@ public class JobsListener implements Listener {
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
@EventHandler(priority = EventPriority.LOWEST)
public void onShopGuiClose(InventoryCloseEvent event) {
if (Jobs.getShopManager().GuiList.isEmpty())
return;
Player player = (Player) event.getPlayer();
if (Jobs.getShopManager().GuiList.containsKey(player.getName())) {
Jobs.getShopManager().GuiList.remove(player.getName());
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void onGuiClose(InventoryCloseEvent event) {
if (Jobs.getGUIManager().GuiList.isEmpty())
return;
Player player = (Player) event.getPlayer();
if (Jobs.getGUIManager().GuiList.containsKey(player.getName()))
if (Jobs.getGUIManager().GuiList.containsKey(player.getName())) {
Jobs.getGUIManager().GuiList.remove(player.getName());
}
}
@EventHandler(priority = EventPriority.LOWEST)