Пример #1
0
 public boolean rewardPlayer(Player player, String lottery) {
   try {
     double left = econ.deposit(player.getName(), pot);
     ChatUtils.send(player, "lottery.reward.pot", "<pot>", econ.format(pot), "<lottery>", lottery);
     pot = left;
     return left <= 0;
   } catch (Exception ex) {
     ChatUtils.send(player, "lottery.exception.reward");
     ex.printStackTrace();
   }
   return false;
 }
 @EventHandler(ignoreCancelled = true)
 public void onBlockBreak(BlockBreakEvent event) {
   Player player = event.getPlayer();
   Block block = event.getBlock();
   if (LotteryManager.isSignRegistered(block)) {
     event.setCancelled(true);
     ChatUtils.send(player, "lottery.error.sign.break");
     return;
   }
   if (!checkBlockBroken(block)) {
     event.setCancelled(true);
     ChatUtils.send(player, "lottery.error.block.break");
     return;
   }
 }
Пример #3
0
 public String getInfo() {
   return ChatUtils.getRawName("lottery.reward.pot.info", "<pot>", econ.format(pot));
 }