Guest User

Untitled

a guest
Aug 29th, 2019
100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package bttg.WackyUHC;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Location;
  5. import org.bukkit.World;
  6. import org.bukkit.WorldCreator;
  7. import org.bukkit.command.Command;
  8. import org.bukkit.command.CommandExecutor;
  9. import org.bukkit.command.CommandSender;
  10. import org.bukkit.entity.Player;
  11.  
  12. import net.md_5.bungee.api.ChatColor;
  13.  
  14. public class CommandGame implements CommandExecutor {
  15.  
  16. Main plugin;
  17.  
  18. public CommandGame(Main plugin) {
  19. this.plugin = plugin;
  20. }
  21.  
  22. @Override
  23. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  24.  
  25. if (sender instanceof Player) {
  26. Player player = (Player) sender;
  27.  
  28. if (player.isOp()) {
  29.  
  30. if (args.length == 1) {
  31.  
  32. switch (args[0]) {
  33. case "start":
  34. Bukkit.broadcastMessage(ChatColor.YELLOW + "Starting new game!");
  35.  
  36. WorldCreator c = new WorldCreator("NewWackyUHCWorld");
  37. c.environment(World.Environment.NORMAL);
  38. World world = c.createWorld();
  39.  
  40. for(Player p : plugin.getServer().getOnlinePlayers()) {
  41. p.teleport(world.getSpawnLocation());
  42. }
  43.  
  44. break;
  45. default:
  46. break;
  47. }
  48. }
  49. }
  50. }
  51.  
  52. return true;
  53. }
  54. }
RAW Paste Data