mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-06-29 02:30:01 +00:00
Refactoring: New Charge class
user.canAfford(String), user.canAfford(EssentialsCommand), user.charge(String), user.charge(EssentialsCommand) have been removed. Teleport class has been changed to use the Charge class. This also fixes some bugs, like the one with warp signs. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1512 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
011fc09b4f
commit
5ae48481bd
28 changed files with 208 additions and 117 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.Charge;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -109,9 +110,10 @@ public class Commandkit extends EssentialsCommand
|
|||
items = (List<String>)kit;
|
||||
}
|
||||
|
||||
Charge charge = new Charge("kit-" + kitName);
|
||||
try
|
||||
{
|
||||
user.canAfford("kit-" + kitName);
|
||||
charge.isAffordableFor(user);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -139,8 +141,8 @@ public class Commandkit extends EssentialsCommand
|
|||
}
|
||||
try
|
||||
{
|
||||
user.charge(this);
|
||||
user.charge("kit-" + kitName);
|
||||
charge(user);
|
||||
charge.charge(user);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue