mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-19 06:47:33 +01:00
9625680d97
Some economy plugins, such as Gringotts, only allow a limited amount of money in an account. Thus, deposits to an account can fail. Chestshop would ignore the failure, which could cause a seller not to receive the payment for selling an item. This commit fixes the problem by canceling a transaction if the seller is not able to receive the money of a sale.
44 lines
1.1 KiB
Java
44 lines
1.1 KiB
Java
package com.Acrobot.ChestShop.Economy;
|
|
|
|
import com.Acrobot.ChestShop.ChestShop;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class EconomyManager {
|
|
public boolean hasAccount(String player) {
|
|
printError();
|
|
return false;
|
|
}
|
|
|
|
public boolean add(String player, double amount) {
|
|
printError();
|
|
return false;
|
|
}
|
|
|
|
public boolean subtract(String player, double amount) {
|
|
printError();
|
|
return false;
|
|
}
|
|
|
|
public boolean hasEnough(String player, double amount) {
|
|
printError();
|
|
return false;
|
|
}
|
|
|
|
public double balance(String player) {
|
|
printError();
|
|
return 0;
|
|
}
|
|
|
|
public String format(double amount) {
|
|
printError();
|
|
return null;
|
|
}
|
|
|
|
private static void printError() {
|
|
ChestShop.getBukkitLogger().severe("You haven't got any economy plugin or your economical plugin is not supported by the build-in system!");
|
|
ChestShop.getBukkitLogger().severe("Please download an economy plugin or, if your plugin is not recognised, download Vault.");
|
|
}
|
|
}
|