Package org.bukkit

Examples of org.bukkit.World


        string = string.replace("w@", "");

        ////////
        // Match world name

        World returnable = null;

        for (World world : Bukkit.getWorlds())
            if (world.getName().equalsIgnoreCase(string))
                returnable = world;

        if (returnable != null) {
            if (worlds.containsKey(returnable.getName()))
                return worlds.get(returnable.getName());
            else return new dWorld(returnable);
        }
        else dB.echoError("Invalid World! '" + string
                + "' could not be found.");
View Full Code Here


    public static boolean matches(String arg) {

        arg = arg.replace("w@", "");

        World returnable = null;

        for (World world : Bukkit.getWorlds())
            if (world.getName().equalsIgnoreCase(arg))
                returnable = world;
View Full Code Here

    void handleLocation(dLocation location, int index, List<dMaterial> materialList, boolean doPhysics,
                        boolean isNatural, int radius, int height, int depth) {

        dMaterial material = materialList.get(index % materialList.size());
        index++;
        World world = location.getWorld();

        location.setX(location.getBlockX());
        location.setY(location.getBlockY());
        location.setZ(location.getBlockZ());
        setBlock(location, material, doPhysics, isNatural);
View Full Code Here

    }

    // Break off this portion of the code from execute() so it can be used in both execute and the delayed runnable
    public void switchBlock(ScriptEntry scriptEntry, Location interactLocation, SwitchState switchState, Player player) {
        World world = interactLocation.getWorld();
        boolean currentState = (interactLocation.getBlock().getData() & 0x8) > 0;
        String state = switchState.toString();

        // Try for a linked player
        CraftPlayer craftPlayer = (CraftPlayer) player;
View Full Code Here

        Element group = scriptEntry.getElement("group");

        // Report to dB
        dB.report(scriptEntry, getName(), action.debug() + (world != null ? world.debug(): "") + group.debug());

        World bukkitWorld = null;
        if (world != null)
            bukkitWorld = world.getWorld();

        OfflinePlayer player = ((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getOfflinePlayer();
        boolean inGroup = Depends.permissions.playerInGroup((bukkitWorld == null ? null: bukkitWorld.getName()), player, group.asString());

        switch (Action.valueOf(action.asString().toUpperCase())) {
            case ADD:
                if (inGroup)
                    dB.echoDebug(scriptEntry, "Player " + player.getName() + " is already in group " + group);
                else
                    Depends.permissions.playerAddGroup((bukkitWorld == null ? null: bukkitWorld.getName()), player, group.asString());
                return;
            case REMOVE:
                if (!inGroup)
                    dB.echoDebug(scriptEntry, "Player " + player.getName() + " is not in group " + group);
                else
                    Depends.permissions.playerRemoveGroup((bukkitWorld == null ? null: bukkitWorld.getName()), player, group.asString());
                return;
        }

    }
View Full Code Here

        // Report to dB
        dB.report(scriptEntry, getName(), action.debug() + permission.debug()
                + (group != null ? group.debug() : "") + (world != null ? world.debug(): ""));

        World bukkitWorld = null;
        if (world != null)
            bukkitWorld = world.getWorld();

        OfflinePlayer player = ((BukkitScriptEntryData)scriptEntry.entryData).hasPlayer() ? ((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getOfflinePlayer() : null;

        switch (Action.valueOf(action.asString().toUpperCase())) {
            case ADD:
                if (group != null) {
                    if (Depends.permissions.groupHas(bukkitWorld, group.asString(), permission.asString()))
                        dB.echoDebug(scriptEntry, "Group " + group + " already has permission " + permission);
                    else
                        Depends.permissions.groupAdd(bukkitWorld, group.asString(), permission.asString());
                } else {
                    if(Depends.permissions.playerHas(bukkitWorld == null ? null: bukkitWorld.getName(), player, permission.asString()))
                        dB.echoDebug(scriptEntry, "Player " + player.getName() + " already has permission " + permission);
                    else
                        Depends.permissions.playerAdd(bukkitWorld == null ? null: bukkitWorld.getName(), player, permission.asString());
                }
                return;
            case REMOVE:
                if (group != null) {
                    if(!Depends.permissions.groupHas(bukkitWorld, group.asString(), permission.asString()))
                        dB.echoDebug(scriptEntry, "Group " + group + " does not have access to permission " + permission);
                    else
                        Depends.permissions.groupRemove(bukkitWorld, group.asString(), permission.asString());
                } else {
                    if(!Depends.permissions.playerHas(bukkitWorld == null ? null: bukkitWorld.getName(), player, permission.asString()))
                        dB.echoDebug(scriptEntry, "Player " + player.getName() + " does not have access to permission " + permission);
                    else
                        Depends.permissions.playerRemove(bukkitWorld == null ? null: bukkitWorld.getName(), player, permission.asString());
                }
                return;
        }
    }
View Full Code Here

        if (nameNotSafe(permission)) {
            return false;
        }

        String name = player.getName();
        World world = worldName != null ? server.getWorld(worldName) : player.getPlayer().getWorld();

        AnjoPermissionsHandler permissionHandler = getPermissionHandler(world);
        return permissionHandler != null && permissionHandler.permission(name, permission);
    }
View Full Code Here

        this.worldRef = new WeakReference<World>(world);
    }

    @Override
    public List<com.sk89q.worldedit.entity.Entity> getEntities(Region region) {
        World world = getWorld();

        List<com.sk89q.worldedit.entity.Entity> entities = new ArrayList<com.sk89q.worldedit.entity.Entity>();
        for (Vector2D pt : region.getChunks()) {
            if (!world.isChunkLoaded(pt.getBlockX(), pt.getBlockZ())) {
                continue;
            }

            final Entity[] ents = world.getChunkAt(pt.getBlockX(), pt.getBlockZ()).getEntities();
            for (Entity ent : ents) {
                if (region.contains(BukkitUtil.toVector(ent.getLocation()))) {
                    entities.add(BukkitAdapter.adapt(ent));
                }
            }
View Full Code Here

     * Get the world handle.
     *
     * @return the world
     */
    protected World getWorldChecked() throws WorldEditException {
        World world = worldRef.get();
        if (world == null) {
            throw new WorldUnloadedException();
        }
        return world;
    }
View Full Code Here

        return treeTypeMapping.get(type);
    }

    @Override
    public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector pt) {
        World world = getWorld();
        TreeType bukkitType = toBukkitTreeType(type);
        return type != null && world.generateTree(BukkitUtil.toLocation(world, pt), bukkitType,
                new EditSessionBlockChangeDelegate(editSession));
    }
View Full Code Here

TOP

Related Classes of org.bukkit.World

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.