New Command /break, and new Permission: essentials.break.bedrock

Test #1188
This commit is contained in:
KHobbits 2011-12-03 20:41:24 +00:00
parent 343618642b
commit 8ce8764f6a

View file

@ -15,9 +15,9 @@ public class Commandbreak extends EssentialsCommand
} }
@Override @Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{ {
Block block = user.getTargetBlock(null, 20); final Block block = user.getTargetBlock(null, 20);
if (block.getType() == Material.AIR) if (block.getType() == Material.AIR)
{ {
throw new NoChargeException(); throw new NoChargeException();
@ -26,7 +26,7 @@ public class Commandbreak extends EssentialsCommand
{ {
throw new NoChargeException(); throw new NoChargeException();
} }
BlockBreakEvent event = new BlockBreakEvent(block, user); final BlockBreakEvent event = new BlockBreakEvent(block, user);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (event.isCancelled()) if (event.isCancelled())
{ {