mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-18 05:11:32 +01:00
Fix signs not work properly so it not updated at placing a sign, #356
This commit is contained in:
parent
78ff26d124
commit
a7f9b0d99e
@ -108,13 +108,13 @@ public class SignUtil {
|
||||
|
||||
List<TopList> PlayerList = new ArrayList<>();
|
||||
|
||||
if (JobName.equalsIgnoreCase("gtoplist"))
|
||||
if (JobName.contains("gtoplist"))
|
||||
PlayerList = Jobs.getJobsDAO().getGlobalTopList(0);
|
||||
|
||||
for (com.gamingmesh.jobs.Signs.Sign one : new ArrayList<>(Signs.GetAllSigns())) {
|
||||
String SignJobName = one.GetJobName();
|
||||
|
||||
if (!JobName.equalsIgnoreCase(SignJobName))
|
||||
if (!JobName.contains(SignJobName))
|
||||
continue;
|
||||
|
||||
World world = Bukkit.getWorld(one.GetWorld());
|
||||
@ -126,7 +126,7 @@ public class SignUtil {
|
||||
double SignsZ = one.GetZ();
|
||||
int number = one.GetNumber() - 1;
|
||||
|
||||
if (!JobName.equalsIgnoreCase("gtoplist"))
|
||||
if (!JobName.contains("gtoplist"))
|
||||
PlayerList = Jobs.getJobsDAO().toplist(SignJobName, number);
|
||||
|
||||
if (PlayerList.isEmpty())
|
||||
|
@ -448,7 +448,7 @@ public class JobsListener implements Listener {
|
||||
if (!ChatColor.stripColor(event.getLine(0)).equalsIgnoreCase("[Jobs]"))
|
||||
return;
|
||||
|
||||
if (!signtype.equalsIgnoreCase("toplist") && !signtype.equalsIgnoreCase("gtoplist"))
|
||||
if (!(signtype.contains("toplist") || signtype.contains("gtoplist")))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
@ -466,7 +466,7 @@ public class JobsListener implements Listener {
|
||||
|
||||
final Job job = Jobs.getJob(jobname);
|
||||
|
||||
if (job == null && !signtype.equalsIgnoreCase("gtoplist")) {
|
||||
if (job == null && !signtype.contains("gtoplist")) {
|
||||
player.sendMessage(Jobs.getLanguage().getMessage("command.top.error.nojob"));
|
||||
return;
|
||||
}
|
||||
@ -499,7 +499,7 @@ public class JobsListener implements Listener {
|
||||
signInfo.setY(loc.getY());
|
||||
signInfo.setZ(loc.getZ());
|
||||
signInfo.setCategory(category);
|
||||
if (!signtype.equalsIgnoreCase("gtoplist") && job != null)
|
||||
if (!signtype.contains("gtoplist") && job != null)
|
||||
signInfo.setJobName(job.getName());
|
||||
else
|
||||
signInfo.setJobName("gtoplist");
|
||||
@ -512,7 +512,7 @@ public class JobsListener implements Listener {
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!signtype.equalsIgnoreCase("gtoplist") && job != null)
|
||||
if (!signtype.contains("gtoplist") && job != null)
|
||||
Jobs.getSignUtil().SignUpdate(job.getName());
|
||||
else
|
||||
Jobs.getSignUtil().SignUpdate("gtoplist");
|
||||
|
Loading…
Reference in New Issue
Block a user