diff --git a/pom.xml b/pom.xml index 200d373..2e51354 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,10 @@ spigot-repo https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + jitpack.io + https://jitpack.io + diff --git a/src/main/java/dev/drawethree/ultrabackpacks/api/event/BackpackSellEvent.java b/src/main/java/dev/drawethree/ultrabackpacks/api/event/BackpackSellEvent.java index 502b4e7..2c14977 100644 --- a/src/main/java/dev/drawethree/ultrabackpacks/api/event/BackpackSellEvent.java +++ b/src/main/java/dev/drawethree/ultrabackpacks/api/event/BackpackSellEvent.java @@ -37,4 +37,8 @@ public void setMoneyToDeposit(double moneyToDeposit) { public Player getPlayer() { return player; } + + public double getMoneyToDeposit() { + return moneyToDeposit; + } } diff --git a/src/main/java/dev/drawethree/ultrabackpacks/api/model/backpack/IBackpackData.java b/src/main/java/dev/drawethree/ultrabackpacks/api/model/backpack/IBackpackData.java index b7031de..a1a6a11 100644 --- a/src/main/java/dev/drawethree/ultrabackpacks/api/model/backpack/IBackpackData.java +++ b/src/main/java/dev/drawethree/ultrabackpacks/api/model/backpack/IBackpackData.java @@ -4,7 +4,18 @@ public interface IBackpackData { + /** + * Returns Map of enchants that player has in his backpack. + * Key - Id of enchant + * Value - Level of enchant + * @return Map of enchants belonging to player + */ Map getEnchants(); + /** + * Returns Map + * Key - {@link CompMaterial} + * @return Map of backpack contents + */ Map getItems(); } diff --git a/src/main/java/dev/drawethree/ultrabackpacks/api/service/BackendAPI.java b/src/main/java/dev/drawethree/ultrabackpacks/api/service/BackendAPI.java index 7d751f4..e2dcd08 100644 --- a/src/main/java/dev/drawethree/ultrabackpacks/api/service/BackendAPI.java +++ b/src/main/java/dev/drawethree/ultrabackpacks/api/service/BackendAPI.java @@ -10,6 +10,39 @@ public abstract class BackendAPI { private static BackendAPI implementation; + /** + * Returns true if player has backpack in his inventory + * + * @param player Player + * @return true if player has backpack in his inventory + */ + + public abstract boolean hasBackpack(Player player); + + /** + * Get player BackpackData + * + * @param player Player + * @return BackpackData.class + */ + public abstract IBackpackData getBackpackData(Player player); + + /** + * Sells the contents of player backpack. + * + * @param player Player + * @param sellAll If true, sells whole backpack. If false, sells only x amount of items based on AutoSell backpack enchant. + */ + public abstract void sellBackpack(Player player, boolean sellAll); + + /** + * Handles the specified broken blocks and tries to add them into backpack + * + * @param player Player + * @param blocks List of blocks that were broken and should be added to backpack + */ + public abstract void handleBlocksBroken(Player player, List blocks); + public static void setImplementation(BackendAPI implementation) { BackendAPI.implementation = implementation; } @@ -21,12 +54,4 @@ public static BackendAPI getImplementation() { return implementation; } - - public abstract boolean hasBackpack(Player player); - - public abstract IBackpackData getBackpackData(Player player); - - public abstract void sellBackpack(Player player, boolean sellAll); - - public abstract void handleBlocksBroken(Player player, List blocks); }