use of net.glowstone.block.state.GlowBanner in project Glowstone by GlowstoneMC.
the class BlockBanner method getDrops.
@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.setPatterns(state.getPatterns());
drop.setItemMeta(meta);
drop.setDurability(state.getBaseColor().getDyeData());
return Arrays.asList(drop);
}
use of net.glowstone.block.state.GlowBanner in project Glowstone by GlowstoneMC.
the class BlockBanner method afterPlace.
@Override
public void afterPlace(GlowPlayer player, GlowBlock block, ItemStack holding, GlowBlockState oldState) {
GlowBanner banner = (GlowBanner) block.getState();
banner.setBaseColor(DyeColor.getByDyeData((byte) holding.getDurability()));
BannerMeta meta = (BannerMeta) holding.getItemMeta();
meta.setPatterns(meta.getPatterns());
banner.update();
}
Aggregations