Package org.bukkit.material

Examples of org.bukkit.material.Dye


    public static BaseBlock toBlock(LocalWorld world, ItemStack itemStack) throws WorldEditException {
        final int typeId = itemStack.getTypeId();

        switch (typeId) {
            case ItemID.INK_SACK:
                final Dye materialData = (Dye) itemStack.getData();
                if (materialData.getColor() == DyeColor.BROWN) {
                    return new BaseBlock(BlockID.COCOA_PLANT, -1);
                }
                break;

            case ItemID.HEAD:
View Full Code Here


            }
            else if (materialName.contains("INK_SACK")) {
                String color = materialName.substring(9);

                try {
                    Dye dye = new Dye();
                    dye.setColor(DyeColor.valueOf(color.toUpperCase().trim()));

                    item = dye.toItemStack(amount);
                }
                catch (IllegalArgumentException ex) {
                    reason.add("Invalid Dye_Color: " + color);
                }
            }
View Full Code Here

        assertThat(byData, is(dye));
    }

    @Test
    public void getDyeDyeColor() {
        testColorable(new Dye(Material.INK_SACK, dye.getDyeData()));
    }
View Full Code Here

    @Override
    public void rightClickBlock(GlowPlayer player, GlowBlock target, BlockFace face, ItemStack holding, Vector clickedLoc) {
        MaterialData data = holding.getData();
        if (data instanceof Dye) {
            final Dye dye = (Dye) data;
            if (dye.getColor() == DyeColor.BROWN && target.getType() == Material.LOG) {
                data = target.getState().getData();
                if (data instanceof Tree &&
                        ((Tree) data).getSpecies() == TreeSpecies.JUNGLE &&
                        target.getRelative(face).getType() == Material.AIR) {
                    final GlowBlockState state = target.getRelative(face).getState();
View Full Code Here

TOP

Related Classes of org.bukkit.material.Dye

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.