With the zAuctionHouse API, you can create an infinite amount of AuctionEconomy! To do this, you need to create a class that implements the AuctionEconomy interface. Then, simply implement each method in the interface.
Here is an example of an economy with the level of the players:
If you directly imported the jar of the plugin you can use the DefaultEconomy class like that:
public class ExampleEconomy extends DefaultEconomy {
public ExampleEconomy() {
super("example", "%price%β¬", "You dont have enough money", "e");
}
@Override
public long getMoney(OfflinePlayer offlinePlayer) {
return 10000;
}
@Override
public void depositMoney(OfflinePlayer offlinePlayer, long l) {
// Do Your Stuff
}
@Override
public void withdrawMoney(OfflinePlayer offlinePlayer, long l) {
// Do Your Stuff
}
}
Vous devez ajouter dans votre plugin.yml le loadBefore pour zAuctionHouse. Cela va indiquer a votre serveur que votre plugin doit charger avant zAuctionHouse.
loadbefore:
- zAuctionHouseV3
Then you need to create a listener for the event AuctionLoadEconomyEvent, this event will allow to retrieve the EconomyManager interface to register your economy.
public class TestListener implements Listener {
@EventHandler
public void onLoad(AuctionLoadEconomyEvent event) {
EconomyManager economyManager = event.getEconomyManager();
economyManager.registerEconomy(new ExampleEconomy());
}
}