stacker wont give too many msgs

This commit is contained in:
Cheese 2015-06-29 10:13:33 +10:00
parent b0f8369bcd
commit 2963f7a61c

View File

@ -57,6 +57,22 @@ public class StackerManager extends MiniPlugin implements IThrown
if (event.isCancelled()) if (event.isCancelled())
return; return;
Entity stackee = event.getRightClicked();
if (stackee == null)
return;
if (!(stackee instanceof LivingEntity))
return;
if (stackee instanceof Horse)
return;
if (stackee instanceof EnderDragon)
return;
if (stackee instanceof Player && ((Player)stackee).getGameMode() != GameMode.SURVIVAL)
return;
Player stacker = event.getPlayer(); Player stacker = event.getPlayer();
if (stacker.getGameMode() != GameMode.SURVIVAL) if (stacker.getGameMode() != GameMode.SURVIVAL)
@ -89,22 +105,6 @@ public class StackerManager extends MiniPlugin implements IThrown
return; return;
} }
Entity stackee = event.getRightClicked();
if (stackee == null)
return;
if (!(stackee instanceof LivingEntity))
return;
if (stackee instanceof Horse)
return;
if (stackee instanceof EnderDragon)
return;
if (stackee instanceof Player && ((Player)stackee).getGameMode() != GameMode.SURVIVAL)
return;
stackerEvent = new StackerEvent(stackee); stackerEvent = new StackerEvent(stackee);
Bukkit.getServer().getPluginManager().callEvent(stackerEvent); Bukkit.getServer().getPluginManager().callEvent(stackerEvent);
if (stackerEvent.isCancelled()) if (stackerEvent.isCancelled())