Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2014-11-15 03:08:35 -08:00
commit 531b242cce
2 changed files with 10 additions and 7 deletions

View File

@ -277,7 +277,7 @@ public class CompassAddon extends MiniPlugin
@EventHandler(priority = EventPriority.HIGH)
public void onInventoryClick(InventoryClickEvent event)
{
if (event.getClickedInventory() != null && event.getWhoClicked() != null && event.getWhoClicked().getGameMode() == GameMode.CREATIVE && event.getClickedInventory().getTitle().equals("Spectate Menu"))
if (event.getClickedInventory() != null && event.getWhoClicked() != null && event.getWhoClicked().getGameMode() == GameMode.CREATIVE && event.getClickedInventory().getTitle().equals("Spectator Menu"))
{
event.setCancelled(false);
}

View File

@ -91,15 +91,18 @@ public class MiscManager implements Listener
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
@EventHandler(priority = EventPriority.MONITOR)
public void InventoryClickClose(InventoryClickEvent event)
{
Player player = UtilPlayer.searchExact(event.getWhoClicked().getName());
if (player == null)
return;
if (event.isCancelled())
{
Player player = UtilPlayer.searchExact(event.getWhoClicked().getName());
if (player == null)
return;
if (event.getClickedInventory().getViewers().contains(player))
player.closeInventory();
if (event.getClickedInventory().getViewers().contains(player))
player.closeInventory();
}
}
@EventHandler