Package com.onarandombox.MultiversePortals.utils

Examples of com.onarandombox.MultiversePortals.utils.PortalManager


        if (event.isCancelled()) {
            this.plugin.log(Level.FINE, "This Portal event was already cancelled.");
            return;
        }
        this.plugin.log(Level.FINER, "onPlayerPortal called!");
        PortalManager pm = this.plugin.getPortalManager();
        Location playerPortalLoc = event.getPlayer().getLocation();
        // Determine if we're in a portal
        MVPortal portal = pm.getPortal(event.getPlayer(), playerPortalLoc);
        Player p = event.getPlayer();
        // Even if the location was null, we still have to see if
        // someone wasn't exactly on (because they can do this).
        if (portal == null) {
            // Check around the player to make sure
            playerPortalLoc = this.plugin.getCore().getSafeTTeleporter().findPortalBlockNextTo(event.getFrom());
            if (playerPortalLoc != null) {
                this.plugin.log(Level.FINER, "Player was outside of portal, The location has been successfully translated.");
                portal = pm.getPortal(event.getPlayer(), playerPortalLoc);
            }
        }
        if (portal != null) {
            this.plugin.log(Level.FINER, "There was a portal found!");
            MVDestination portalDest = portal.getDestination();
View Full Code Here


    public void blockPhysics(BlockPhysicsEvent event) {
        if (event.isCancelled()) {
            return;
        }
        if (event.getChangedType() == Material.PORTAL || event.getBlock().getType() == Material.PORTAL) {
            PortalManager pm = this.plugin.getPortalManager();
            if (pm.isPortal(event.getBlock().getLocation())) {
                event.setCancelled(true);
            }
        }
    }
View Full Code Here

        this.registerCommands();

        // Ensure permissions are created
        this.createDefaultPerms();

        this.portalManager = new PortalManager(this);
        this.portalSessions = new HashMap<String, PortalPlayerSession>();
        this.getCore().getDestFactory().registerDestinationType(PortalDestination.class, "p");
        this.getCore().getDestFactory().registerDestinationType(RandomPortalDestination.class, "rp");

        this.loadPortals();
View Full Code Here

     * This method should be called every time a player teleports to a portal.
     *
     * @param location
     */
    public void playerDidTeleport(Location location) {
        PortalManager pm = this.plugin.getPortalManager();
        if (pm.getPortal(location) != null) {
            this.hasMovedOutOfPortal = false;
            return;
        }
        this.hasMovedOutOfPortal = true;
    }
View Full Code Here

TOP

Related Classes of com.onarandombox.MultiversePortals.utils.PortalManager

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.