Examples of playerCanSpawnHereSafely()


Examples of com.onarandombox.MultiverseCore.api.BlockSafety.playerCanSpawnHereSafely()

    private Location readSpawnFromWorld(World w) {
        Location location = w.getSpawnLocation();
        // Set the worldspawn to our configspawn
        BlockSafety bs = this.plugin.getBlockSafety();
        // Verify that location was safe
        if (!bs.playerCanSpawnHereSafely(location)) {
            if (!this.getAdjustSpawn()) {
                this.plugin.log(Level.FINE, "Spawn location from world.dat file was unsafe!!");
                this.plugin.log(Level.FINE, "NOT adjusting spawn for '" + this.getAlias() + "' because you told me not to.");
                this.plugin.log(Level.FINE, "To turn on spawn adjustment for this world simply type:");
                this.plugin.log(Level.FINE, "/mvm set adjustspawn true " + this.getAlias());
View Full Code Here

Examples of com.onarandombox.MultiverseCore.api.BlockSafety.playerCanSpawnHereSafely()

            World w = p.getWorld();
            MultiverseWorld foundWorld = this.plugin.getMVWorldManager().getMVWorld(w.getName());
            if (foundWorld != null) {
                foundWorld.setSpawnLocation(p.getLocation());
                BlockSafety bs = this.plugin.getBlockSafety();
                if (!bs.playerCanSpawnHereSafely(p.getLocation()) && foundWorld.getAdjustSpawn()) {
                    sender.sendMessage("It looks like that location would normally be unsafe. But I trust you.");
                    sender.sendMessage("I'm turning off the Safe-T-Teleporter for spawns to this world.");
                    sender.sendMessage("If you want this turned back on just do:");
                    sender.sendMessage(ChatColor.AQUA + "/mvm set adjustspawn true " + foundWorld.getAlias());
                    foundWorld.setAdjustSpawn(false);
View Full Code Here

Examples of com.onarandombox.MultiverseCore.api.BlockSafety.playerCanSpawnHereSafely()

            if (newValue == null)
                throw new ChangeDeniedException();
            if (props.getAdjustSpawn()) {
                BlockSafety bs = plugin.getBlockSafety();
                // verify that the location is safe
                if (!bs.playerCanSpawnHereSafely(newValue)) {
                    // it's not ==> find a better one!
                    plugin.log(Level.WARNING, String.format("Somebody tried to set the spawn location for '%s' to an unsafe value! Adjusting...", getAlias()));
                    plugin.log(Level.WARNING, "Old Location: " + plugin.getLocationManipulation().strCoordsRaw(oldValue));
                    plugin.log(Level.WARNING, "New (unsafe) Location: " + plugin.getLocationManipulation().strCoordsRaw(newValue));
                    SafeTTeleporter teleporter = plugin.getSafeTTeleporter();
View Full Code Here

Examples of com.onarandombox.MultiverseCore.utils.BlockSafety.playerCanSpawnHereSafely()

     * @return
     */
    private double getMinimumWith2Air(int finalX, int finalZ, int y, int yMax, World w) {
        BlockSafety bs = new BlockSafety();
        for (int i = y; i < yMax; i++) {
            if (bs.playerCanSpawnHereSafely(w, finalX, i, finalZ)) {
                return i;
            }
        }
        return y;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.