@@ -0,0 +1,1938 @@
+/*%0A * Copyright (c) 2016 MCPhoton %3Chttp://mcphoton.org%3E and contributors.%0A *%0A * This file is part of the Photon Server Implementation %3Chttps://github.com/mcphoton/Photon-Server%3E.%0A *%0A * The Photon Server Implementation is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * The Photon Server Implementation is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Apackage org.mcphoton.impl.command;%0A%0Aimport org.mcphoton.command.Command;%0Aimport org.mcphoton.impl.server.ConsoleThread;%0Aimport org.mcphoton.impl.server.Main;%0Aimport org.mcphoton.messaging.Messageable;%0Aimport org.mcphoton.world.World;%0A%0A/**%0A * Changes the world where the commands are executed. Similar to the %22cd%22 command, but for worlds.%0A *%0A * @author TheElectronWill%0A */%0Apublic class ChangeWorldCommand implements Command %7B%0A%0A%09private static final String%5B%5D ALIASES = %7B%22cw%22%7D;%0A%0A%09@Override%0A%09public void execute(Messageable source, String%5B%5D args) %7B%0A%09%09if (args.length != 1) %7B%0A%09%09%09source.sendMessage(%22Invalid syntax. Use cw %5Bworld%5D%22);%0A%09%09%09return;%0A%09%09%7D%0A%09%09World world = Main.serverInstance.getWorld(args%5B0%5D);%0A%09%09if (world == null) %7B%0A%09%09%09source.sendMessage(%22This world does not exist.%22);%0A%09%09%09return;%0A%09%09%7D%0A%09%09if (source instanceof ConsoleThread) %7B%0A%09%09%09Main.serverInstance.consoleThread.world = world;%0A%09%09%7D else %7B%0A%09%09%09//TODO ?%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public String getName() %7B%0A%09%09return %22change-world%22;%0A%09%7D%0A%0A%09@Override%0A%09public String%5B%5D getAliases() %7B%0A%09%09return ALIASES;%0A%09%7D%0A%0A%7D%0A

Add a "cw" command