@@ -0,0 +1,2203 @@
+package me.stefvanschie.buildinggame.commands.subcommands;%0A%0Aimport org.bukkit.ChatColor;%0Aimport org.bukkit.configuration.file.YamlConfiguration;%0Aimport org.bukkit.entity.Player;%0A%0Aimport me.stefvanschie.buildinggame.commands.commandutils.CommandResult;%0Aimport me.stefvanschie.buildinggame.commands.commandutils.SubCommand;%0Aimport me.stefvanschie.buildinggame.managers.arenas.ArenaManager;%0Aimport me.stefvanschie.buildinggame.managers.arenas.ArenaModeManager;%0Aimport me.stefvanschie.buildinggame.managers.files.SettingsManager;%0Aimport me.stefvanschie.buildinggame.managers.messages.MessageManager;%0Aimport me.stefvanschie.buildinggame.utils.arena.Arena;%0Aimport me.stefvanschie.buildinggame.utils.arena.ArenaMode;%0A%0Apublic class SetGameMode extends SubCommand %7B%0A%0A%09@Override%0A%09public CommandResult onCommand(Player player, String%5B%5D args) %7B%0A%09%09YamlConfiguration arenas = SettingsManager.getInstance().getArenas();%0A%09%09%0A%09%09if (args.length %3C 1) %7B%0A%09%09%09MessageManager.getInstance().send(player, ChatColor.RED + %22Please specify the arena and gamemode%22);%0A%09%09%09return CommandResult.ARGUMENTEXCEPTION;%0A%09%09%7D%0A%09%09%0A%09%09Arena arena = ArenaManager.getInstance().getArena(args%5B0%5D);%0A%09%09%0A%09%09if (arena == null) %7B%0A%09%09%09MessageManager.getInstance().send(player, ChatColor.RED + %22'%22 + args%5B0%5D + %22' isn't a valid arena%22);%0A%09%09%09return CommandResult.ERROR;%0A%09%09%7D%0A%09%09%0A%09%09ArenaMode mode;%0A%09%09try %7B%0A%09%09%09mode = ArenaMode.valueOf(args%5B1%5D.toUpperCase());%0A%09%09%7D catch (IllegalArgumentException e) %7B%0A%09%09%09MessageManager.getInstance().send(player, ChatColor.RED + %22'%22 + args%5B1%5D + %22' isn't a valid gamemode%22);%0A%09%09%09return CommandResult.ERROR;%0A%09%09%7D%0A%09%09%0A%09%09arenas.set(arena.getName() + %22.mode%22, mode.toString());%0A%09%09SettingsManager.getInstance().save();%0A%09%09%0A%09%09ArenaModeManager.getInstance().setup();%0A%09%09%0A%09%09MessageManager.getInstance().send(player, ChatColor.GREEN + %22Succesgully changed gamemode of arena %22 + arena.getName() + %22 to %22 + mode.toString());;%0A%09%09%0A%09%09return CommandResult.SUCCES;%0A%09%7D%0A%0A%09@Override%0A%09public String getName() %7B%0A%09%09return %22setgamemode%22;%0A%09%7D%0A%0A%09@Override%0A%09public String%5B%5D getAliases() %7B%0A%09%09return null;%0A%09%7D%0A%0A%09@Override%0A%09public String getInfo() %7B%0A%09%09return %22Set the game mode of an arena%22;%0A%09%7D%0A%0A%09@Override%0A%09public String getPermission() %7B%0A%09%09return %22bg.setgamemode%22;%0A%09%7D%0A%09%0A%7D%0A

Create SetGameMode.java