mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-20 07:01:22 +01:00
NPE
This commit is contained in:
parent
9dfa9177d1
commit
4af999b7cc
@ -111,10 +111,10 @@ public class JobsListener implements Listener {
|
||||
return;
|
||||
|
||||
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.performCommand(msg + event.getMessage());
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
player.performCommand(msg + event.getMessage());
|
||||
}
|
||||
});
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -575,11 +575,12 @@ public class JobsListener implements Listener {
|
||||
String format = event.getFormat();
|
||||
|
||||
// check if the player is in the job
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
if (jPlayer != null)
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
if (!jPlayer.isInJob(job))
|
||||
format = format.replace("%1$s", "");
|
||||
format = format.replace("%1$s", "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
format = format.replace("%1$s", honorific + "%1$s");
|
||||
event.setFormat(format);
|
||||
@ -598,11 +599,12 @@ public class JobsListener implements Listener {
|
||||
honorific = "";
|
||||
String format = event.getFormat();
|
||||
// check if the player is in the job
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
if (jPlayer != null)
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
if (!jPlayer.isInJob(job))
|
||||
format = format.replace("{jobs}", "");
|
||||
format = format.replace("{jobs}", "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!format.contains("{jobs}"))
|
||||
return;
|
||||
format = format.replace("{jobs}", honorific);
|
||||
@ -622,11 +624,12 @@ public class JobsListener implements Listener {
|
||||
honorific = "";
|
||||
String format = event.getFormat();
|
||||
// check if the player is in the job
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
if (jPlayer != null)
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
if (!jPlayer.isInJob(job))
|
||||
format = format.replace("{jobs}", "");
|
||||
format = format.replace("{jobs}", "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!format.contains("{jobs}"))
|
||||
return;
|
||||
format = format.replace("{jobs}", honorific);
|
||||
|
Loading…
Reference in New Issue
Block a user