diff --git a/com/gamingmesh/jobs/HookEconomyTask.java b/com/gamingmesh/jobs/HookEconomyTask.java index d06fb351..f77547a3 100644 --- a/com/gamingmesh/jobs/HookEconomyTask.java +++ b/com/gamingmesh/jobs/HookEconomyTask.java @@ -26,7 +26,7 @@ import org.bukkit.plugin.RegisteredServiceProvider; import com.gamingmesh.jobs.economy.BlackholeEconomy; import com.gamingmesh.jobs.economy.VaultEconomy; -import com.gamingmesh.jobs.economy.IConomyAdapter; +import com.gamingmesh.jobs.economy.IConomy6Adapter; public class HookEconomyTask implements Runnable { private Jobs plugin; @@ -79,7 +79,7 @@ public class HookEconomyTask implements Runnable { return false; try { - Jobs.setEconomy(this.plugin, new IConomyAdapter((com.iCo6.iConomy) p)); + Jobs.setEconomy(this.plugin, new IConomy6Adapter((com.iCo6.iConomy) p)); } catch (Exception e) { Jobs.consoleMsg("&e[" + this.plugin.getDescription().getName() + "] UNKNOWN iConomy version."); return false; diff --git a/com/gamingmesh/jobs/Jobs.java b/com/gamingmesh/jobs/Jobs.java index 5c90350c..fcb89289 100644 --- a/com/gamingmesh/jobs/Jobs.java +++ b/com/gamingmesh/jobs/Jobs.java @@ -924,7 +924,7 @@ public class Jobs extends JavaPlugin { // Calculate income if (income != 0D) { - income = income + ((income > 0D ? income : -income) * boost.getFinal(CurrencyType.MONEY)); + income = boost.getFinalAmount(CurrencyType.MONEY, income); if (GconfigManager.useMinimumOveralPayment && income > 0) { double maxLimit = income * GconfigManager.MinimumOveralPaymentLimit; if (income < maxLimit) { @@ -935,7 +935,7 @@ public class Jobs extends JavaPlugin { // Calculate points if (pointAmount != 0D) { - pointAmount = pointAmount + ((pointAmount > 0D ? pointAmount : -pointAmount) * boost.getFinal(CurrencyType.POINTS)); + pointAmount = boost.getFinalAmount(CurrencyType.POINTS, pointAmount); if (GconfigManager.useMinimumOveralPoints && pointAmount > 0) { double maxLimit = pointAmount * GconfigManager.MinimumOveralPaymentLimit; if (pointAmount < maxLimit) { @@ -945,7 +945,7 @@ public class Jobs extends JavaPlugin { } // Calculate exp - expAmount = expAmount + ((expAmount > 0D ? expAmount : -expAmount) * boost.getFinal(CurrencyType.EXP)); + expAmount = boost.getFinalAmount(CurrencyType.EXP, expAmount); if (GconfigManager.useMinimumOveralPayment && expAmount > 0) { double maxLimit = expAmount * GconfigManager.MinimumOveralPaymentLimit; diff --git a/com/gamingmesh/jobs/commands/JobsCommands.java b/com/gamingmesh/jobs/commands/JobsCommands.java index 11f84689..f705f078 100644 --- a/com/gamingmesh/jobs/commands/JobsCommands.java +++ b/com/gamingmesh/jobs/commands/JobsCommands.java @@ -510,17 +510,15 @@ public class JobsCommands implements CommandExecutor { double income = info.getIncome(level, numjobs); -// Jobs.getPlayerManager().getFinalBonus(player, prog) - - income = income + (income * boost.getFinal(CurrencyType.MONEY)); + income = boost.getFinalAmount(CurrencyType.MONEY, income); String incomeColor = income >= 0 ? "" : ChatColor.DARK_RED.toString(); double xp = info.getExperience(level, numjobs); - xp = xp + (xp * boost.getFinal(CurrencyType.EXP)); + xp = boost.getFinalAmount(CurrencyType.EXP, xp); String xpColor = xp >= 0 ? "" : ChatColor.GRAY.toString(); double points = info.getPoints(level, numjobs); - points = points + (points * boost.getFinal(CurrencyType.POINTS)); + points = boost.getFinalAmount(CurrencyType.POINTS, points); String pointsColor = xp >= 0 ? "" : ChatColor.RED.toString(); if (income == 0D && points == 0D && xp == 0D) diff --git a/com/gamingmesh/jobs/container/Boost.java b/com/gamingmesh/jobs/container/Boost.java index 7202dd2f..37b11c45 100644 --- a/com/gamingmesh/jobs/container/Boost.java +++ b/com/gamingmesh/jobs/container/Boost.java @@ -43,6 +43,10 @@ public class Boost { return getFinal(BT, false, false); } + public double getFinalAmount(CurrencyType BT, double income) { + return income + ((income > 0D ? income : -income) * getFinal(BT, false, false)); + } + public double getFinal(CurrencyType BT, boolean percent, boolean excludeExtra) { double r = 0D; for (BoostOf one : BoostOf.values()) { diff --git a/com/gamingmesh/jobs/economy/.gitignore b/com/gamingmesh/jobs/economy/.gitignore index df73fb25..ac2a0446 100644 --- a/com/gamingmesh/jobs/economy/.gitignore +++ b/com/gamingmesh/jobs/economy/.gitignore @@ -9,3 +9,4 @@ /IConomy7Adapter.class /IConomyAdapter.class /CraftConomy3Adapter.class +/SaneEconomyAdapter.class diff --git a/com/gamingmesh/jobs/economy/IConomyAdapter.java b/com/gamingmesh/jobs/economy/IConomy6Adapter.java similarity index 94% rename from com/gamingmesh/jobs/economy/IConomyAdapter.java rename to com/gamingmesh/jobs/economy/IConomy6Adapter.java index 42cde663..60db4da7 100644 --- a/com/gamingmesh/jobs/economy/IConomyAdapter.java +++ b/com/gamingmesh/jobs/economy/IConomy6Adapter.java @@ -5,11 +5,11 @@ import org.bukkit.OfflinePlayer; import com.iCo6.iConomy; import com.iCo6.system.Accounts; -public class IConomyAdapter implements Economy { +public class IConomy6Adapter implements Economy { iConomy icon; - public IConomyAdapter(iConomy iconomy) { + public IConomy6Adapter(iConomy iconomy) { icon = iconomy; } diff --git a/plugin.yml b/plugin.yml index f08ec1c0..cdb0207b 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 3.8.0 +version: 3.8.1 author: phrstbrn softdepend: [Vault, iConomy, MythicMobs, McMMO] commands: