Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.laxx_.plugins.purpletime;
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Purpletime extends JavaPlugin {
- public final Logger logger = Logger.getLogger("Minecraft");
- public static Purpletime plugin;
- @Override
- public void onDisable(){
- this.logger.info("The event timer is diabled");
- }
- @Override
- public void onEnable(){
- this.logger.info("The event timer is running!");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,final String[] args) {
- if (commandLabel.equalsIgnoreCase("run") && args.length == 3) {
- this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
- String portName = args[2];
- String eventName = args[0];
- int numMinutes = Integer.parseInt(args[1]);
- int timer = Integer.parseInt(args[1]);
- @Override
- public void run() {
- if(numMinutes != -1){
- if(timer != 0){
- Bukkit.broadcastMessage(ChatColor.GOLD + eventName + " is starting in " + numMinutes + " minutes /warp " + portName + " to join");
- timer--;
- }else{
- Bukkit.broadcastMessage(ChatColor.GOLD + "The warp is closed please standby");
- }
- }
- }
- }, 0L, 1200L);
- }
- return false;
- }
Add Comment
Please, Sign In to add comment