Ejemplo n.º 1
0
 public static void sendMessageBackToSender(ICommandSender sender, String message) {
   if (sender instanceof EntityPlayer) {
     Resident res = MyTownUniverse.instance.getOrMakeResident(sender);
     res.sendMessage(message);
   } else {
     sender.addChatMessage(new ChatComponentText(message));
   }
 }
Ejemplo n.º 2
0
 public static void makeRefund(EntityPlayer player, int amount) {
   if (amount == 0) return;
   Resident res = MyTownUniverse.instance.getOrMakeResident(player);
   EconomyProxy.getEconomy().giveMoneyToPlayer(player, amount);
   res.sendMessage(
       getLocal()
           .getLocalization(
               "mytown.notification.resident.refund", EconomyProxy.getCurrency(amount)));
 }
Ejemplo n.º 3
0
 public static void makePayment(EntityPlayer player, int amount) {
   if (amount == 0) return;
   Resident res = MyTownUniverse.instance.getOrMakeResident(player);
   if (!EconomyProxy.getEconomy().takeMoneyFromPlayer(player, amount)) {
     throw new MyTownCommandException(
         "mytown.cmd.err.resident.payment", EconomyProxy.getCurrency(amount));
   }
   res.sendMessage(
       getLocal()
           .getLocalization(
               "mytown.notification.resident.payment", EconomyProxy.getCurrency(amount)));
 }