if(event.getPlayer().getGameMode() == GameMode.CREATIVE)
return;
LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());
if(!enabledBlocks.contains(new ItemInfo(event.getBlock()))) return;
if(!enabledItems.contains(player.getHeldItemInfo())) return;
if(!player.hasPermission("craftbook.mech.treelopper.use")) {
if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
player.printError("mech.use-permission");
return;
}
if(!EventUtil.passesFilter(event))
return;
Set<Location> visitedLocations = new HashSet<Location>();
visitedLocations.add(event.getBlock().getLocation());
int broken = 1;
final Block usedBlock = event.getBlock();
ItemInfo originalBlock = new ItemInfo(usedBlock);
boolean hasPlanted = false;
if(!player.hasPermission("craftbook.mech.treelopper.sapling"))
hasPlanted = true;