mirror of
https://github.com/LordBoos/boosCooldowns.git
synced 2024-11-01 08:20:32 +01:00
forget to commit one class lol
This commit is contained in:
parent
2ad9adfcc1
commit
44711b94e9
28
src/cz/boosik/boosCooldown/boosPriceManager.java
Normal file
28
src/cz/boosik/boosCooldown/boosPriceManager.java
Normal file
@ -0,0 +1,28 @@
|
||||
package cz.boosik.boosCooldown;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import util.boosChat;
|
||||
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.milkbowl.vault.economy.EconomyResponse;
|
||||
|
||||
public class boosPriceManager {
|
||||
private static Economy economy = boosCoolDown.getEconomy();
|
||||
|
||||
public static void payForCommand(Player player, String pre, String message) {
|
||||
EconomyResponse r = economy.withdrawPlayer(player.getName(),
|
||||
boosConfigManager.getPrice(player, pre));
|
||||
if (r.transactionSuccess()) {
|
||||
String msg = String.format(
|
||||
boosConfigManager.getPaidForCommandMessage(),
|
||||
economy.format(r.amount), economy.format(r.balance));
|
||||
msg = msg.replaceAll("&command&", pre);
|
||||
boosChat.sendMessageToPlayer(player, msg);
|
||||
} else {
|
||||
String msg = String.format(boosConfigManager.getPaidErrorMessage(),
|
||||
r.errorMessage);
|
||||
boosChat.sendMessageToPlayer(player, msg);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user