-
Notifications
You must be signed in to change notification settings - Fork 1
Economy Wrapper
Hempfest edited this page May 21, 2021
·
3 revisions
As you can see below its simply a wrapper forming around both vault and our own interface.
It accepts the use of multi world and has account support aswell.
public class PlayerWrapperObject {
private final OfflinePlayer player;
private final EconomyProvision provision;
public PlayerWrapperObject(OfflinePlayer op) {
this.player = op;
this.provision = EconomyProvision.getInstance();
}
public boolean has(double amount) {
return provision.has(BigDecimal.valueOf(amount), player).orElse(false);
}
public boolean deposit(double amount) {
return provision.deposit(BigDecimal.valueOf(amount), player).orElse(false);
}
public boolean withdraw(double amount) {
return provision.withdraw(BigDecimal.valueOf(amount), player).orElse(false);
}
}
If you so choose you can provide your own economy wrapper using the provision abstraction. We simply register a service on start up.
-
- AFK Player Utility
- Command Builder
- Command Utility
- Complete GUI Builder
- Complete Head Database/Locator
- Cooldown Abstraction
- Custom Gradient Color Interface
- Custom ID Generation
- Directional Enumeration
- Economy Interface Wrapper
- Entity Creation Tools
- File Management
- Item Recipe Builder
- Item Modification Builder
- Legacy Safe NamespacedKey
- Listing Collections
- Material Matcher
- Message Formatter
- String Utility
- Tab Completion Builder
- Task Scheduling
- Template Creation
- TextComponent Builder
- Vault Permission Interface Wrapper