Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
Added code comments
Added getter for moneyToDeposit for BackpackSellEvent
  • Loading branch information
Drawethree committed Feb 16, 2022
1 parent a18cae5 commit 6d777d7
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 8 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ public void setMoneyToDeposit(double moneyToDeposit) {
public Player getPlayer() {
return player;
}

public double getMoneyToDeposit() {
return moneyToDeposit;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer, Long> getEnchants();

/**
* Returns Map
* Key - {@link CompMaterial}
* @return Map of backpack contents
*/
Map<?, Long> getItems();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block> blocks);

public static void setImplementation(BackendAPI implementation) {
BackendAPI.implementation = implementation;
}
Expand All @@ -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<Block> blocks);
}

0 comments on commit 6d777d7

Please sign in to comment.