22
33import fr .traqueur .currencies .providers .*;
44import org .bukkit .Bukkit ;
5- import org .bukkit .OfflinePlayer ;
65
76import java .lang .reflect .Constructor ;
87import java .math .BigDecimal ;
98import java .util .Arrays ;
109import java .util .HashMap ;
1110import java .util .Map ;
11+ import java .util .UUID ;
1212
1313/**
1414 * The list of all the currencies that can be used in the plugin.
@@ -154,88 +154,91 @@ private boolean isDisable() {
154154 /**
155155 * Add some money to a player.
156156 *
157- * @param player The player to add the money.
158- * @param amount The amount of money to add.
159- * @param reason The reason of the deposit.
157+ * @param playerId The UUID of the player to add the money.
158+ * @param amount The amount of money to add.
159+ * @param reason The reason of the deposit.
160160 */
161- public void deposit (OfflinePlayer player , BigDecimal amount , String reason ) {
162- this .deposit (player , amount , "default" , reason );
161+ public void deposit (UUID playerId , BigDecimal amount , String reason ) {
162+ this .deposit (playerId , amount , "default" , reason );
163163 }
164164
165165 /**
166166 * Remove some money from a player.
167167 *
168- * @param player The player to remove the money.
169- * @param amount The amount of money to remove.
170- * @param reason The reason of the withdrawal.
168+ * @param playerId The UUID of the player to remove the money.
169+ * @param amount The amount of money to remove.
170+ * @param reason The reason of the withdrawal.
171171 */
172- public void withdraw (OfflinePlayer player , BigDecimal amount , String reason ) {
173- this .withdraw (player , amount , "default" , reason );
172+ public void withdraw (UUID playerId , BigDecimal amount , String reason ) {
173+ this .withdraw (playerId , amount , "default" , reason );
174174 }
175175
176176 /**
177177 * Add some money to a player.
178178 *
179- * @param player The player to add the money.
180- * @param amount The amount of money to add.
179+ * @param playerId The UUID of the player to add the money.
180+ * @param amount The amount of money to add.
181181 */
182- public void deposit (OfflinePlayer player , BigDecimal amount ) {
183- this .deposit (player , amount , "default" , "No reason" );
182+ public void deposit (UUID playerId , BigDecimal amount ) {
183+ this .deposit (playerId , amount , "default" , "No reason" );
184184 }
185185
186186 /**
187187 * Remove some money from a player.
188188 *
189- * @param player The player to remove the money.
190- * @param amount The amount of money to remove.
189+ * @param playerId The UUID of the player to remove the money.
190+ * @param amount The amount of money to remove.
191191 */
192- public void withdraw (OfflinePlayer player , BigDecimal amount ) {
193- this .withdraw (player , amount , "default" , "No reason" );
192+ public void withdraw (UUID playerId , BigDecimal amount ) {
193+ this .withdraw (playerId , amount , "default" , "No reason" );
194194 }
195195
196196 /**
197197 * Get the balance of a player.
198198 *
199- * @param player The player to get the balance.
199+ * @param playerId The UUID of the player to get the balance.
200200 * @return The balance of the player.
201201 */
202- public BigDecimal getBalance (OfflinePlayer player ) {
203- return getBalance (player , "default" );
202+ public BigDecimal getBalance (UUID playerId ) {
203+ return getBalance (playerId , "default" );
204204 }
205205
206206 /**
207207 * Add some money to a player.
208208 *
209- * @param player The player to add the money.
210- * @param amount The amount of money to add.
211- * @param reason The reason of the deposit.
209+ * @param playerId The UUID of the player to add the money.
210+ * @param amount The amount of money to add.
211+ * @param currencyName The name of the currency.
212+ * @param reason The reason of the deposit.
212213 */
213- public void deposit (OfflinePlayer player , BigDecimal amount , String currencyName , String reason ) {
214+ public void deposit (UUID playerId , BigDecimal amount , String currencyName , String reason ) {
214215 this .canBeUse (currencyName );
215- this .providers .get (currencyName ).deposit (player , amount , reason );
216+ this .providers .get (currencyName ).deposit (playerId , amount , reason );
216217 }
217218
218219 /**
219220 * Remove some money from a player.
220221 *
221- * @param player The player to remove the money.
222- * @param amount The amount of money to remove.
223- * @param reason The reason of the withdrawal.
222+ * @param playerId The UUID of the player to remove the money.
223+ * @param amount The amount of money to remove.
224+ * @param currencyName The name of the currency.
225+ * @param reason The reason of the withdrawal.
224226 */
225- public void withdraw (OfflinePlayer player , BigDecimal amount , String currencyName , String reason ) {
227+ public void withdraw (UUID playerId , BigDecimal amount , String currencyName , String reason ) {
226228 this .canBeUse (currencyName );
227- this .providers .get (currencyName ).withdraw (player , amount , reason );
229+ this .providers .get (currencyName ).withdraw (playerId , amount , reason );
228230 }
229231
230232 /**
231233 * Get the balance of a player.
232234 *
233- * @param player The player to get the balance.
235+ * @param playerId The UUID of the player to get the balance.
236+ * @param currencyName The name of the currency.
234237 * @return The balance of the player.
235238 */
236- public BigDecimal getBalance (OfflinePlayer player , String currencyName ) {
239+ public BigDecimal getBalance (UUID playerId , String currencyName ) {
237240 this .canBeUse (currencyName );
238- return this .providers .get (currencyName ).getBalance (player );
241+ return this .providers .get (currencyName ).getBalance (playerId );
239242 }
240243
241244 private void canBeUse (String currencyName ) {
@@ -254,4 +257,4 @@ private void canBeUse(String currencyName) {
254257 throw new IllegalStateException ("You must create the provider for the plugin " + this .name + currency + " before using it." );
255258 }
256259 }
257- }
260+ }
0 commit comments