Guest User

Untitled

a guest
Jul 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. package me.laxx_.plugins.purpletime;
  2.  
  3. import java.util.logging.Logger;
  4. import org.bukkit.Bukkit;
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. public class Purpletime extends JavaPlugin {
  11.     public final Logger logger = Logger.getLogger("Minecraft");
  12.     public static Purpletime plugin;
  13.    
  14.    
  15.     @Override
  16.     public void onDisable(){
  17.         this.logger.info("The event timer is diabled");
  18.     }
  19.    
  20.    
  21.     @Override
  22.     public void onEnable(){
  23.         this.logger.info("The event timer is running!");
  24.     }
  25.    
  26.    
  27.     public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,final String[] args) {
  28.     if (commandLabel.equalsIgnoreCase("run") && args.length == 3) {
  29.         this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
  30.             String portName = args[2];
  31.             String eventName = args[0];
  32.             int numMinutes = Integer.parseInt(args[1]);
  33.             int timer = Integer.parseInt(args[1]);
  34.            
  35.             @Override
  36.             public void run() {
  37.                 if(numMinutes != -1){
  38.                     if(timer != 0){
  39.                         Bukkit.broadcastMessage(ChatColor.GOLD + eventName + " is starting in " + numMinutes + " minutes /warp " + portName + " to join");
  40.                         timer--;
  41.                     }else{
  42.                         Bukkit.broadcastMessage(ChatColor.GOLD + "The warp is closed please standby");
  43.                     }
  44.                    
  45.                 }
  46.                
  47.             }
  48.            
  49.         }, 0L, 1200L);
  50.  
  51.     }
  52.     return false;
  53. }
Add Comment
Please, Sign In to add comment