From 9a5863c7f0c692018ee20dd5ddfa237ad72580ad Mon Sep 17 00:00:00 2001 From: Zrips Date: Fri, 13 Jan 2017 17:25:11 +0200 Subject: [PATCH] fix locale for limits and convert ticks to left time --- com/gamingmesh/jobs/Jobs.java | 1 - com/gamingmesh/jobs/PermissionManager.java | 3 --- com/gamingmesh/jobs/PlayerManager.java | 1 - com/gamingmesh/jobs/Signs/SignUtil.java | 3 --- com/gamingmesh/jobs/commands/list/bonus.java | 1 - com/gamingmesh/jobs/commands/list/bp.java | 1 - com/gamingmesh/jobs/commands/list/limit.java | 8 ++++---- com/gamingmesh/jobs/config/BlockProtectionManager.java | 1 - com/gamingmesh/jobs/config/BossBarManager.java | 2 +- com/gamingmesh/jobs/config/ConfigManager.java | 1 - com/gamingmesh/jobs/config/LanguageManager.java | 4 ++-- com/gamingmesh/jobs/config/ScheduleManager.java | 1 - com/gamingmesh/jobs/container/JobsPlayer.java | 5 ++--- com/gamingmesh/jobs/economy/PaymentData.java | 3 --- com/gamingmesh/jobs/listeners/McMMOlistener.java | 1 - 15 files changed, 9 insertions(+), 27 deletions(-) diff --git a/com/gamingmesh/jobs/Jobs.java b/com/gamingmesh/jobs/Jobs.java index b6beb23f..dd93f6a4 100644 --- a/com/gamingmesh/jobs/Jobs.java +++ b/com/gamingmesh/jobs/Jobs.java @@ -78,7 +78,6 @@ import com.gamingmesh.jobs.listeners.McMMOlistener; import com.gamingmesh.jobs.listeners.MythicMobsListener; import com.gamingmesh.jobs.listeners.PistonProtectionListener; import com.gamingmesh.jobs.stuff.ActionBar; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.JobsClassLoader; import com.gamingmesh.jobs.stuff.Loging; import com.gamingmesh.jobs.stuff.TabComplete; diff --git a/com/gamingmesh/jobs/PermissionManager.java b/com/gamingmesh/jobs/PermissionManager.java index 23358409..dca3c176 100644 --- a/com/gamingmesh/jobs/PermissionManager.java +++ b/com/gamingmesh/jobs/PermissionManager.java @@ -30,7 +30,6 @@ import org.bukkit.permissions.PermissionAttachmentInfo; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.JobsPlayer; -import com.gamingmesh.jobs.stuff.Debug; public class PermissionManager { @@ -135,10 +134,8 @@ public class PermissionManager { Double amount = null; for (Entry uno : permissions.entrySet()) { if (uno.getKey().startsWith(perm)) { - Debug.D("start with " + uno.getKey()); try { double t = Double.parseDouble(uno.getKey().replace(perm, "")); - Debug.D(t); if (amount == null || t > amount) amount = t; } catch (Exception e) { diff --git a/com/gamingmesh/jobs/PlayerManager.java b/com/gamingmesh/jobs/PlayerManager.java index 82f829c6..8191ba59 100644 --- a/com/gamingmesh/jobs/PlayerManager.java +++ b/com/gamingmesh/jobs/PlayerManager.java @@ -53,7 +53,6 @@ import com.gamingmesh.jobs.dao.JobsDAO; import com.gamingmesh.jobs.dao.JobsDAOData; import com.gamingmesh.jobs.economy.PointsData; import com.gamingmesh.jobs.stuff.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.PerformCommands; import com.gamingmesh.jobs.stuff.Perm; diff --git a/com/gamingmesh/jobs/Signs/SignUtil.java b/com/gamingmesh/jobs/Signs/SignUtil.java index 79a2ce2d..c914aa98 100644 --- a/com/gamingmesh/jobs/Signs/SignUtil.java +++ b/com/gamingmesh/jobs/Signs/SignUtil.java @@ -13,12 +13,9 @@ import org.bukkit.block.BlockFace; import org.bukkit.block.Skull; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.inventory.meta.SkullMeta; - import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.config.CommentedYamlConfiguration; import com.gamingmesh.jobs.container.TopList; -import com.gamingmesh.jobs.stuff.Debug; public class SignUtil { diff --git a/com/gamingmesh/jobs/commands/list/bonus.java b/com/gamingmesh/jobs/commands/list/bonus.java index 613a5cdd..d677935d 100644 --- a/com/gamingmesh/jobs/commands/list/bonus.java +++ b/com/gamingmesh/jobs/commands/list/bonus.java @@ -7,7 +7,6 @@ import com.gamingmesh.jobs.PlayerManager.BoostOf; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.container.Boost; -import com.gamingmesh.jobs.container.BoostMultiplier; import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.JobsPlayer; diff --git a/com/gamingmesh/jobs/commands/list/bp.java b/com/gamingmesh/jobs/commands/list/bp.java index 790c58fd..06e7e058 100644 --- a/com/gamingmesh/jobs/commands/list/bp.java +++ b/com/gamingmesh/jobs/commands/list/bp.java @@ -13,7 +13,6 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.container.BlockProtection; -import com.gamingmesh.jobs.container.DBAction; public class bp implements Cmd { diff --git a/com/gamingmesh/jobs/commands/list/limit.java b/com/gamingmesh/jobs/commands/list/limit.java index f2beadee..a0456d5f 100644 --- a/com/gamingmesh/jobs/commands/list/limit.java +++ b/com/gamingmesh/jobs/commands/list/limit.java @@ -49,15 +49,15 @@ public class limit implements Cmd { int lefttime1 = Jobs.getGCManager().currencyLimitUse.get(type).getTimeLimit() * 1000; player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output." + type.getName().toLowerCase() + "time", "%time%", TimeManage.to24hourShort((long) lefttime1))); player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output." + type.getName().toLowerCase() + "limit", - "%" + type.getName().toLowerCase() + "%", "0.0", - "%total" + type.getName().toLowerCase() + "%", JPlayer.getLimit(type))); + "%current%", "0.0", + "%total%", JPlayer.getLimit(type))); continue; } if (limit.GetLeftTime(type) > 0) { player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output." + type.getName().toLowerCase() + "time", "%time%", TimeManage.to24hourShort(limit.GetLeftTime(type)))); player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output." + type.getName().toLowerCase() + "limit", - "%" + type.getName().toLowerCase() + "%", (int) (limit.GetAmount(type) * 100) / 100D, - "%total" + type.getName().toLowerCase() + "%", JPlayer.getLimit(type))); + "%current%", (int) (limit.GetAmount(type) * 100) / 100D, + "%total%", JPlayer.getLimit(type))); } } return true; diff --git a/com/gamingmesh/jobs/config/BlockProtectionManager.java b/com/gamingmesh/jobs/config/BlockProtectionManager.java index ff03e70d..73d221f0 100644 --- a/com/gamingmesh/jobs/config/BlockProtectionManager.java +++ b/com/gamingmesh/jobs/config/BlockProtectionManager.java @@ -13,7 +13,6 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.container.BlockProtection; import com.gamingmesh.jobs.container.DBAction; import com.gamingmesh.jobs.listeners.JobsPaymentListener; -import com.gamingmesh.jobs.stuff.Debug; public class BlockProtectionManager { diff --git a/com/gamingmesh/jobs/config/BossBarManager.java b/com/gamingmesh/jobs/config/BossBarManager.java index c903dbb9..108745bd 100644 --- a/com/gamingmesh/jobs/config/BossBarManager.java +++ b/com/gamingmesh/jobs/config/BossBarManager.java @@ -151,7 +151,7 @@ public class BossBarManager { } - private BarColor getColor(Job job) { + private static BarColor getColor(Job job) { if (job.getBossbar() == null) return null; for (BarColor color : BarColor.values()) { diff --git a/com/gamingmesh/jobs/config/ConfigManager.java b/com/gamingmesh/jobs/config/ConfigManager.java index 75dda584..432c5219 100644 --- a/com/gamingmesh/jobs/config/ConfigManager.java +++ b/com/gamingmesh/jobs/config/ConfigManager.java @@ -29,7 +29,6 @@ import java.util.List; import org.apache.commons.lang.StringEscapeUtils; import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.boss.BarColor; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.enchantments.Enchantment; diff --git a/com/gamingmesh/jobs/config/LanguageManager.java b/com/gamingmesh/jobs/config/LanguageManager.java index 5ed31723..9d108186 100644 --- a/com/gamingmesh/jobs/config/LanguageManager.java +++ b/com/gamingmesh/jobs/config/LanguageManager.java @@ -126,9 +126,9 @@ public class LanguageManager { c.get("command.limit.help.info", "Shows payment limits for jobs"); c.get("command.limit.help.args", ""); c.get("command.limit.output.moneytime", "&eTime left until money limit resets: &2%time%"); - c.get("command.limit.output.moneylimit", "&eMoney limit: &2%money%&e/&2%totalmoney%"); + c.get("command.limit.output.moneylimit", "&eMoney limit: &2%current%&e/&2%total%"); c.get("command.limit.output.exptime", "&eTime left until Exp limit resets: &2%time%"); - c.get("command.limit.output.explimit", "&eExp limit: &2%exp%&e/&2%totalexp%"); + c.get("command.limit.output.explimit", "&eExp limit: &2%current%&e/&2%total%"); c.get("command.limit.output.pointstime", "&eTime left until Point limit resets: &2%time%"); c.get("command.limit.output.pointslimit", "&ePoint limit: &2%current%&e/&2%total%"); c.get("command.limit.output.reachedmoneylimit", "&4You have reached money limit in given time!"); diff --git a/com/gamingmesh/jobs/config/ScheduleManager.java b/com/gamingmesh/jobs/config/ScheduleManager.java index 66adab35..c2eb1b8f 100644 --- a/com/gamingmesh/jobs/config/ScheduleManager.java +++ b/com/gamingmesh/jobs/config/ScheduleManager.java @@ -18,7 +18,6 @@ import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.Schedule; import com.gamingmesh.jobs.stuff.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.TimeManage; public class ScheduleManager { diff --git a/com/gamingmesh/jobs/container/JobsPlayer.java b/com/gamingmesh/jobs/container/JobsPlayer.java index f12d1839..7d6fae92 100644 --- a/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/com/gamingmesh/jobs/container/JobsPlayer.java @@ -33,8 +33,8 @@ import com.gamingmesh.jobs.dao.JobsDAO; import com.gamingmesh.jobs.economy.PaymentData; import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.stuff.ChatColor; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.Perm; +import com.gamingmesh.jobs.stuff.TimeManage; public class JobsPlayer { // the player the object belongs to @@ -115,7 +115,7 @@ public class JobsPlayer { data.setInformed(); } if (data.IsAnnounceTime(limit.getAnnouncmentDelay()) && player.isOnline()) { - Jobs.getActionBar().send(player, Jobs.getLanguage().getMessage("command.limit.output." + type.getName().toLowerCase() + "time", "%time%", data.GetLeftTime(type))); + Jobs.getActionBar().send(player, Jobs.getLanguage().getMessage("command.limit.output." + type.getName().toLowerCase() + "time", "%time%", TimeManage.to24hourShort(data.GetLeftTime(type)))); } if (data.isReseted()) data.setReseted(false); @@ -254,7 +254,6 @@ public class JobsPlayer { v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all." + type.getName().toLowerCase()); if (Boost == null ||v1 != null &&v1 > Boost) Boost = v1; - Debug.D("boost " + Boost); return Boost == null ? 0D : Boost; } diff --git a/com/gamingmesh/jobs/economy/PaymentData.java b/com/gamingmesh/jobs/economy/PaymentData.java index ce687df3..abfe8a9f 100644 --- a/com/gamingmesh/jobs/economy/PaymentData.java +++ b/com/gamingmesh/jobs/economy/PaymentData.java @@ -4,7 +4,6 @@ import java.util.HashMap; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.container.CurrencyType; -import com.gamingmesh.jobs.stuff.Debug; public class PaymentData { @@ -106,7 +105,6 @@ public class PaymentData { public boolean IsOverLimit(CurrencyType type, int limit) { if (this.payments.get(type) < limit) return false; - Debug.D(type.getName() + " limit reach money"); return true; } @@ -116,7 +114,6 @@ public class PaymentData { if (this.Informed) this.Informed = false; resetLimits(); - Debug.D(type.getName() + " limit reach time"); return true; } diff --git a/com/gamingmesh/jobs/listeners/McMMOlistener.java b/com/gamingmesh/jobs/listeners/McMMOlistener.java index 1c13cdc0..02384b2a 100644 --- a/com/gamingmesh/jobs/listeners/McMMOlistener.java +++ b/com/gamingmesh/jobs/listeners/McMMOlistener.java @@ -16,7 +16,6 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.actions.ItemActionInfo; import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.JobsPlayer; -import com.gamingmesh.jobs.stuff.Debug; import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityDeactivateEvent;