1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 12:35:28 +01:00
Jobs/com/gamingmesh/jobs/stuff/PerformCommands.java
2015-08-21 16:10:08 +03:00

34 lines
895 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()));
}
}
}