Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Hub extends JavaPlugin{
- Main plugin;
- public Hub(Main plugin) {
- this.plugin = plugin;
- }
- static Plugin plug = Bukkit.getPluginManager().getPlugin("DemonicPVP");
- public boolean onCommand(CommandSender sender, Command cmd, String Label, String args[]) {
- final Player p = (Player) sender;
- if (cmd.getName().equalsIgnoreCase("hub")){
- if (p.hasPermission("dpvp.hub")){
- if (!p.hasPermission("dpvp.hub")){
- p.sendMessage(ChatColor.RED + "[DemonicPVP] You do not have access to that command!");
- }
- p.sendMessage(ChatColor.RED + "[DemonicPVP] " + ChatColor.YELLOW + "Teleportation commencing in 5 seconds!");
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plug, new Runnable() {
- private Location hubloc;{
- World Spawn = Bukkit.getWorld("Spawn");
- this.hubloc = new Location(Spawn, 1604, 6, 1381);
- this.hubloc.setYaw(180);
- }
- @Override
- public void run() {
- p.teleport(this.hubloc);
- p.sendMessage(ChatColor.RED + "[DemonicPVP] " + ChatColor.YELLOW + "Teleported to hub!");
- }
- }
- , 100L);
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement