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:
commit
45877b3602
@ -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;
|
||||
}
|
||||
|
@ -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<>();
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user