3838
3939public interface TokenManager {
4040
41+
4142 /**
4243 * Get a shop by name.
4344 *
@@ -46,6 +47,7 @@ public interface TokenManager {
4647 */
4748 Optional <Shop > getShop (final String name );
4849
50+
4951 /**
5052 * Get a shop by inventory.
5153 *
@@ -54,6 +56,7 @@ public interface TokenManager {
5456 */
5557 Optional <Shop > getShop (final Inventory inventory );
5658
59+
5760 /**
5861 * Get worth of the material defined in worth.yml.
5962 *
@@ -63,6 +66,7 @@ public interface TokenManager {
6366 */
6467 OptionalLong getWorth (final Material material );
6568
69+
6670 /**
6771 * Get worth of the item defined in worth.yml.
6872 *
@@ -72,6 +76,7 @@ public interface TokenManager {
7276 */
7377 OptionalLong getWorth (final ItemStack item );
7478
79+
7580 /**
7681 * Get online player's token balance.
7782 *
@@ -80,6 +85,7 @@ public interface TokenManager {
8085 */
8186 OptionalLong getTokens (final Player player );
8287
88+
8389 /**
8490 * Set online player's token balance.
8591 *
@@ -88,53 +94,82 @@ public interface TokenManager {
8894 */
8995 void setTokens (final Player player , final long amount );
9096
97+
98+ /**
99+ * Add an amount of tokens to online player's token balance.
100+ *
101+ * @param player Player to add tokens
102+ * @param amount Amount of tokens to add
103+ * @return true if add was successful, Otherwise false
104+ * @since v3.2.3
105+ */
106+ boolean addTokens (final Player player , final long amount );
107+
108+
109+ /**
110+ * Remove an amount of tokens from online player's token balance.
111+ *
112+ * @param player Player to remove tokens
113+ * @param amount Amount of tokens to remove
114+ * @return true if remove was successful, Otherwise false
115+ * @since v3.2.3
116+ */
117+ boolean removeTokens (final Player player , final long amount );
118+
119+
91120 /**
92121 * Set player's token balance.
93- * @since v3.1.0
94122 *
95123 * @param key {@link UUID#toString()} if server is in online mode, otherwise name of the player
96124 * @param amount Amount to replace player's token balance
125+ * @since v3.1.0
97126 */
98127 void setTokens (final String key , final long amount );
99128
129+
100130 /**
101131 * Add tokens to player's token balance.
102- * @since v3.1.0
103132 *
104133 * @param key {@link UUID#toString()} if server is in online mode, otherwise name of the player
105134 * @param amount Amount to add to player's token balance
106135 * @param silent true to prevent sending message if target player is online
136+ * @since v3.1.0
107137 */
108138 void addTokens (final String key , final long amount , final boolean silent );
109139
140+
110141 /**
111142 * Works the same as {@link #addTokens(String, long, boolean)} with silent defaulting to false.
112143 *
113144 * @see #addTokens(String, long, boolean)
114145 */
115146 void addTokens (final String key , final long amount );
116147
148+
117149 /**
118150 * Remove tokens from player's token balance.
119- * @since v3.1.0
120151 *
121152 * @param key {@link UUID#toString()} if server is in online mode, otherwise name of the player
122153 * @param amount Amount to remove from player's token balance
123154 * @param silent true to prevent sending message if target player is online
155+ * @since v3.1.0
124156 */
125157 void removeTokens (final String key , final long amount , final boolean silent );
126158
159+
127160 /**
128161 * Works the same as {@link #removeTokens(String, long, boolean)} with silent defaulting to false.
129162 *
130163 * @see #removeTokens(String, long, boolean)
131164 */
132165 void removeTokens (final String key , final long amount );
133166
167+
134168 /**
135169 * Reload the modules of the plugin.
136170 *
137171 * @return true if reload was successful, otherwise false
138172 */
139173 boolean reload ();
174+
140175}
0 commit comments