1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-30 21:07:48 +01:00

fix locale for limits and convert ticks to left time

This commit is contained in:
Zrips 2017-01-13 17:25:11 +02:00
parent 735c49909f
commit 9a5863c7f0
15 changed files with 9 additions and 27 deletions

View File

@ -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;

View File

@ -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<String, Boolean> 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) {

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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()) {

View File

@ -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;

View File

@ -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!");

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;