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;
|
return;
|
||||||
|
|
||||||
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
player.performCommand(msg + event.getMessage());
|
player.performCommand(msg + event.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -575,11 +575,12 @@ public class JobsListener implements Listener {
|
|||||||
String format = event.getFormat();
|
String format = event.getFormat();
|
||||||
|
|
||||||
// check if the player is in the job
|
// 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))
|
if (!jPlayer.isInJob(job))
|
||||||
format = format.replace("%1$s", "");
|
format = format.replace("%1$s", "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
format = format.replace("%1$s", honorific + "%1$s");
|
format = format.replace("%1$s", honorific + "%1$s");
|
||||||
event.setFormat(format);
|
event.setFormat(format);
|
||||||
@ -598,11 +599,12 @@ public class JobsListener implements Listener {
|
|||||||
honorific = "";
|
honorific = "";
|
||||||
String format = event.getFormat();
|
String format = event.getFormat();
|
||||||
// check if the player is in the job
|
// 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))
|
if (!jPlayer.isInJob(job))
|
||||||
format = format.replace("{jobs}", "");
|
format = format.replace("{jobs}", "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!format.contains("{jobs}"))
|
if (!format.contains("{jobs}"))
|
||||||
return;
|
return;
|
||||||
format = format.replace("{jobs}", honorific);
|
format = format.replace("{jobs}", honorific);
|
||||||
@ -622,11 +624,12 @@ public class JobsListener implements Listener {
|
|||||||
honorific = "";
|
honorific = "";
|
||||||
String format = event.getFormat();
|
String format = event.getFormat();
|
||||||
// check if the player is in the job
|
// 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))
|
if (!jPlayer.isInJob(job))
|
||||||
format = format.replace("{jobs}", "");
|
format = format.replace("{jobs}", "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!format.contains("{jobs}"))
|
if (!format.contains("{jobs}"))
|
||||||
return;
|
return;
|
||||||
format = format.replace("{jobs}", honorific);
|
format = format.replace("{jobs}", honorific);
|
||||||
|
Loading…
Reference in New Issue
Block a user