1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-20 07:01:22 +01:00

Merge pull request #1169 from Zrips/ignore-job-max

Add ignore-job-max config section.
This commit is contained in:
LogGitDev 2021-05-05 11:14:55 +10:00 committed by GitHub
commit 45877b3602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -65,7 +65,7 @@ public class join implements Cmd {
return true;
}
if (!Jobs.getPlayerManager().getJobsLimit(jPlayer, (short) jPlayer.progression.size())) {
if (!job.isIgnoreMaxJobs() && !Jobs.getPlayerManager().getJobsLimit(jPlayer, (short) jPlayer.progression.size())) {
pSender.sendMessage(Jobs.getLanguage().getMessage("command.join.error.maxjobs"));
return true;
}

View File

@ -1148,6 +1148,7 @@ public class ConfigManager {
job.setBossbar(bossbar);
job.setRejoinCd(rejoinCd);
job.setMaxLevelCommands(jobSection.getStringList("commands-on-max-level"));
job.setIgnoreMaxJobs(jobSection.getBoolean("ignore-jobs-max"));
if (jobSection.isConfigurationSection("Quests")) {
List<Quest> quests = new ArrayList<>();

View File

@ -90,6 +90,7 @@ public class Job {
private final List<Quest> quests = new ArrayList<>();
private int maxDailyQuests = 1;
private int id = 0;
private boolean ignoreMaxJobs = false;
@Deprecated
public Job(String jobName, String fullName, String jobShortName, String description, CMIChatColor jobColour, Parser maxExpEquation, DisplayMethod displayMethod, int maxLevel,
@ -652,6 +653,14 @@ public class Job {
return ent != null && worldBlacklist.contains(ent.getWorld().getName());
}
public boolean isIgnoreMaxJobs() {
return ignoreMaxJobs;
}
public void setIgnoreMaxJobs(boolean ignoreMaxJobs) {
this.ignoreMaxJobs = ignoreMaxJobs;
}
@Override
public boolean equals(Object obj) {
return obj instanceof Job ? isSame((Job) obj) : false;

View File

@ -581,6 +581,9 @@ exampleJob:
- plotworld
- teamworld
# Allow a player to "/jobs join" this job even if they have the max jobs permission reached.
ignore-jobs-max: false
# Limit item use to jobs level
limitedItems:
# Just name, don't have any impact