Package com.sk89q.craftbook.access

Examples of com.sk89q.craftbook.access.Configuration


     *
     * @return
     */
    public String validateEnvironment(ServerInterface i, WorldInterface world, Vector pos, SignText sign) {

        Configuration c = i.getConfiguration();

        String id = sign.getLine3();
        String rider = sign.getLine4();

        if (id.length() == 0) {
            return "Specify a mob type on the third line.";
        } else if (!c.isValidMob(id)) {
            return "Not a valid mob type: " + id + ".";
        } else if (rider.length() != 0 && !c.isValidMob(rider)) {
            return "Not a valid rider type: " + rider + ".";
        }

        return 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.Configuration

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.