Package com.sk89q.craftbook.access

Examples of com.sk89q.craftbook.access.WorldInterface


        main = craftBook;
    }

    synchronized void loadAll() throws IOException {

        WorldInterface world = main.getWorld();
        if (!main.pathToGlobalState.exists()) main.pathToGlobalState.mkdirs();
        if (!main.pathToWorldState.exists()) main.pathToGlobalState.mkdirs();
        for (String name : stateHolders.keySet()) {
            StateHolder h = stateHolders.get(name);
            DataInputStream in = null;
View Full Code Here


        }
    }

    synchronized void saveAll() throws IOException {

        WorldInterface world = main.getWorld();
        if (!main.pathToGlobalState.exists()) main.pathToGlobalState.mkdirs();
        if (!main.pathToWorldState.exists()) main.pathToGlobalState.mkdirs();
        for (String name : stateHolders.keySet()) {
            StateHolder h = stateHolders.get(name);
            DataOutputStream out = null;
View Full Code Here

     * @param chip
     */
    public void think(ChipState chip) {

        Configuration c = chip.getServer().getConfiguration();
        WorldInterface world = chip.getWorld();

        if (chip.getIn(1).is()) {
            String id = chip.getText().getLine3();
            String rider = chip.getText().getLine4();

            if (c.isValidMob(id)) {
                Vector pos = chip.getBlockPosition();
                int maxY = Math.min(128, pos.getBlockY() + 10);
                int x = pos.getBlockX();
                int z = pos.getBlockZ();

                for (int y = pos.getBlockY() + 1; y <= maxY; y++) {
                    if (BlockType.canPassThrough(world.getId(x, y, z))) {
                        if (rider.length() != 0 && c.isValidMob(rider)) {
                            world.spawnMob(x, y, z, id, rider);
                        } else {
                            world.spawnMob(x, y, z, id);
                        }
                        return;
                    }
                }
            }
View Full Code Here

TOP

Related Classes of com.sk89q.craftbook.access.WorldInterface

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.