Fixed %prettytime% not working on forever time
This commit is contained in:
parent
5393d5556b
commit
98e4916a18
@ -146,6 +146,7 @@ public class Util {
|
||||
msg = msg.replace("%prettytime%", Util.getDurationBreakdown(p.getRemainingTime()));
|
||||
}else {
|
||||
msg = msg.replace("%timeinminutes%", Lang.JAILEDFOREVERSIGN.get());
|
||||
msg = msg.replace("%prettytime%", Lang.JAILEDFOREVERSIGN.get());
|
||||
}
|
||||
|
||||
return getColorfulMessage(msg);
|
||||
@ -223,7 +224,7 @@ public class Util {
|
||||
*/
|
||||
public static String getDurationBreakdown(long millis) {
|
||||
if(millis < 0) {
|
||||
throw new IllegalArgumentException("Duration must be greater than zero!");
|
||||
return Lang.JAILEDFOREVERSIGN.get();
|
||||
}
|
||||
|
||||
long days = TimeUnit.MILLISECONDS.toDays(millis);
|
||||
|
@ -69,7 +69,7 @@ language:
|
||||
provideajail: '&cPlease provide a jail to %0% &cthem to.'
|
||||
resistedarrestjailer: '&c%0% has resisted arrest thanks to having more health than you can jail at.'
|
||||
resistedarrestplayer: '&cYou have resisted arrest due to having more health than %0% can jail at.'
|
||||
status: "&2You have been jailed with a reason of '%0%' by %1% and have %2% minutes remaining (%3%)."
|
||||
status: "&2You have been jailed with a reason of '%0%' by %1% and have %2% minutes remaining (%3%&2)."
|
||||
suggestedcell: '&cAn empty cell in the same jail, %0%, was found: %1%'
|
||||
telein: "&9Teleported %0% to %1%'s teleport in location."
|
||||
teleout: "&9Teleported %0% to %1%'s teleport out location."
|
||||
|
@ -118,7 +118,7 @@ public class TestJailLanguage {
|
||||
assertEquals(colorize("&cPlease provide a jail to jail &cthem to."), Lang.PROVIDEAJAIL.get("jail"));
|
||||
assertEquals(colorize("&cgraywolf336 has resisted arrest thanks to having more health than you can jail at."), Lang.RESISTEDARRESTJAILER.get("graywolf336"));
|
||||
assertEquals(colorize("&cYou have resisted arrest due to having more health than graywolf336 can jail at."), Lang.RESISTEDARRESTPLAYER.get("graywolf336"));
|
||||
assertEquals(colorize("&2You have been jailed with a reason of 'terrible coding' by graywolf336 and have 60 minutes remaining (1h0m0s)."), Lang.STATUS.get(new String[] { "terrible coding", "graywolf336", "60", Util.getDurationBreakdown(3600000) }));
|
||||
assertEquals(colorize("&2You have been jailed with a reason of 'terrible coding' by graywolf336 and have 60 minutes remaining (1h0m0s&2)."), Lang.STATUS.get(new String[] { "terrible coding", "graywolf336", "60", Util.getDurationBreakdown(3600000) }));
|
||||
assertEquals(colorize("&cAn empty cell in the same jail, cloud, was found: cell_n02"), Lang.SUGGESTEDCELL.get(new String[] { "cloud", "cell_n02" }));
|
||||
assertEquals(colorize("&9Teleported graywolf336 to cloud's teleport in location."), Lang.TELEIN.get(new String[] { "graywolf336", "cloud" }));
|
||||
assertEquals(colorize("&9Teleported graywolf336 to cloud's teleport out location."), Lang.TELEOUT.get(new String[] { "graywolf336", "cloud" }));
|
||||
|
Loading…
Reference in New Issue
Block a user