Package org.bukkit.material

Examples of org.bukkit.material.MaterialData


    public MaterialData data;

    public ItemInfo(Material id, int data) {

        this.data = new MaterialData(id, (byte) data);
    }
View Full Code Here


    }

    @Deprecated
    public ItemInfo(int id, int data) {

        this.data = new MaterialData(id, (byte) data);
    }
View Full Code Here

        this.data = new MaterialData(id, (byte) data);
    }

    public ItemInfo(Block block) {

        data = new MaterialData(block.getType(), block.getData());
    }
View Full Code Here

    }

    public ItemInfo(ItemStack item) {

        if(item == null)
            data = new MaterialData(-1,(byte) -1);
        else
            data = item.getData();
    }
View Full Code Here

        return data.getItemType();
    }

    public void setId(int id) {

        data = new MaterialData(id, data.getData());
    }
View Full Code Here

    public boolean blockCrackerCheck(BlockState blockState) {
        if (!SkillUtils.activationSuccessful(SecondaryAbility.BLOCK_CRACKER, getPlayer())) {
            return false;
        }

        MaterialData data = blockState.getData();

        switch (blockState.getType()) {
            case SMOOTH_BRICK:
                if (!Unarmed.blockCrackerSmoothBrick) {
                    return false;
View Full Code Here

        PlayerInventory inventory = player.getInventory();

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

        short startDurability = item.getDurability();

        // Do not repair if at full durability
        if (startDurability <= 0) {
View Full Code Here

                plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + blockInfo[0]);
                continue;
            }

            byte blockData = (blockInfo.length == 2) ? Byte.valueOf(blockInfo[1]) : 0;
            MaterialData blockMaterialData = new MaterialData(blockMaterial, blockData);

            if (blockList != null) {
                blockList.add(blockMaterialData);
            }
View Full Code Here

            if (canBeSummoned && (callOfTheWildMaterial == null || callOfTheWildAmount == 0)) {
                plugin.getLogger().warning("Incomplete Call of the Wild information. This entity will not be able to be summoned by Call of the Wild.");
                canBeSummoned = false;
            }

            CustomEntity entity = new CustomEntity(xpMultiplier, canBeTamed, tamingXp, canBeSummoned, (canBeSummoned ? new MaterialData(callOfTheWildMaterial, callOfTheWildData).toItemStack(1) : null), callOfTheWildAmount);

            customEntityTypeMap.put(entityTypeName, entity);
            customEntityClassMap.put(clazz == null ? null : clazz.getName(), entity);
        }
    }
View Full Code Here

            }
        }

        byte salvageMaterialMetadata = (salvageable.getSalvageMaterialMetadata() != (byte) -1) ? salvageable.getSalvageMaterialMetadata() : 0;

        Misc.dropItems(location, new MaterialData(salvageable.getSalvageMaterial(), salvageMaterialMetadata).toItemStack(salvageableAmount), 1);

        // BWONG BWONG BWONG - CLUNK!
        if (Config.getInstance().getSalvageAnvilUseSoundsEnabled()) {
            player.playSound(player.getLocation(), Sound.ANVIL_USE, Misc.ANVIL_USE_VOLUME, Misc.ANVIL_USE_PITCH);
            player.playSound(player.getLocation(), Sound.ITEM_BREAK, 1.0F, 1.0F);
View Full Code Here

TOP

Related Classes of org.bukkit.material.MaterialData

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.