Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vault2: Economy learns about UUIDs & BigDecimals. #138

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ How to include the API with Maven:
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand All @@ -24,7 +24,7 @@ repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly "com.github.MilkBowl:VaultAPI:1.7"
compileOnly "com.github.MilkBowl:VaultAPI:2.0"
}
```

Expand Down Expand Up @@ -69,10 +69,10 @@ package com.example.plugin;

import java.util.logging.Logger;

import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import net.milkbowl.vault.permission.Permission;
import net.milkbowl.vault2.chat.Chat;
import net.milkbowl.vault2.economy.Economy;
import net.milkbowl.vault2.economy.EconomyResponse;
import net.milkbowl.vault2.permission.Permission;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
Expand Down Expand Up @@ -137,8 +137,8 @@ public class ExamplePlugin extends JavaPlugin {

if(command.getLabel().equals("test-economy")) {
// Lets give the player 1.05 currency (note that SOME economic plugins require rounding!)
sender.sendMessage(String.format("You have %s", econ.format(econ.getBalance(player.getName()))));
EconomyResponse r = econ.depositPlayer(player, 1.05);
sender.sendMessage(String.format("You have %s", econ.format(econ.getBalance(player.getUniqueId()))));
EconomyResponse r = econ.depositPlayer(player.getUniqueId(), 1.05);
if(r.transactionSuccess()) {
sender.sendMessage(String.format("You were given %s and now have %s", econ.format(r.amount), econ.format(r.balance)));
} else {
Expand Down
15 changes: 13 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<version>2.0-SNAPSHOT</version>

<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.

Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms, bPerms2, SimplyPerms, DroxPerms, zPermissions, rscPermissions, KPerms, Starburst, iConomy (4/5/6) BOSEconomy *6/7), EssentialsEcon, 3Co, MultiConomy, MineConomy, EconXP, eWallet, CurrencyCore, XPBank, CraftConomy, AEco, SDFEconomy, TAEcon
Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms, bPerms2, SimplyPerms, DroxPerms, zPermissions, rscPermissions, KPerms
</description>
<url>http://dev.bukkit.org/server-mods/vault/</url>

Expand Down Expand Up @@ -44,6 +44,10 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>

<distributionManagement>
Expand All @@ -61,6 +65,13 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
<version>${bukkitVersion}</version>
<scope>provided</scope>
</dependency>
<!-- Annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<scope>provided</scope>
</dependency>
<!-- Test Dependency -->
<dependency>
<groupId>junit</groupId>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/milkbowl/vault/chat/Chat.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/**
* The main Chat API - allows for Prefix/Suffix nodes along with generic Info nodes if the linked Chat system supports them
*
* @deprecated in lieu of the modern Vault2. To update alter your import to new.milkbowl.vault2.chat.
LlmDl marked this conversation as resolved.
Show resolved Hide resolved
*/
public abstract class Chat {

Expand Down
87 changes: 0 additions & 87 deletions src/main/java/net/milkbowl/vault/economy/AbstractEconomy.java

This file was deleted.

13 changes: 7 additions & 6 deletions src/main/java/net/milkbowl/vault/economy/Economy.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/**
* The main economy API
*
* @deprecated in lieu of the modern Vault2. To update alter your import to new.milkbowl.vault2.economy and update to use the new UUID-based methods where available.
LlmDl marked this conversation as resolved.
Show resolved Hide resolved
*/
public interface Economy {

Expand Down Expand Up @@ -157,7 +158,7 @@ public interface Economy {
public boolean has(OfflinePlayer player, double amount);

/**
* @deprecated As of VaultAPI 1.4 use @{link {@link #has(OfflinePlayer, String, double)} instead.
* @deprecated As of VaultAPI 1.4 use {@link #has(OfflinePlayer, String, double)} instead.
*/
@Deprecated
public boolean has(String playerName, String worldName, double amount);
Expand All @@ -169,7 +170,7 @@ public interface Economy {
* @param player to check
* @param worldName to check with
* @param amount to check for
* @return True if <b>player</b> has <b>amount</b>, False else wise
* @return True if <b>player</b> has <b>amount</b> in the given <b>world</b>, False else wise
*/
public boolean has(OfflinePlayer player, String worldName, double amount);

Expand Down Expand Up @@ -226,7 +227,7 @@ public interface Economy {
public EconomyResponse depositPlayer(String playerName, String worldName, double amount);

/**
* Deposit an amount to a player - DO NOT USE NEGATIVE AMOUNTS
* Deposit an amount to a player on a given world - DO NOT USE NEGATIVE AMOUNTS
* IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
*
* @param player to deposit to
Expand Down Expand Up @@ -307,7 +308,7 @@ public interface Economy {
public EconomyResponse isBankOwner(String name, OfflinePlayer player);

/**
* @deprecated As of VaultAPI 1.4 use {{@link #isBankMember(String, OfflinePlayer)} instead.
* @deprecated As of VaultAPI 1.4 use {@link #isBankMember(String, OfflinePlayer)} instead.
*/
@Deprecated
public EconomyResponse isBankMember(String name, String playerName);
Expand All @@ -328,7 +329,7 @@ public interface Economy {
public List<String> getBanks();

/**
* @deprecated As of VaultAPI 1.4 use {{@link #createPlayerAccount(OfflinePlayer)} instead.
* @deprecated As of VaultAPI 1.4 use {@link #createPlayerAccount(OfflinePlayer)} instead.
*/
@Deprecated
public boolean createPlayerAccount(String playerName);
Expand All @@ -341,7 +342,7 @@ public interface Economy {
public boolean createPlayerAccount(OfflinePlayer player);

/**
* @deprecated As of VaultAPI 1.4 use {{@link #createPlayerAccount(OfflinePlayer, String)} instead.
* @deprecated As of VaultAPI 1.4 use {@link #createPlayerAccount(OfflinePlayer, String)} instead.
*/
@Deprecated
public boolean createPlayerAccount(String playerName, String worldName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* It includes a {@link ResponseType} indicating whether the plugin currently being used for Economy actually allows
* the method, or if the operation was a success or failure.
*
* @deprecated in lieu of the modern Vault2. To update alter your import to new.milkbowl.vault2.economy.
LlmDl marked this conversation as resolved.
Show resolved Hide resolved
*/
public class EconomyResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/**
* The main Permission API - allows for group and player based permission tests
*
* @deprecated in lieu of the modern Vault2. To update alter your import to new.milkbowl.vault2.permission.
LlmDl marked this conversation as resolved.
Show resolved Hide resolved
*/
public abstract class Permission {

Expand Down
Loading