Package com.onarandombox.MultiverseCore.api

Examples of com.onarandombox.MultiverseCore.api.Core


    @Test
    public void testEnableDebugMode() {
        // Pull a core instance from the server.
        Plugin plugin = mockServer.getPluginManager().getPlugin("Multiverse-Core");
        Core core = (Core) plugin;

        // Make sure Core is not null
        assertNotNull(plugin);

        // Make sure Core is enabled
        assertTrue(plugin.isEnabled());

        // Make a fake server folder to fool MV into thinking a world folder exists.
        File serverDirectory = new File(creator.getCore().getServerFolder(), "world");
        serverDirectory.mkdirs();

        // Initialize a fake command
        Command mockCommand = mock(Command.class);
        when(mockCommand.getName()).thenReturn("mv");

        // Assert debug mode is off
        Assert.assertEquals(0, core.getMVConfig().getGlobalDebug());

        // Send the debug command.
        String[] debugArgs = new String[] { "debug", "3" };
        plugin.onCommand(mockCommandSender, mockCommand, "", debugArgs);

        Assert.assertEquals(3, core.getMVConfig().getGlobalDebug());
    }
View Full Code Here


     */
    @Override
    public void setDestination(JavaPlugin plugin, String destination) {
        // TODO Taking a JavaPlugin here is rather useless, if we keep casting it up to MultiverseCore.
        // We should change that.
        Core core = (Core) plugin;
        String[] items = destination.split(":");
        if (items.length > 3) {
            isValid = false;
            return;
        }
        if (items.length == 1 && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[0])) {
            isValid = true;
            this.world = core.getMVWorldManager().getMVWorld(items[0]);
            return;
        }
        if (items.length == 2 && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[0])) {
            this.world = core.getMVWorldManager().getMVWorld(items[0]);
            this.yaw = core.getLocationManipulation().getYaw(items[1]);
            return;
        }
        if (items[0].equalsIgnoreCase("w") && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[1])) {
            this.world = ((MultiverseCore) plugin).getMVWorldManager().getMVWorld(items[1]);
            isValid = true;
            if (items.length == 3) {
                this.yaw = core.getLocationManipulation().getYaw(items[2]);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.onarandombox.MultiverseCore.api.Core

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.