Advertisement
Guest User

night.java

a guest
Jul 25th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package me.mcbukkitdev.EssentialsCmd;
  2.  
  3.  
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.World;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandExecutor;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10.  
  11. public class night implements CommandExecutor{
  12.     //Main Plugin
  13.     private main plugin;
  14.  
  15.     public night(main instance){
  16.         this.plugin = instance;
  17.     }
  18.  
  19.     //Strings
  20.     public static final String Prefix = ChatColor.GRAY + "[" + ChatColor.GOLD + "EssentialsCmd" + ChatColor.GRAY + "]";
  21.  
  22. //Commands
  23.  
  24.     public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
  25.         //Player --> Sender
  26.         Player p = (Player) sender;
  27.  
  28.         //Command: /night
  29.         if(cmd.getName().equalsIgnoreCase("night")) {
  30.             if (p.hasPermission("ecmd.night") || p.isOp() || p.hasPermission("ecmd.*")) {
  31.                 World world = p.getWorld();
  32.                 world.setTime(18000);
  33.                 p.sendMessage(Prefix + ChatColor.WHITE + " The Time changed to" + ChatColor.RED + " night " + ChatColor.WHITE + "in world " + ChatColor.RED + world.getName());
  34.             }
  35.         }
  36.         return true;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement