retMeta.setColor(newColor); ret.setItemMeta(retMeta);
private boolean bleachLeatherArmor(GlowPlayer player, GlowBlock block) { // fired when a player bleaches a leather armor piece using the cauldron if (block.getData() > LEVEL_EMPTY) { if (!setCauldronLevel(block, block.getData() - 1, player, CauldronLevelChangeEvent.ChangeReason.ARMOR_WASH)) { return false; } ItemStack inHand = player.getItemInHand(); LeatherArmorMeta im = (LeatherArmorMeta) inHand.getItemMeta(); im.setColor(GlowItemFactory.instance().getDefaultLeatherColor()); inHand.setItemMeta(im); return true; } else { return false; } }
public ItemStackBuilder color(Color color) { if (itemMeta instanceof LeatherArmorMeta) { ((LeatherArmorMeta) itemMeta).setColor(color); } return this; }
public ItemBuilder color(Color color) { if (itemMeta instanceof LeatherArmorMeta) { ((LeatherArmorMeta) itemMeta).setColor(color); } return this; }
@Override public void setColor(MCColor color) { lam.setColor(BukkitMCColor.GetColor(color)); }
switch (team.getColor()) { case RED: m.setColor(Color.RED); break; case BLUE: m.setColor(Color.BLUE); break; case GREEN: m.setColor(Color.GREEN); break; case YELLOW: m.setColor(Color.YELLOW); break; case BLACK: m.setColor(Color.BLACK); break; case WHITE: m.setColor(Color.WHITE); break; case GRAY: m.setColor(Color.GRAY); break; case PURPLE: m.setColor(Color.PURPLE); break; case DARK_BLUE: m.setColor(Color.BLUE); break; case DARK_GREEN:
public ItemStackBuilder color(Color color) { return transform(itemStack -> { Material type = itemStack.getType(); if (type == Material.LEATHER_BOOTS || type == Material.LEATHER_CHESTPLATE || type == Material.LEATHER_HELMET || type == Material.LEATHER_LEGGINGS) { LeatherArmorMeta meta = (LeatherArmorMeta) itemStack.getItemMeta(); meta.setColor(color); itemStack.setItemMeta(meta); } }); }
public ItemStackBuilder color(Color color) { return transform(itemStack -> { Material type = itemStack.getType(); if (type == Material.LEATHER_BOOTS || type == Material.LEATHER_CHESTPLATE || type == Material.LEATHER_HELMET || type == Material.LEATHER_LEGGINGS) { LeatherArmorMeta meta = (LeatherArmorMeta) itemStack.getItemMeta(); meta.setColor(color); itemStack.setItemMeta(meta); } }); }
((LeatherArmorMeta) item.getMeta()).setColor(Color.fromRGB(Integer.parseInt(color[0]), Integer.parseInt(color[1]), Integer.parseInt(color[2]))); item.refreshMeta();
public static void equipArmorStand(LivingEntity armor, Team team) { if (!(armor instanceof ArmorStand)) { return; } ArmorStand stand = (ArmorStand) armor; // helmet ItemStack helmet = new ItemStack(Material.LEATHER_HELMET, 1); LeatherArmorMeta meta = (LeatherArmorMeta) helmet.getItemMeta(); meta.setColor(team.getColor().getColor()); helmet.setItemMeta(meta); // chestplate ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1); meta = (LeatherArmorMeta) chestplate.getItemMeta(); meta.setColor(team.getColor().getColor()); chestplate.setItemMeta(meta); // leggings ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS, 1); meta = (LeatherArmorMeta) leggings.getItemMeta(); meta.setColor(team.getColor().getColor()); leggings.setItemMeta(meta); // boots ItemStack boots = new ItemStack(Material.LEATHER_BOOTS, 1); meta = (LeatherArmorMeta) boots.getItemMeta(); meta.setColor(team.getColor().getColor()); boots.setItemMeta(meta); stand.setHelmet(helmet); stand.setChestplate(chestplate); stand.setLeggings(leggings); stand.setBoots(boots); }
public static void equipArmorStand(LivingEntity armor, Team team) { if (!(armor instanceof ArmorStand)) { return; } ArmorStand stand = (ArmorStand) armor; // helmet ItemStack helmet = new ItemStack(Material.LEATHER_HELMET, 1); LeatherArmorMeta meta = (LeatherArmorMeta) helmet.getItemMeta(); meta.setColor(team.getColor().getColor()); helmet.setItemMeta(meta); // chestplate ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1); meta = (LeatherArmorMeta) chestplate.getItemMeta(); meta.setColor(team.getColor().getColor()); chestplate.setItemMeta(meta); // leggings ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS, 1); meta = (LeatherArmorMeta) leggings.getItemMeta(); meta.setColor(team.getColor().getColor()); leggings.setItemMeta(meta); // boots ItemStack boots = new ItemStack(Material.LEATHER_BOOTS, 1); meta = (LeatherArmorMeta) boots.getItemMeta(); meta.setColor(team.getColor().getColor()); boots.setItemMeta(meta); stand.setHelmet(helmet); stand.setChestplate(chestplate); stand.setLeggings(leggings); stand.setBoots(boots); }
private void equipPlayerWithLeather(Player player) { // helmet ItemStack helmet = new ItemStack(Material.LEATHER_HELMET, 1); LeatherArmorMeta meta = (LeatherArmorMeta) helmet.getItemMeta(); meta.setColor(this.getColor().getColor()); helmet.setItemMeta(meta); // chestplate ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1); meta = (LeatherArmorMeta) chestplate.getItemMeta(); meta.setColor(this.getColor().getColor()); chestplate.setItemMeta(meta); // leggings ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS, 1); meta = (LeatherArmorMeta) leggings.getItemMeta(); meta.setColor(this.getColor().getColor()); leggings.setItemMeta(meta); // boots ItemStack boots = new ItemStack(Material.LEATHER_BOOTS, 1); meta = (LeatherArmorMeta) boots.getItemMeta(); meta.setColor(this.getColor().getColor()); boots.setItemMeta(meta); player.getInventory().setHelmet(helmet); player.getInventory().setChestplate(chestplate); player.getInventory().setLeggings(leggings); player.getInventory().setBoots(boots); player.updateInventory(); }
((LeatherArmorMeta) itemMeta).setColor(color);
private void equipPlayerWithLeather(Player player) { // helmet ItemStack helmet = new ItemStack(Material.LEATHER_HELMET, 1); LeatherArmorMeta meta = (LeatherArmorMeta) helmet.getItemMeta(); meta.setColor(this.getColor().getColor()); helmet.setItemMeta(meta); // chestplate ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1); meta = (LeatherArmorMeta) chestplate.getItemMeta(); meta.setColor(this.getColor().getColor()); chestplate.setItemMeta(meta); // leggings ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS, 1); meta = (LeatherArmorMeta) leggings.getItemMeta(); meta.setColor(this.getColor().getColor()); leggings.setItemMeta(meta); // boots ItemStack boots = new ItemStack(Material.LEATHER_BOOTS, 1); meta = (LeatherArmorMeta) boots.getItemMeta(); meta.setColor(this.getColor().getColor()); boots.setItemMeta(meta); player.getInventory().setHelmet(helmet); player.getInventory().setChestplate(chestplate); player.getInventory().setLeggings(leggings); player.getInventory().setBoots(boots); player.updateInventory(); }
final LeatherArmorMeta metaBottom = (LeatherArmorMeta) boots.getItemMeta(); metaHead.setColor(Color.fromRGB(getColor(this.headData.getItemType(), this.headData.getData()))); metaChest.setColor(Color.fromRGB(getColor(this.headData.getItemType(), this.headData.getData()))); metaLegs.setColor(Color.fromRGB(getColor(this.legsData.getItemType(), this.legsData.getData()))); metaBottom.setColor(Color.fromRGB(getColor(this.legsData.getItemType(), this.legsData.getData())));
armorMeta.setColor(color.get());
meta.setColor(team.getColor().getColor()); meta.setDisplayName(team.getChatColor() + team.getDisplayName()); chestplate.setItemMeta(meta);
meta.setColor(team.getColor().getColor()); meta.setDisplayName(team.getChatColor() + team.getDisplayName()); chestplate.setItemMeta(meta);
ItemMeta meta = stack.getItemMeta(); if (extraData != null && extraData instanceof LeatherArmorData && meta != null && meta instanceof LeatherArmorMeta) { ((LeatherArmorMeta)meta).setColor(((LeatherArmorData)extraData).getColor()); stack.setItemMeta(meta);
final ItemStack legs = new ItemStack(Material.LEATHER_LEGGINGS); final LeatherArmorMeta legmeta = (LeatherArmorMeta) legs.getItemMeta(); legmeta.setColor(Color.fromRGB(EarthArmor.getColor(m))); legs.setItemMeta(legmeta); footmeta.setColor(Color.fromRGB(EarthArmor.getColor(m))); feet.setItemMeta(footmeta);