Remove deprecated method usage

This commit is contained in:
Gabriele C 2016-05-04 17:35:04 +02:00
parent 5ceabe2146
commit f38d3b4545
2 changed files with 10 additions and 5 deletions

View File

@ -99,7 +99,7 @@ public class NewAPI {
* @return true if the player is an npc
*/
public boolean isNPC(Player player) {
return Utils.isNPC(player);
return plugin.getPluginHooks().isNpc(player);
}
/**

View File

@ -451,14 +451,19 @@ public class AuthMePlayerListener implements Listener {
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onPlayerInventoryClick(InventoryClickEvent event) {
if (event.getWhoClicked() == null)
if (event.getWhoClicked() == null) {
return;
if (!(event.getWhoClicked() instanceof Player))
}
if (!(event.getWhoClicked() instanceof Player)) {
return;
if (Utils.checkAuth((Player) event.getWhoClicked()))
}
Player player = (Player) event.getWhoClicked();
if (Utils.checkAuth(player)) {
return;
if (Utils.isNPC((Player) event.getWhoClicked()))
}
if (plugin.getPluginHooks().isNpc(player)) {
return;
}
event.setCancelled(true);
}