Package com.sk89q.craftbook.util

Examples of com.sk89q.craftbook.util.ItemInfo


            } else {
                broken = bl.getRelative(0, 1, 0);
            }
        }

        if (broken == null || broken.getType() == Material.AIR || broken.getType() == Material.PISTON_MOVING_PIECE || ((Factory)getFactory()).blockBlacklist.contains(new ItemInfo(broken)))
            return false;

        if (item.getType() != broken.getType()) return false;

        if (item.getData() > 0 && item.getData() != broken.getData()) return false;
View Full Code Here


            proximalBaseCenter = trigger.getRelative(BlockFace.UP);
        } else if (s.getLine(1).equalsIgnoreCase("[Door Down]")) {
            proximalBaseCenter = trigger.getRelative(BlockFace.DOWN);
        } else throw new InvalidMechanismException("Sign is incorrectly made.");

        if (blocks.contains(new ItemInfo(proximalBaseCenter)))
            return proximalBaseCenter;
        else throw new InvalidMechanismException("mech.door.unusable");
    }
View Full Code Here

        @Override
        public void verify(ChangedSign sign) throws ICVerificationException {

            if(!sign.getLine(2).trim().isEmpty()) {
                ItemInfo item = new ItemInfo(sign.getLine(2));
                if(item.getType() == null)
                    throw new ICVerificationException("An invalid block was provided on line 2!");
                if(blockBlacklist.contains(item))
                    throw new ICVerificationException("A blacklisted block was provided on line 2!");
            }
        }
View Full Code Here

    @Override
    public void load() {

        force = getSign().getLine(3).toUpperCase(Locale.ENGLISH).trim();

        item = new ItemInfo(getLine(2));
    }
View Full Code Here

        config.setComment(path + "xp-per-bottle", "Sets the amount of XP points required per each bottle.");
        xpPerBottle = config.getInt(path + "xp-per-bottle", 16);

        config.setComment(path + "block", "The block that is an XP Storer.");
        block = new ItemInfo(config.getString(path + "block", "MOB_SPAWNER"));

        config.setComment(path + "require-sneaking-state", "Sets how the player must be sneaking in order to use the XP Storer.");
        sneakingState = TernaryState.getFromString(config.getString(path + "require-sneaking-state", "no"));
    }
View Full Code Here

                yOffset += 0.15D;
            }
        } else if (event.getPlayer().getLocation().getY() != below.getY() + 1)
            return;

        if(blocks.contains(new ItemInfo(below))) {

            if(footsteps.contains(event.getPlayer().getName()))
                return;

            if(!event.getPlayer().hasPermission("craftbook.mech.footprints.use"))
View Full Code Here

        if(event.getPlayer().getGameMode() == GameMode.CREATIVE)
            return;

        LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());

        if(!enabledBlocks.contains(new ItemInfo(event.getBlock()))) return;
        if(!enabledItems.contains(player.getHeldItemInfo())) return;
        if(!player.hasPermission("craftbook.mech.treelopper.use")) {
            if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
                player.printError("mech.use-permission");
            return;
        }

        if(!EventUtil.passesFilter(event))
            return;

        Set<Location> visitedLocations = new HashSet<Location>();
        visitedLocations.add(event.getBlock().getLocation());
        int broken = 1;

        final Block usedBlock = event.getBlock();

        ItemInfo originalBlock = new ItemInfo(usedBlock);
        boolean hasPlanted = false;

        if(!player.hasPermission("craftbook.mech.treelopper.sapling"))
            hasPlanted = true;
View Full Code Here

    public boolean isReplacable(Block block) {

        if(block.getType() == Material.WATER || block.getType() == Material.STATIONARY_WATER) return false;
        if(BlockUtil.isBlockReplacable(block.getType())) return true;
        return realisticReplacables.contains(new ItemInfo(block));
    }
View Full Code Here

        if (!EventUtil.passesFilter(event))
            return;

        if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
        if (event.getClickedBlock() == null || !chairBlocks.contains(new ItemInfo(event.getClickedBlock())))
            return;

        LocalPlayer lplayer = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());
        if (lplayer.isSneaking()) return;
        Player player = event.getPlayer();
View Full Code Here

                if (p == null  || p.isDead()) {
                    chairs.remove(pl);
                    continue;
                }

                if (!chairBlocks.contains(new ItemInfo(getChair(p).b)) || !p.getWorld().equals(getChair(p).b.getWorld()) || LocationUtil.getDistanceSquared(p.getLocation(), getChair(p).b.getLocation()) > 1.5)
                    removeChair(p);
                else {
                    addChair(p, getChair(p).b); // For any new players.

                    if (chairHealth && p.getHealth() < p.getMaxHealth())
View Full Code Here

TOP

Related Classes of com.sk89q.craftbook.util.ItemInfo

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.