Package org.bukkit

Examples of org.bukkit.Material


            return;
        }

        PlayerInventory inventory = player.getInventory();

        Material repairMaterial = repairable.getRepairMaterial();
        byte repairMaterialMetadata = repairable.getRepairMaterialMetadata();
        ItemStack toRemove = new MaterialData(repairMaterial, repairMaterialMetadata).toItemStack(1);

        short startDurability = item.getDurability();
View Full Code Here


     *
     * @param blockState The {@link BlockState} of the block to check
     * @return true if the block is an mcMMO anvil, false otherwise
     */
    public static boolean isMcMMOAnvil(BlockState blockState) {
        Material type = blockState.getType();

        return type == Repair.anvilMaterial || type == Salvage.anvilMaterial;
    }
View Full Code Here

        return type == Repair.anvilMaterial || type == Salvage.anvilMaterial;
    }

    public static boolean isPistonPiece(BlockState blockState) {
        Material type = blockState.getType();

        return type == Material.PISTON_MOVING_PIECE || type == Material.AIR;
    }
View Full Code Here

                return new ArrayList<ExcavationTreasure>();
        }
    }

    protected static int getBlockXP(BlockState blockState) {
        Material material = blockState.getType();
        int xp;

        if (material == Material.DIRT || material == Material.SAND) {
            xp = ExperienceConfig.getInstance().getDirtAndSandXp(blockState.getData());
        }
View Full Code Here

            if (config.contains(armorType + "." + armorName + "." + ".ID")) {
                needsUpdate = true;
                return;
            }

            Material armorMaterial = Material.matchMaterial(armorName);

            if (armorMaterial == null) {
                plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + armorName);
                continue;
            }

            boolean repairable = config.getBoolean(armorType + "." + armorName + ".Repairable");
            Material repairMaterial = Material.matchMaterial(config.getString(armorType + "." + armorName + ".Repair_Material", ""));

            if (repairable && (repairMaterial == null)) {
                plugin.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName);
                repairable = false;
            }
View Full Code Here

                return;
            }

            String[] blockInfo = blockName.split("[|]");

            Material blockMaterial = Material.matchMaterial(blockInfo[0]);

            if (blockMaterial == null) {
                plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + blockInfo[0]);
                continue;
            }
View Full Code Here

        Block block = event.getClickedBlock();
        ItemStack heldItem = player.getItemInHand();

        switch (event.getAction()) {
            case RIGHT_CLICK_BLOCK:
                Material type = block.getType();

                if (!Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() || player.isSneaking()) {
                    /* REPAIR CHECKS */
                    if (type == Repair.anvilMaterial && SkillType.REPAIR.getPermissions(player) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
                        RepairManager repairManager = mcMMOPlayer.getRepairManager();
View Full Code Here

                if (!player.isSneaking()) {
                    break;
                }

                /* CALL OF THE WILD CHECKS */
                Material type = heldItem.getType();
                TamingManager tamingManager = mcMMOPlayer.getTamingManager();

                if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.WOLF)) {
                    tamingManager.summonWolf();
                }
View Full Code Here

            if (!EventUtils.simulateBlockBreak(block, player, true)) {
                break; // TODO: Shouldn't we use continue instead?
            }

            Material material = blockState.getType();

            if (material == Material.HUGE_MUSHROOM_1 || material == Material.HUGE_MUSHROOM_2) {
                xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER);
                Misc.dropItems(blockState.getLocation(), block.getDrops());
            }
View Full Code Here

            return null;
        }

        String[] parts = ingredient.split(":");

        Material material = parts.length > 0 ? Material.getMaterial(parts[0]) : null;
        short data = parts.length > 1 ? Short.parseShort(parts[1]) : 0;

        if (material != null) {
            return new ItemStack(material, 1, data);
        }
View Full Code Here

TOP

Related Classes of org.bukkit.Material

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.