1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +01:00

Jobs stats output message visual update

This commit is contained in:
Zrips 2024-04-20 13:22:54 +03:00
parent 700d2aacf0
commit bf047ce1f2
3 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>Jobs</groupId> <groupId>Jobs</groupId>
<artifactId>jobs</artifactId> <artifactId>jobs</artifactId>
<version>5.2.2.4</version> <version>5.2.2.5</version>
<name>Jobs</name> <name>Jobs</name>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>

View File

@ -437,7 +437,7 @@ public class JobsCommands implements CommandExecutor {
public String jobStatsMessage(JobProgression jobProg, JobsPlayer jPlayer, boolean progressBar) { public String jobStatsMessage(JobProgression jobProg, JobsPlayer jPlayer, boolean progressBar) {
boolean isMaxLevelReached = jobProg.getLevel() >= (jPlayer == null ? jobProg.getJob().getMaxLevel() : jPlayer.getMaxJobLevelAllowed(jobProg.getJob())); boolean isMaxLevelReached = jobProg.getLevel() >= (jPlayer == null ? jobProg.getJob().getMaxLevel() : jPlayer.getMaxJobLevelAllowed(jobProg.getJob()));
String path = "command.stats.output." + (isMaxLevelReached ? "max-level" : "message"); String path = "command.stats.output." + (isMaxLevelReached ? "maxLevel" : "Level");
Title title = Jobs.getTitleManager().getTitle(jobProg.getLevel(), jobProg.getJob().getName()); Title title = Jobs.getTitleManager().getTitle(jobProg.getLevel(), jobProg.getJob().getName());
String message = Jobs.getLanguage().getMessage(path, String message = Jobs.getLanguage().getMessage(path,
@ -462,14 +462,14 @@ public class JobsCommands implements CommandExecutor {
StringBuilder message = new StringBuilder(); StringBuilder message = new StringBuilder();
int percentage = (int) ((current * 50.0) / max); int percentage = (int) ((current * 50.0) / max);
for (int i = 0; i < percentage; i++) { for (int i = 0; i < percentage; i++) {
message.append(Jobs.getLanguage().getMessage("command.stats.bar2")); message.append(Jobs.getLanguage().getMessage("command.stats.barFull"));
} }
if (50 - percentage < 0) if (50 - percentage < 0)
percentage = 50; percentage = 50;
for (int i = 0; i < 50 - percentage; i++) { for (int i = 0; i < 50 - percentage; i++) {
message.append(Jobs.getLanguage().getMessage("command.stats.bar1")); message.append(Jobs.getLanguage().getMessage("command.stats.barEmpty"));
} }
return message.toString(); return message.toString();
} }

View File

@ -296,12 +296,12 @@ public class LanguageManager {
c.get("command.stats.help.args", "[playername]"); c.get("command.stats.help.args", "[playername]");
Jobs.getGCManager().getCommandArgs().put("stats", Arrays.asList("[playername]")); Jobs.getGCManager().getCommandArgs().put("stats", Arrays.asList("[playername]"));
c.get("command.stats.error.nojob", "Please join a job first."); c.get("command.stats.error.nojob", "Please join a job first.");
c.get("command.stats.output.message", "Level %joblevel% for %jobname%: %jobxp%/%jobmaxxp% xp"); c.get("command.stats.output.Level", "&7Level &f%joblevel% &7for &f%jobname%&7: &f%jobxp%&7/&f%jobmaxxp%&7xp");
c.get("command.stats.output.max-level", " &cMax level - %jobname%"); c.get("command.stats.output.maxLevel", " &2Max &7Level &f%joblevel% &7for &f%jobname%");
c.get("command.stats.bossBarOutput", "Lvl %joblevel% %jobname%: %jobxp%/%jobmaxxp% xp%gain%"); c.get("command.stats.bossBarOutput", "Lvl %joblevel% %jobname%: %jobxp%/%jobmaxxp% xp%gain%");
c.get("command.stats.bossBarGain", " &7(&f%gain%&7)"); c.get("command.stats.bossBarGain", " &7(&f%gain%&7)");
c.get("command.stats.bar1", "&e\u258F"); c.get("command.stats.barEmpty", "&7\u258F");
c.get("command.stats.bar2", "&2\u258F"); c.get("command.stats.barFull", "&2\u258F");
c.get("command.shop.help.info", "Opens special jobs shop."); c.get("command.shop.help.info", "Opens special jobs shop.");
c.get("command.shop.help.args", ""); c.get("command.shop.help.args", "");