1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00
Jobs/com/gamingmesh/jobs/stuff/PerformCommands.java
2016-03-30 16:42:36 +03:00

34 lines
874 B
Java

package com.gamingmesh.jobs.stuff;
import java.util.List;
import org.bukkit.Bukkit;
import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobsPlayer;
public class PerformCommands {
public static void PerformCommandsOnLeave(JobsPlayer jPlayer, Job job) {
List<String> cmds = job.getCmdOnLeave();
if (cmds.size() == 0)
return;
for (String one : cmds) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), one.replace("[name]", jPlayer.getUserName()).replace("[jobname]", job.getName()));
}
}
public static void PerformCommandsOnJoin(JobsPlayer jPlayer, Job job) {
List<String> cmds = job.getCmdOnJoin();
if (cmds.size() == 0)
return;
for (String one : cmds) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), one.replace("[name]", jPlayer.getUserName()).replace("[jobname]", job.getName()));
}
}
}