if(!EventUtil.passesFilter(event)) return;
if(event.getClickedBlock().getType() != Material.WALL_SIGN) return;
if(event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
ChangedSign sign = event.getSign();
if(!sign.getLine(1).equals("[Pay]")) return;
LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());
if (!player.hasPermission("craftbook.mech.pay.use")) {
if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
player.printError("mech.use-permission");
return;
}
if(!ProtectionUtil.canUse(event.getPlayer(), event.getClickedBlock().getLocation(), event.getBlockFace(), event.getAction())) {
if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
player.printError("area.use-permissions");
return;
}
double money = Double.parseDouble(sign.getLine(2));
String reciever = sign.getLine(3);
if (CraftBookPlugin.plugins.getEconomy().withdrawPlayer(event.getPlayer().getName(), money).transactionSuccess()) {
if (CraftBookPlugin.plugins.getEconomy().depositPlayer(reciever, money).transactionSuccess()) {
Block back = SignUtil.getBackBlock(event.getClickedBlock());
BlockFace bface = SignUtil.getBack(event.getClickedBlock());