Package buscript.multiverse

Examples of buscript.multiverse.Buscript


        }
        this.stateFailure(player.getDisplayName(), d.getName());
    }

    boolean scriptPortal(Player player, MVDestination d, MVPortal portal, PortalPlayerSession ps) {
        Buscript buscript = plugin.getCore().getScriptAPI();
        File handlerScript = new File(buscript.getScriptFolder(), portal.getHandlerScript());
        if (handlerScript.exists()) {
            TravelAgent agent = new MVTravelAgent(this.plugin.getCore(), d, player);
            buscript.getGlobalScope().put("portal", buscript.getGlobalScope(), portal);
            buscript.getGlobalScope().put("player", buscript.getGlobalScope(), player);
            buscript.getGlobalScope().put("travelAgent", buscript.getGlobalScope(), agent);
            buscript.getGlobalScope().put("allowPortal", buscript.getGlobalScope(), true);
            buscript.getGlobalScope().put("portalSession", buscript.getGlobalScope(), ps);
            buscript.executeScript(handlerScript, player.getName());
            buscript.getGlobalScope().put("portal", buscript.getGlobalScope(), null);
            buscript.getGlobalScope().put("player", buscript.getGlobalScope(), null);
            buscript.getGlobalScope().put("travelAgent", buscript.getGlobalScope(), null);
            buscript.getGlobalScope().put("portalSession", buscript.getGlobalScope(), null);
            Object allowObject = buscript.getGlobalScope().get("allowPortal", buscript.getGlobalScope());
            buscript.getGlobalScope().put("allowPortal", buscript.getGlobalScope(), null);
            if (allowObject instanceof Boolean) {
                if (((Boolean) allowObject)) {
                    MVPortalEvent portalEvent = new MVPortalEvent(d, player, agent, portal);
                    this.plugin.getServer().getPluginManager().callEvent(portalEvent);
                    if (!portalEvent.isCancelled()) {
View Full Code Here


                return;
            }

            if (!getPreResetScript().isEmpty()) {
                // Execute pre reset script, if there is one
                Buscript buscript = plugin.getCore().getScriptAPI();
                File preResetScript = new File(buscript.getScriptFolder(), getPreResetScript());
                if (preResetScript.exists()) {
                    buscript.getGlobalScope().put("world", buscript.getGlobalScope(), getMVWorld());
                    buscript.registerStringReplacer(new ScriptWorldNameReplacer(getName()));
                    buscript.executeScript(preResetScript);
                    buscript.getGlobalScope().put("world", buscript.getGlobalScope(), null);
                } else {
                    plugin.log(Level.WARNING, "preresetscript for " + getName() + " does not exist!");
                }
            }
View Full Code Here

            // call the event
            plugin.getServer().getPluginManager().callEvent(new MVAResetFinishedEvent(name));

            if (!getPostResetScript().isEmpty()) {
                // Run post reset script, if exists
                Buscript buscript = plugin.getCore().getScriptAPI();
                File postResetScript = new File(buscript.getScriptFolder(), getPostResetScript());
                if (postResetScript.exists()) {
                    buscript.getGlobalScope().put("world", buscript.getGlobalScope(), world);
                    buscript.registerStringReplacer(new ScriptWorldNameReplacer(getName()));
                    buscript.executeScript(postResetScript);
                    buscript.getGlobalScope().put("world", buscript.getGlobalScope(), null);
                } else {
                    plugin.log(Level.WARNING, "postresetscript for " + getName() + " does not exist!");
                }
            }
        }
View Full Code Here

TOP

Related Classes of buscript.multiverse.Buscript

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.