Added IdentityEconomy#supportsOfflineOperations

This commit is contained in:
lbenav8095 2023-03-29 22:35:11 -06:00
parent 5dc0217eb7
commit 1a36c9963d
3 changed files with 19 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.milkbowl.vault</groupId> <groupId>net.milkbowl.vault</groupId>
<artifactId>vaultapi</artifactId> <artifactId>vaultapi</artifactId>
<version>2.0-SNAPSHOT</version> <version>2.0-SNAPSHOT-PRE</version>
<name>VaultAPI</name> <name>VaultAPI</name>
<description>Vault is a Permissions &amp; Economy API to allow plugins to more easily hook into these systems without needing to hook each individual system themselves. <description>Vault is a Permissions &amp; Economy API to allow plugins to more easily hook into these systems without needing to hook each individual system themselves.

View File

@ -36,7 +36,7 @@ public interface IdentityEconomy extends Economy{
/** /**
* Used to determine if IdentityEconomy was built through * Used to determine if IdentityEconomy was built through
* the EconomyWrapper as a LegacyEconomy. * the EconomyWrapper as a LegacyEconomy.
* If true, method {@link #getAllRecords()} will not be work. * If false, method {@link #getAllRecords()} will not be work.
* This was made in order to support plugins which use older versions of VaultAPI/Vault. * This was made in order to support plugins which use older versions of VaultAPI/Vault.
* You can also use it / override it to disable previous mentioned methods! * You can also use it / override it to disable previous mentioned methods!
* @return true if operation is supported * @return true if operation is supported
@ -46,13 +46,24 @@ public interface IdentityEconomy extends Economy{
/** /**
* Used to determine if IdentityEconomy was built through * Used to determine if IdentityEconomy was built through
* the EconomyWrapper as a LegacyEconomy. * the EconomyWrapper as a LegacyEconomy.
* If true, the method {@link #getAllOnline()} (UUID)} will not be work. * If false, the method {@link #getAllOnline()} (UUID)} will not be work.
* This was made in order to support plugins which use older versions of VaultAPI/Vault. * This was made in order to support plugins which use older versions of VaultAPI/Vault.
* You can also use it / override it to disable previous mentioned methods! * You can also use it / override it to disable previous mentioned methods!
* @return true if operation is supported * @return true if operation is supported
*/ */
public boolean supportsAllOnlineOperation(); public boolean supportsAllOnlineOperation();
/**
* Used to determine if IdentityEconomy was built through
* the EconomyWrapper as a LegacyEconomy.
* If false, all operations must be done with players that
* are online/connected to the server in real time.
* If true, you should expect to call these operations
* asynchronously.
* @return true if operation is supported
*/
public boolean supportsOfflineOperations();
/* /*
* Account-related methods follow. * Account-related methods follow.
*/ */

View File

@ -23,6 +23,11 @@ public class LegacyEconomy implements IdentityEconomy {
return false; return false;
} }
@Override
public boolean supportsOfflineOperations(){
return false;
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
return economy.isEnabled(); return economy.isEnabled();