Sueta

⭐VaultX - Hooks your plugin into other plugins without kno

1.0.7

VaultX is a multiple environment service api which alllows plugins to hook into with 2 lines of code

·Plugin
  1. 1.0.7latestinterface inheritence adjustedApr 18, 2020
    adjusted inheritance of environment and provider interfaces
    4 downloads
  2. 1.0.6Interface adjustment, Added reasonMar 10, 2020
    BankManager interface adjusted (double hasMoney -> boolean hasMoney) added NEGATIVE_VALUE reason as input value to methods of manager interface must be positive values
    102 downloads
  3. 1.0.5Reason added to TransactionMar 4, 2020
    Useage: (Example of my eco plugin) Code (Java): @Override public Transaction withdraw ( UUID uuid, double v ) { //TODO: implement transaction state if ( ! this . enabled ) { return Transaction. FAILURE . setReason ( Reason. DISABLED ) ; } Account account = this . getAccount ( uuid ) ; if ( null == account ) { return Transaction. FAILURE . setReason ( Reason. NO_ACCOUNT ) ; } if ( account. getMoney ( ) < v ) { return Transaction. FAILURE . setReason ( Reason. NOT_ENOUGHT_MONEY ) ; } account. setMoney ( account. getMoney ( ) - v ) ; try { this . ecoHandler . persistAccount ( account ) ; return Transaction. SUCCESS ; } catch ( SQLException e ) { if ( this . plugin . isStacktrace ( ) ) { e. printStackTrace ( ) ; } } return Transaction. FAILURE . setReason ( Reason. PERSISTENCE_FAILURE ) ; } Reason.java Code (Java): public enum Reason { NO_ACCOUNT ( "no-account" ) , NOT_ENOUGHT_MONEY ( "not-enought-money" ) , NO_ACCESS ( "no-access" ) , PERSISTENCE_FAILURE ( "persistence-failure" ) , DISABLED ( "disabled" ) , UNDEFINED ( "undefined" ) ; private final String identifier ; Reason ( final String identifier ) { this . identifier = identifier ; } public String getIdentifier ( ) { return identifier ; } }
    35 downloads
  4. 1.0.4Transaction added, bank/balance manager interface adjustedMar 4, 2020
    Transaction.java (Enum) Code (Java): package de.sh99.vaultx.economy ; public enum Transaction { FAILURE ( 0 ) , PENDING ( 1 ) , SUCCESS ( 2 ) ; private final int state ; Transaction ( final int state ) { this . state = state ; } public final int getState ( ) { return state ; } } BankManager.java (Interface) Code (Java): package de.sh99.vaultx.manager ; import com.sun.istack.internal.NotNull ; import de.sh99.vaultx.economy.Transaction ; import org.bukkit.World ; import java.util.UUID ; public interface BankManager { public boolean isEnabled ( ) ; public void setEnabled ( boolean enabled ) ; public Transaction withdraw ( @NotNull UUID playerId, @NotNull double amount ) ; public Transaction deposit ( @NotNull UUID playerId, @NotNull double amount ) ; public double getMoney ( @NotNull UUID playerId ) ; public double hasMoney ( @NotNull UUID playerId, @NotNull double amount ) ; public Transaction createAccount ( @NotNull UUID playerId, @NotNull double amount ) ; public Transaction createAccount ( @NotNull UUID playerId, @NotNull double amount, @NotNull World world ) ; public Transaction closeAccount ( @NotNull UUID playerId ) ; public boolean hasAccount ( @NotNull UUID playerId ) ; public boolean isMember ( @NotNull UUID playerId ) ; public Transaction addMember ( @NotNull UUID ownerId, UUID memberId ) ; public Transaction removeMember ( @NotNull UUID playerId ) ; } BalanceManager.java (Interface) Code (Java): package de.sh99.vaultx.manager ; import com.sun.istack.internal.NotNull ; import de.sh99.vaultx.economy.Transaction ; import java.util.UUID ; public interface BalanceManager { public boolean isEnabled ( ) ; public void setEnabled ( boolean enabled ) ; public Transaction add ( @NotNull UUID playerId, @NotNull double amount ) ; public Transaction remove ( @NotNull UUID playerId, @NotNull double amount ) ; public double getMoney ( @NotNull UUID playerId ) ; public double hasMoney ( @NotNull UUID playerId, @NotNull double amount ) ; }
    4 downloads
  5. 1.0.3interface fixMar 4, 2020
    fixxed interface for manager
    2 downloads
  6. 1.0.0Full vault support addedMar 3, 2020
    Vault is now fully supported by VaultX so you just need VaultX to run all Vault plugins also.
    7 downloads
  7. 0.9Interface adjustments, refactoring of namingsMar 3, 2020
    - Interface adjustments, refactoring of namings - Also added all 3 examples for Chat, Economy and Permission now in the example project: https://github.com/Mooon1/sh99-example-vaultx
    7 downloads
  8. 0.8Chat & Permission interface got adaptedMar 3, 2020
    ChatManager.java Code (Java): package de.sh99.vaultx.manager ; import com.sun.istack.internal.NotNull ; import com.sun.istack.internal.Nullable ; import de.sh99.vaultx.env.Permission ; import org.bukkit.OfflinePlayer ; import org.bukkit.World ; import org.bukkit.entity.Player ; public interface ChatManager { public void setPermission ( Permission permission ) ; public Permission getPermission ( ) ; public String getName ( ) ; public boolean isEnabled ( ) ; public void setEnabled ( ) ; public String getPrefix ( @NotNull Player player, @Nullable World world ) ; public String getPrefix ( @NotNull OfflinePlayer offlinePlayer, @Nullable World world ) ; public void setPrefix ( @NotNull Player player, @NotNull String prefix, @Nullable World world ) ; public void setPrefix ( @NotNull OfflinePlayer offlinePlayer, @NotNull String prefix, @Nullable World world ) ; public String getSuffix ( @NotNull Player player, @Nullable World world ) ; public String getSuffix ( @NotNull OfflinePlayer offlinePlayer, @Nullable World world ) ; public void setSuffix ( Player player, @NotNull String suffix, @Nullable World world ) ; public void setSuffix ( OfflinePlayer offlinePlayer, @NotNull String suffix, @Nullable World world ) ; public String getGroupPrefix ( String group, @NotNull String prefix, @Nullable World world ) ; public void setGroupPrefix ( String group, @NotNull String prefix, @Nullable World world ) ; public String getGroupSuffix ( String group, @NotNull String suffix, @Nullable World world ) ; public void setGroupSuffix ( String group, @NotNull String suffix, @Nullable World world ) ; public Object getPlayerInfoNode ( Player player, @NotNull String node, @Nullable World world, @Nullable Object defaultNode ) ; public Object getPlayerInfoNode ( OfflinePlayer offlinePlayer, @NotNull String node, @NotNull Object value, @Nullable World world ) ; public void setPlayerInfoNode ( Player player, @NotNull String node, @NotNull Object value, @Nullable World world ) ; public void setPlayerInfoNode ( OfflinePlayer offlinePlayer, @NotNull String node, @NotNull Object value, @Nullable World world ) ; public Object getGroupInfoNode ( String group, @NotNull String node, @Nullable World world, @Nullable Object defaultNode ) ; public void setGroupInfoNode ( String group, @NotNull String node, @NotNull Object value, @Nullable World world ) ; } PermissionManager.java Code (Java): package de.sh99.vaultx.manager ; import com.sun.istack.internal.NotNull ; import com.sun.istack.internal.Nullable ; import org.bukkit.OfflinePlayer ; import org.bukkit.World ; import org.bukkit.command.CommandSender ; import org.bukkit.entity.Player ; import java.util.List ; public interface PermissionManager { public String getName ( ) ; public boolean isEnabled ( ) ; public boolean setEnabled ( ) ; public boolean isSuperPermsCompatible ( ) ; public boolean has ( @NotNull CommandSender sender, @NotNull String permission ) ; public boolean add ( @NotNull OfflinePlayer offlinePlayer, @NotNull String permission, @Nullable World world ) ; public boolean add ( @NotNull Player player, @NotNull String permission, @Nullable World world ) ; public boolean remove ( @NotNull OfflinePlayer offlinePlayer, @NotNull String permission, @Nullable World world ) ; public boolean remove ( @NotNull Player player, @NotNull String permission, @NotNull World world ) ; public boolean addTransient ( @NotNull Player player, @NotNull String permission, @Nullable World world ) ; public boolean addTransient ( @NotNull OfflinePlayer offlinePlayer, @NotNull String permission, @Nullable World world ) ; public boolean removeTransient ( @NotNull Player player, @NotNull String permission, @Nullable World world ) ; public boolean removeTransient ( @NotNull OfflinePlayer offlinePlayer, @NotNull String permission, @Nullable World world ) ; public boolean groupHas ( @NotNull String group, @NotNull String permission, @Nullable World world ) ; public boolean groupRemove ( @NotNull String group, @NotNull String permission, @Nullable World world ) ; public boolean isMember ( @NotNull String group, @NotNull Player player, @Nullable World world ) ; public boolean isMember ( @NotNull String group, @NotNull OfflinePlayer player, @Nullable World world ) ; public boolean addMember ( @NotNull String group, @NotNull Player player, @Nullable World world ) ; public boolean addMember ( @NotNull String group, @NotNull OfflinePlayer player, @Nullable World world ) ; public boolean removeMember ( @NotNull String group, @NotNull Player player, @Nullable World world ) ; public boolean removeMember ( @NotNull String group, @NotNull OfflinePlayer player, @Nullable World world ) ; public List < String > getGroupsByPlayer ( @NotNull Player player, @Nullable World world ) ; public List < String > getGroupsByPlayer ( @NotNull OfflinePlayer offlinePlayer, @Nullable World world ) ; public String getPrimaryGroup ( @NotNull Player player, @Nullable World world ) ; public String getPrimaryGroup ( @NotNull OfflinePlayer offlinePlayer, @Nullable World world ) ; public List < String > getGroups ( ) ; public boolean hasGroupSupport ( ) ; }
    3 downloads
  9. 0.5Bugfix while getting the environment & update for exampleMar 3, 2020
    There was a bug while getting the resource you got already a nullpointerexception as i returned not the environment just the interface from input so it was wrong return value. The new example shows exaclty how to handle also to support if users dont want your plugin as economy/chat/permission plugin but also keep it for good commands ie
    17 downloads
  10. 0.1-ALPHAMar 3, 2020
    7 downloads

Similar projects

Plugin →