mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
34 lines
874 B
Java
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()));
|
|
}
|
|
}
|
|
}
|