Advertisement
Guest User

hub.class

a guest
Dec 21st, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. public class Hub extends JavaPlugin{
  2.     Main plugin;
  3.     public Hub(Main plugin) {
  4.         this.plugin = plugin;
  5.     }
  6.    
  7.     static Plugin plug = Bukkit.getPluginManager().getPlugin("DemonicPVP");
  8.    
  9.     public boolean onCommand(CommandSender sender, Command cmd, String Label, String args[]) {
  10.         final Player p = (Player) sender;
  11.         if (cmd.getName().equalsIgnoreCase("hub")){
  12.         if (p.hasPermission("dpvp.hub")){
  13.             if (!p.hasPermission("dpvp.hub")){
  14.                 p.sendMessage(ChatColor.RED + "[DemonicPVP] You do not have access to that command!");
  15.             }
  16.             p.sendMessage(ChatColor.RED + "[DemonicPVP] " + ChatColor.YELLOW + "Teleportation commencing in 5 seconds!");
  17.             Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plug, new Runnable() {
  18.                 private Location hubloc;{
  19.                     World Spawn = Bukkit.getWorld("Spawn");
  20.                 this.hubloc = new Location(Spawn, 1604, 6, 1381);
  21.                 this.hubloc.setYaw(180);
  22.                 }
  23.                 @Override
  24.                 public void run() {
  25.                   p.teleport(this.hubloc);
  26.                   p.sendMessage(ChatColor.RED + "[DemonicPVP] " + ChatColor.YELLOW + "Teleported to hub!");
  27.         }
  28.     }
  29.             , 100L);
  30.             }
  31.         }
  32.         return false;
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement