1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 04:25:15 +01:00

Ok, job name is its identification, we HAVE to return jobs key name and

not full name which can be different
This commit is contained in:
Zrips 2021-05-07 15:24:34 +03:00
parent 04b426c806
commit 7ba66de4fe
3 changed files with 8 additions and 13 deletions

View File

@ -477,7 +477,7 @@ public class Jobs extends JavaPlugin {
for (Job job : jobs) {
if (job.getName().equalsIgnoreCase(jobName))
return job;
if (job.getJobKeyName().equalsIgnoreCase(jobName))
if (job.getJobFullName().equalsIgnoreCase(jobName))
return job;
}
return null;

View File

@ -217,7 +217,7 @@ public class editquests implements Cmd {
}
org.bukkit.configuration.file.YamlConfiguration file = Jobs.getConfigManager().getJobConfig();
String j = "Jobs." + job.getJobKeyName() + ".Quests." + q.getConfigName() + ".";
String j = "Jobs." + job.getName() + ".Quests." + q.getConfigName() + ".";
if (file.isString(j + "Target")) {
Jobs.getConfigManager().changeJobsSettings(args[1], file.getString(j + "Target"), target);
@ -556,7 +556,7 @@ public class editquests implements Cmd {
player.performCommand("jobs editquests list " + job.getName() + " " + actionT.getName() + " " + q.getConfigName() + " 1");
org.bukkit.configuration.file.YamlConfiguration file = Jobs.getConfigManager().getJobConfig();
String j = "Jobs." + job.getJobKeyName() + ".Quests." + q.getConfigName() + ".";
String j = "Jobs." + job.getName() + ".Quests." + q.getConfigName() + ".";
if (file.isString(j + "Target")) {
Jobs.getConfigManager().changeJobsSettings(args[1], file.getString(j + "Target"), (type + subType).toLowerCase());

View File

@ -333,7 +333,7 @@ public class Job {
* @return the full job name
*/
public String getName() {
return fullName;
return jobName;
}
/**
@ -347,15 +347,6 @@ public class Job {
return jobColour + fullName;
}
/**
* Returns the job name retrieved from the config
*
* @return the job key name from config section
*/
public String getJobKeyName() {
return jobName;
}
/**
* Get the shortened version of the jobName
*
@ -684,6 +675,10 @@ public class Job {
return obj instanceof Job && isSame((Job) obj);
}
public String getJobFullName() {
return fullName;
}
public String getJobDisplayName() {
return jobDisplayName == null ? jobColour + fullName : jobDisplayName;
}