2016-03-30 15:42:36 +02:00
|
|
|
package com.gamingmesh.jobs.commands.list;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
|
|
|
import com.gamingmesh.jobs.Jobs;
|
|
|
|
import com.gamingmesh.jobs.commands.Cmd;
|
|
|
|
import com.gamingmesh.jobs.commands.JobCommand;
|
|
|
|
import com.gamingmesh.jobs.container.Job;
|
|
|
|
import com.gamingmesh.jobs.stuff.ChatColor;
|
|
|
|
|
|
|
|
public class signupdate implements Cmd {
|
|
|
|
|
2016-06-25 17:56:59 +02:00
|
|
|
@Override
|
2016-03-30 15:42:36 +02:00
|
|
|
@JobCommand(2700)
|
2016-08-08 16:36:56 +02:00
|
|
|
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
|
2016-03-30 15:42:36 +02:00
|
|
|
if (args.length != 1) {
|
|
|
|
Jobs.getCommandManager().sendUsage(sender, "signupdate");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Job oldjob = Jobs.getJob(args[0]);
|
|
|
|
|
|
|
|
if (oldjob == null && !args[0].equalsIgnoreCase("gtoplist")) {
|
|
|
|
sender.sendMessage(ChatColor.RED + Jobs.getLanguage().getMessage("general.error.job"));
|
|
|
|
return true;
|
|
|
|
}
|
2016-06-25 17:56:59 +02:00
|
|
|
if (!args[0].equalsIgnoreCase("gtoplist") && oldjob != null)
|
2016-03-30 15:42:36 +02:00
|
|
|
Jobs.getSignUtil().SignUpdate(oldjob.getName());
|
|
|
|
else
|
|
|
|
Jobs.getSignUtil().SignUpdate("gtoplist");
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|