1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-16 13:11:19 +01:00

Jobs info considering archived jobs

This commit is contained in:
Zrips 2023-01-06 15:08:33 +02:00
parent 2dc25b232d
commit e6c476f756
2 changed files with 12 additions and 7 deletions

View File

@ -37,8 +37,8 @@ public class PermissionManager {
private final Map<String, Integer> permDelay = new HashMap<>(); private final Map<String, Integer> permDelay = new HashMap<>();
private enum prm { private enum prm {
jobs_use(remade("jobs.use"), 2), jobs_use(remade("jobs.use"), 5),
jobs_paycreative(remade("jobs.paycreative"), 2), jobs_paycreative(remade("jobs.paycreative"), 5),
jobs_boost_JOBNAME_money_AMOUNT(remade("jobs.boost.%JOBNAME%.money.%AMOUNT%"), 60), jobs_boost_JOBNAME_money_AMOUNT(remade("jobs.boost.%JOBNAME%.money.%AMOUNT%"), 60),
jobs_boost_JOBNAME_exp_AMOUNT(remade("jobs.boost.%JOBNAME%.exp.%AMOUNT%"), 60), jobs_boost_JOBNAME_exp_AMOUNT(remade("jobs.boost.%JOBNAME%.exp.%AMOUNT%"), 60),
jobs_boost_JOBNAME_points_AMOUNT(remade("jobs.boost.%JOBNAME%.points.%AMOUNT%"), 60), jobs_boost_JOBNAME_points_AMOUNT(remade("jobs.boost.%JOBNAME%.points.%AMOUNT%"), 60),
@ -49,10 +49,10 @@ public class PermissionManager {
jobs_boost_all_all_AMOUNT(remade("jobs.boost.all.all.%AMOUNT%"), 60), jobs_boost_all_all_AMOUNT(remade("jobs.boost.all.all.%AMOUNT%"), 60),
jobs_spawner_AMOUNT(remade("jobs.nearspawner.%AMOUNT%"), 60), jobs_spawner_AMOUNT(remade("jobs.nearspawner.%AMOUNT%"), 60),
jobs_petpay_AMOUNT(remade("jobs.petpay.%AMOUNT%"), 60), jobs_petpay_AMOUNT(remade("jobs.petpay.%AMOUNT%"), 60),
jobs_maxfurnaces_AMOUNT(remade("jobs.maxfurnaces.%AMOUNT%"), 2), jobs_maxfurnaces_AMOUNT(remade("jobs.maxfurnaces.%AMOUNT%"), 30),
jobs_maxblastfurnaces_AMOUNT(remade("jobs.maxblastfurnaces.%AMOUNT%"), 2), jobs_maxblastfurnaces_AMOUNT(remade("jobs.maxblastfurnaces.%AMOUNT%"), 30),
jobs_maxsmokers_AMOUNT(remade("jobs.maxsmokers.%AMOUNT%"), 2), jobs_maxsmokers_AMOUNT(remade("jobs.maxsmokers.%AMOUNT%"), 30),
jobs_maxbrewingstands_AMOUNT(remade("jobs.maxbrewingstands.%AMOUNT%"), 2), jobs_maxbrewingstands_AMOUNT(remade("jobs.maxbrewingstands.%AMOUNT%"), 30),
jobs_world_WORLDNAME(remade("jobs.world.%WORLDNAME%"), 2); jobs_world_WORLDNAME(remade("jobs.world.%WORLDNAME%"), 2);
private int reload; private int reload;

View File

@ -52,7 +52,7 @@ public class JobsCommands implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
CMIDebug.d("jobs commands");
if (sender instanceof Player && !Jobs.getGCManager().canPerformActionInWorld(((Player) sender).getWorld()) if (sender instanceof Player && !Jobs.getGCManager().canPerformActionInWorld(((Player) sender).getWorld())
&& !sender.hasPermission("jobs.disabledworld.commands")) { && !sender.hasPermission("jobs.disabledworld.commands")) {
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.worldisdisabled")); sender.sendMessage(Jobs.getLanguage().getMessage("general.error.worldisdisabled"));
@ -356,6 +356,11 @@ public class JobsCommands implements CommandExecutor {
message.append(":\n"); message.append(":\n");
JobProgression prog = player.getJobProgression(job); JobProgression prog = player.getJobProgression(job);
if (prog == null) {
prog = player.getArchivedJobProgression(job);
}
int level = prog != null ? prog.getLevel() : 1; int level = prog != null ? prog.getLevel() : 1;
int numjobs = player.progression.size(); int numjobs = player.progression.size();