Package net.glowstone.block.state

Examples of net.glowstone.block.state.GlowBanner


        tag.putInt("Base", base.getDyeData());
    }

    @Override
    public GlowBlockState getState() {
        return new GlowBanner(block);
    }
View Full Code Here


        setDrops(new ItemStack(Material.BANNER));
    }

    @Override
    public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) {
        GlowBanner state = (GlowBanner) block.getState();
        ItemStack drop = new ItemStack(Material.BANNER, 1);
        BannerMeta meta = (BannerMeta) drop.getItemMeta();
        meta.setPattern(state.getPattern());
        drop.setItemMeta(meta);
        drop.setDurability(state.getBase().getDyeData());

        return Arrays.asList(drop);
    }
View Full Code Here

        }
    }

    @Override
    public void afterPlace(GlowPlayer player, GlowBlock block, ItemStack holding) {
        GlowBanner banner = (GlowBanner) block.getState();
        banner.setBase(DyeColor.getByDyeData((byte) holding.getDurability()));
        BannerMeta meta = (BannerMeta) holding.getItemMeta();
        banner.setPattern(meta.getPattern());
        banner.update();
    }
View Full Code Here

TOP

Related Classes of net.glowstone.block.state.GlowBanner

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.