use of net.glowstone.block.entity.state.GlowBanner in project Glowstone by GlowstoneMC.
the class BlockBanner method getDrops.
@NotNull
@Override
public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) {
GlowBanner state = (GlowBanner) block.getState();
ItemStack drop = new ItemStack(Material.LEGACY_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.entity.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