org.bukkit.inventory.meta.LeatherArmorMeta Java Examples

The following examples show how to use org.bukkit.inventory.meta.LeatherArmorMeta. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UMaterial.java    From TradePlus with GNU General Public License v3.0 6 votes vote down vote up
public ItemStack getItemStack() {
  final String v = getVersionName();
  final Material m = v != null ? Material.valueOf(v) : null;
  ItemStack is = m != null ? EIGHT || NINE || TEN || ELEVEN || TWELVE ? new ItemStack(m, 1, data) : new ItemStack(m) : null;
  if(is != null && attributes != null) {
    for(String s : attributes.split(";")) {
      if(s.startsWith("color=")) {
        final String[] a = s.split(":");
        final LeatherArmorMeta me = (LeatherArmorMeta) is.getItemMeta();
        me.setColor(Color.fromRGB(Integer.parseInt(a[0]), Integer.parseInt(a[1]), Integer.parseInt(a[2])));
        is.setItemMeta(me);
      } else if(s.startsWith("enchant=")) {
        final String[] e = s.split("=")[1].split(":");
        final EnchantmentStorageMeta sm = (EnchantmentStorageMeta) is.getItemMeta();
        sm.addStoredEnchant(Sounds.version < 114 ? Enchantment.getByName(e[0]) : ItemUtils1_14.getEnchantment(e[0]), Integer.parseInt(e[1]), true);
        is.setItemMeta(sm);
      } else if(s.startsWith("upotion=")) {
        final String[] p = s.split("=")[1].split(":");
        is = new UPotion(PotionBase.valueOf(p[0]), p[1], Boolean.parseBoolean(p[2]), Boolean.parseBoolean(p[3])).getItemStack();
      }
    }
  }
  return is;
}
 
Example #2
Source File: Loadout.java    From AnnihilationPro with MIT License 6 votes vote down vote up
private static ItemStack[] coloredArmor(AnniTeam team)
{
	Color c;
	if(team.getColor() == ChatColor.RED)
		c = Color.RED;
	else if(team.getColor() == ChatColor.BLUE)
		c = Color.BLUE;
	else if(team.getColor() == ChatColor.GREEN)
		c = Color.GREEN;
	else
		c = Color.YELLOW;
	ItemStack[] stacks = KitUtils.getLeatherArmor();
	for(ItemStack stack : stacks)
	{
		LeatherArmorMeta meta = (LeatherArmorMeta) stack.getItemMeta();
		meta.setColor(c);
		stack.setItemMeta(meta);
	}
	return stacks;
}
 
Example #3
Source File: ItemStackBuilder.java    From AstralEdit with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the color of the itemStack. Only works on leatherItems
 *
 * @param color color
 * @return builder
 */
public ItemStackBuilder setColor(Color color) {
    if (this.getItemMeta() instanceof LeatherArmorMeta) {
        final LeatherArmorMeta meta = (LeatherArmorMeta) this.getItemMeta();
        meta.setColor(color);
        this.setItemMeta(meta);
    }
    return this;
}
 
Example #4
Source File: FlagTeamLeatherArmor.java    From HeavySpleef with GNU General Public License v3.0 5 votes vote down vote up
@Subscribe
public void onGameStart(GameStartEvent event) {
	FlagTeam flagTeam = (FlagTeam) getParent();
	Map<SpleefPlayer, TeamColor> players = flagTeam.getPlayers();
	
	for (SpleefPlayer player : event.getGame().getPlayers()) {
		if (!players.containsKey(player)) {
			continue;
		}
		
		TeamColor color = players.get(player);
		
		ItemStack leatherHelmet = LEATHER_HELMET_DATA.toItemStack(1);
		ItemStack leatherChestplate = LEATHER_CHESTPLATE_DATA.toItemStack(1);
		ItemStack leatherLeggings = LEATHER_LEGGINGS_DATA.toItemStack(1);
		ItemStack leatherBoots = LEATHER_BOOTS_DATA.toItemStack(1);
		
		LeatherArmorMeta meta = (LeatherArmorMeta) leatherHelmet.getItemMeta();
		meta.setColor(color.getRGB());
		
		leatherHelmet.setItemMeta(meta);
		leatherChestplate.setItemMeta(meta);
		leatherLeggings.setItemMeta(meta);
		leatherBoots.setItemMeta(meta);
		
		PlayerInventory inventory = player.getBukkitPlayer().getInventory();
		inventory.setHelmet(leatherHelmet);
		inventory.setChestplate(leatherChestplate);
		inventory.setLeggings(leatherLeggings);
		inventory.setBoots(leatherBoots);
	}
}
 
Example #5
Source File: Items.java    From CardinalPGM with MIT License 5 votes vote down vote up
public static ItemStack createLeatherArmor(Material material, int amount, String name, List<String> lore, Color color) {
    ItemStack item = createItem(material, amount, (short) 0, name, lore);
    LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
    meta.setColor(color);
    item.setItemMeta(meta);
    return item;
}
 
Example #6
Source File: ItemStackBuilder.java    From ZombieEscape with GNU General Public License v2.0 5 votes vote down vote up
public ItemStackBuilder withColor(Color color) {
    Material type = ITEM_STACK.getType();
    if (type == Material.LEATHER_BOOTS || type == Material.LEATHER_CHESTPLATE || type == Material.LEATHER_HELMET || type == Material.LEATHER_LEGGINGS) {
        LeatherArmorMeta meta = (LeatherArmorMeta) ITEM_STACK.getItemMeta();
        meta.setColor(color);
        ITEM_STACK.setItemMeta(meta);
        return this;
    } else {
        throw new IllegalArgumentException("withColor is only applicable for leather armor!");
    }
}
 
Example #7
Source File: NMS.java    From ArmorStandTools with MIT License 5 votes vote down vote up
private String getItemStackTags(ItemStack is) {
    if(is == null) {
        return "";
    }
    StringBuilder tags = new StringBuilder();
    if(is.getItemMeta() != null && is.getItemMeta() instanceof LeatherArmorMeta) {
        LeatherArmorMeta armorMeta = (LeatherArmorMeta) is.getItemMeta();
        tags.append("display:{color:");
        tags.append(armorMeta.getColor().asRGB());
        tags.append("}");
    }
    Map<Enchantment, Integer> enchants = is.getEnchantments();
    if(enchants.size() > 0) {
        if(tags.length() > 0) {
            tags.append(",");
        }
        tags.append("Enchantments:[");

        for(Enchantment e : enchants.keySet()) {
            tags.append("{id:");
            tags.append(e.getKey().getKey());
            tags.append(",lvl:");
            tags.append(enchants.get(e));
            tags.append("},");
        }

        tags.setCharAt(tags.length() - 1, ']');
    }
    return tags.length() == 0 ? "" : ("," + tags.toString());
}
 
Example #8
Source File: Game.java    From BedwarsRel with GNU General Public License v3.0 5 votes vote down vote up
public void playerJoinTeam(Player player, Team team) {
  if (team.getPlayers().size() >= team.getMaxPlayers()) {
    player.sendMessage(
        ChatWriter.pluginMessage(ChatColor.RED + BedwarsRel._l(player, "errors.teamfull")));
    return;
  }

  if (team.addPlayer(player)) {
    this.nonFreePlayer(player);

    // Team color chestplate
    ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
    LeatherArmorMeta meta = (LeatherArmorMeta) chestplate.getItemMeta();
    meta.setColor(team.getColor().getColor());
    meta.setDisplayName(team.getChatColor() + team.getDisplayName());
    chestplate.setItemMeta(meta);

    player.getInventory().setItem(7, chestplate);
    player.updateInventory();
  } else {
    player.sendMessage(
        ChatWriter.pluginMessage(ChatColor.RED + BedwarsRel._l(player, "errors.teamfull")));
    return;
  }

  this.updateScoreboard();

  if (this.isStartable() && this.getLobbyCountdown() == null) {
    GameLobbyCountdown lobbyCountdown = new GameLobbyCountdown(this);
    lobbyCountdown.runTaskTimer(BedwarsRel.getInstance(), 20L, 20L);
    this.setLobbyCountdown(lobbyCountdown);
  }

  player
      .sendMessage(ChatWriter.pluginMessage(ChatColor.GREEN + BedwarsRel
          ._l(player, "lobby.teamjoined",
              ImmutableMap.of("team", team.getDisplayName() + ChatColor.GREEN))));
}
 
Example #9
Source File: UMaterial.java    From TradePlus with GNU General Public License v3.0 5 votes vote down vote up
public static ItemStack getColoredLeather(Material m, int amount, int red, int green, int blue) {
  final ItemStack i = new ItemStack(m, amount);
  final LeatherArmorMeta lam = (LeatherArmorMeta) i.getItemMeta();
  lam.setColor(Color.fromRGB(red, green, blue));
  i.setItemMeta(lam);
  return i;
}
 
Example #10
Source File: Items.java    From StaffPlus with GNU General Public License v3.0 5 votes vote down vote up
public static ItemStack createColoredArmor(Armor armor, Color color, String name)
{
	ItemStack leatherArmor = new ItemStack(armor.getMaterial());
	LeatherArmorMeta meta = (LeatherArmorMeta) leatherArmor.getItemMeta();
	meta.setColor(color);
	if(name != null)
	    meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name));
	leatherArmor.setItemMeta(meta);
	return leatherArmor;
}
 
Example #11
Source File: JsonItemUtils.java    From UhcCore with GNU General Public License v3.0 5 votes vote down vote up
private static ItemMeta parseColor(ItemMeta meta, int color){
    if (meta instanceof PotionMeta){
        PotionMeta potionMeta = (PotionMeta) meta;
        VersionUtils.getVersionUtils().setPotionColor(potionMeta, Color.fromRGB(color));
        return potionMeta;
    }else if (meta instanceof LeatherArmorMeta){
        LeatherArmorMeta leatherMeta = (LeatherArmorMeta) meta;
        leatherMeta.setColor(Color.fromBGR(color));
        return leatherMeta;
    }

    return meta;
}
 
Example #12
Source File: ItemBuilder.java    From EnchantmentsEnhance with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets the armor color of a leather armor piece. Works only on leather
 * armor pieces.
 *
 * @param color The color to set it to.
 */
public ItemBuilder setLeatherArmorColor(Color color) {
    try {
        LeatherArmorMeta im = (LeatherArmorMeta) is.getItemMeta();
        im.setColor(color);
        is.setItemMeta(im);
    } catch (ClassCastException expected) {
    }
    return this;
}
 
Example #13
Source File: PickerMatchModule.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
private ItemStack createTeamJoinButton(final MatchPlayer player, final Team team) {
    ItemStack item = new ItemStack(Button.TEAM_JOIN.material);
    String capacityMessage = this.getTeamSizeDescription(team.getPlayers().size(), team.getMaxPlayers());
    List<String> lore = Lists.newArrayList(capacityMessage);

    final JoinResult result = jmm.queryJoin(player, JoinRequest.user(team));
    if(result.isAllowed()) {
        final String label = result.isRejoin() ? "teamSelection.picker.clickToRejoin"
                                               : "teamSelection.picker.clickToJoin";
        lore.add(renderer.renderLegacy(new Component(new TranslatableComponent(label), ChatColor.GREEN), player.getBukkit()));
    } else if(result.message().isPresent()) {
        lore.add(renderer.renderLegacy(new Component(result.message().get(), ChatColor.RED), player.getBukkit()));
        result.extra().forEach(line -> {
            lore.add(renderer.renderLegacy(line, player.getBukkit()));
        });
    }

    LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
    meta.addItemFlags(ItemFlag.values());
    meta.setColor(team.getFullColor());
    meta.setDisplayName(team.getColor().toString() + ChatColor.BOLD + team.getName());
    meta.setLore(lore);
    meta.addItemFlags(ItemFlag.values()); // Hides a lot more than potion effects
    item.setItemMeta(meta);

    return item;
}
 
Example #14
Source File: ColorChanger.java    From BedWars with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static ItemStack changeLeatherArmorColor(ItemStack itemStack, TeamColor color) {
    Material material = itemStack.getType();

    if (material.toString().contains("LEATHER_") && !material.toString().contains("LEATHER_HORSE_")) {
        LeatherArmorMeta meta = (LeatherArmorMeta) itemStack.getItemMeta();

        meta.setColor(color.leatherColor);
        itemStack.setItemMeta(meta);

        return itemStack;
    }
    return itemStack;
}
 
Example #15
Source File: Dyer.java    From TrMenu with MIT License 5 votes vote down vote up
public static void setLeather(LeatherArmorMeta meta, String color) {
    String[] rgb = color.split(",");
    if (rgb.length == 3) {
        int r = NumberUtils.toInt(rgb[0], 0);
        int g = NumberUtils.toInt(rgb[1], 0);
        int b = NumberUtils.toInt(rgb[2], 0);
        meta.setColor(Color.fromRGB(r, g, b));
    }
}
 
Example #16
Source File: ColorChanger.java    From BedWars with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static ItemStack changeLeatherArmorColor(ItemStack itemStack, TeamColor color) {
    Material material = itemStack.getType();

    if (material.toString().contains("LEATHER_") && !material.toString().contains("LEATHER_HORSE_")) {
        LeatherArmorMeta meta = (LeatherArmorMeta) itemStack.getItemMeta();

        meta.setColor(color.leatherColor);
        itemStack.setItemMeta(meta);

        return itemStack;
    }
    return itemStack;
}
 
Example #17
Source File: Game.java    From BedWars with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void internalTeamJoin(GamePlayer player, Team teamForJoin) {
    CurrentTeam current = null;
    for (CurrentTeam t : teamsInGame) {
        if (t.teamInfo == teamForJoin) {
            current = t;
            break;
        }
    }

    CurrentTeam cur = getPlayerTeam(player);
    BedwarsPlayerJoinTeamEvent event = new BedwarsPlayerJoinTeamEvent(current, player.player, this, cur);
    Main.getInstance().getServer().getPluginManager().callEvent(event);

    if (event.isCancelled()) {
        return;
    }

    if (current == null) {
        current = new CurrentTeam(teamForJoin, this);
        org.bukkit.scoreboard.Team scoreboardTeam = gameScoreboard.getTeam(teamForJoin.name);
        if (scoreboardTeam == null) {
            scoreboardTeam = gameScoreboard.registerNewTeam(teamForJoin.name);
        }
        if (!Main.isLegacy()) {
            scoreboardTeam.setColor(teamForJoin.color.chatColor);
        } else {
            scoreboardTeam.setPrefix(teamForJoin.color.chatColor.toString());
        }
        scoreboardTeam.setAllowFriendlyFire(getOriginalOrInheritedFriendlyfire());

        current.setScoreboardTeam(scoreboardTeam);
    }
    if (cur == current) {
        player.player.sendMessage(
                i18n("team_already_selected").replace("%team%", teamForJoin.color.chatColor + teamForJoin.name)
                        .replace("%players%", Integer.toString(current.players.size()))
                        .replaceAll("%maxplayers%", Integer.toString(current.teamInfo.maxPlayers)));
        return;
    }
    if (current.players.size() >= current.teamInfo.maxPlayers) {
        if (cur != null) {
            player.player.sendMessage(i18n("team_is_full_you_are_staying")
                    .replace("%team%", teamForJoin.color.chatColor + teamForJoin.name)
                    .replace("%oldteam%", cur.teamInfo.color.chatColor + cur.teamInfo.name));
        } else {
            player.player.sendMessage(
                    i18n("team_is_full").replace("%team%", teamForJoin.color.chatColor + teamForJoin.name));
        }
        return;
    }
    if (cur != null) {
        cur.players.remove(player);
        cur.getScoreboardTeam().removeEntry(player.player.getName());
        if (cur.players.isEmpty()) {
            teamsInGame.remove(cur);
            cur.getScoreboardTeam().unregister();
        }
    }
    current.players.add(player);
    current.getScoreboardTeam().addEntry(player.player.getName());
    player.player
            .sendMessage(i18n("team_selected").replace("%team%", teamForJoin.color.chatColor + teamForJoin.name)
                    .replace("%players%", Integer.toString(current.players.size()))
                    .replaceAll("%maxplayers%", Integer.toString(current.teamInfo.maxPlayers)));

    if (getOriginalOrInheritedAddWoolToInventoryOnJoin()) {
        int colorPosition = Main.getConfigurator().config.getInt("hotbar.color", 1);
        if (colorPosition >= 0 && colorPosition <= 8) {
            ItemStack stack = teamForJoin.color.getWool();
            ItemMeta stackMeta = stack.getItemMeta();
            stackMeta.setDisplayName(teamForJoin.color.chatColor + teamForJoin.name);
            stack.setItemMeta(stackMeta);
            player.player.getInventory().setItem(colorPosition, stack);
        }
    }

    if (getOriginalOrInheritedColoredLeatherByTeamInLobby()) {
        ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
        LeatherArmorMeta meta = (LeatherArmorMeta) chestplate.getItemMeta();
        meta.setColor(teamForJoin.color.leatherColor);
        chestplate.setItemMeta(meta);
        player.player.getInventory().setChestplate(chestplate);
    }

    if (!teamsInGame.contains(current)) {
        teamsInGame.add(current);
    }
}
 
Example #18
Source File: CustomItemStack.java    From AdditionsAPI with MIT License 4 votes vote down vote up
@SuppressWarnings("deprecation")
private static ItemStack getItemStack(CustomItem cItem, short durability) {
	if (AdditionsAPI.getAllCustomItemStacks() != null)
		for (CustomItemStack cStack : AdditionsAPI.getAllCustomItemStacks())
			if (cStack.getCustomItem().getIdName().equalsIgnoreCase(cItem.getIdName()))
				return cStack.getItemStack();
	// Material, amount and durability
	ItemStack item = NbtFactory
			.getCraftItemStack(new ItemStack(cItem.getMaterial(), cItem.getAmount(), durability));

	// Store data in the nbt data of the ItemStack about the CustomItem's ID
	NbtCompound nbt = NbtFactory.fromItemTag(item);
	nbt.put("CustomItem.IdName", cItem.getIdName());

	ItemMeta meta = item.getItemMeta();

	// Unbreakable
	meta.setUnbreakable(cItem.isUnbreakable());

	// Display Name
	meta.setDisplayName(cItem.getDisplayName());

	// Enchantments
	for (Enchantment e : cItem.getEnchantmnets().keySet())
		meta.addEnchant(e, cItem.getEnchantmnets().get(e), true);

	// Lore
	meta.setLore(cItem.getFullLore(cItem.getEnchantmnets(), cItem.getFakeDurability(), null));

	// ItemFlags
	for (ItemFlag flag : cItem.getItemFlags())
		meta.addItemFlags(flag);

	// Set the lore and return the item
	item.setItemMeta(meta);

	// Add Attributes
	for (Attributes.Attribute attribute : cItem.getAttributes()) {
		Attributes attributes = new Attributes(item);
		attributes.add(attribute);
		item = attributes.getStack();
	}

	// Leather Armor stuff
	if (cItem instanceof CustomLeatherArmor) {
		LeatherArmorMeta leatherMeta = (LeatherArmorMeta) item.getItemMeta();

		leatherMeta.setColor(((CustomLeatherArmor) cItem).getColor());

		item.setItemMeta(leatherMeta);
	}
	return item;
}
 
Example #19
Source File: CustomArmor.java    From CS-CoreLib with GNU General Public License v3.0 4 votes vote down vote up
public CustomArmor(ItemStack item, Color color) {
	super(item.clone());
	ItemMeta im = getItemMeta();
	((LeatherArmorMeta) im).setColor(color);
	setItemMeta(im);
}
 
Example #20
Source File: Game.java    From BedWars with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void internalTeamJoin(GamePlayer player, Team teamForJoin) {
    CurrentTeam current = null;
    for (CurrentTeam t : teamsInGame) {
        if (t.teamInfo == teamForJoin) {
            current = t;
            break;
        }
    }

    CurrentTeam cur = getPlayerTeam(player);
    BedwarsPlayerJoinTeamEvent event = new BedwarsPlayerJoinTeamEvent(current, player.player, this, cur);
    Main.getInstance().getServer().getPluginManager().callEvent(event);

    if (event.isCancelled()) {
        return;
    }

    if (current == null) {
        current = new CurrentTeam(teamForJoin, this);
        org.bukkit.scoreboard.Team scoreboardTeam = gameScoreboard.getTeam(teamForJoin.name);
        if (scoreboardTeam == null) {
            scoreboardTeam = gameScoreboard.registerNewTeam(teamForJoin.name);
        }
        if (!Main.isLegacy()) {
            scoreboardTeam.setColor(teamForJoin.color.chatColor);
        } else {
            scoreboardTeam.setPrefix(teamForJoin.color.chatColor.toString());
        }
        scoreboardTeam.setAllowFriendlyFire(getOriginalOrInheritedFriendlyfire());

        current.setScoreboardTeam(scoreboardTeam);
    }
    if (cur == current) {
        player.player.sendMessage(
                i18n("team_already_selected").replace("%team%", teamForJoin.color.chatColor + teamForJoin.name)
                        .replace("%players%", Integer.toString(current.players.size()))
                        .replaceAll("%maxplayers%", Integer.toString(current.teamInfo.maxPlayers)));
        return;
    }
    if (current.players.size() >= current.teamInfo.maxPlayers) {
        if (cur != null) {
            player.player.sendMessage(i18n("team_is_full_you_are_staying")
                    .replace("%team%", teamForJoin.color.chatColor + teamForJoin.name)
                    .replace("%oldteam%", cur.teamInfo.color.chatColor + cur.teamInfo.name));
        } else {
            player.player.sendMessage(
                    i18n("team_is_full").replace("%team%", teamForJoin.color.chatColor + teamForJoin.name));
        }
        return;
    }
    if (cur != null) {
        cur.players.remove(player);
        cur.getScoreboardTeam().removeEntry(player.player.getName());
        if (cur.players.isEmpty()) {
            teamsInGame.remove(cur);
            cur.getScoreboardTeam().unregister();
        }
    }
    current.players.add(player);
    current.getScoreboardTeam().addEntry(player.player.getName());
    player.player
            .sendMessage(i18n("team_selected").replace("%team%", teamForJoin.color.chatColor + teamForJoin.name)
                    .replace("%players%", Integer.toString(current.players.size()))
                    .replaceAll("%maxplayers%", Integer.toString(current.teamInfo.maxPlayers)));

    if (getOriginalOrInheritedAddWoolToInventoryOnJoin()) {
        int colorPosition = Main.getConfigurator().config.getInt("hotbar.color", 1);
        if (colorPosition >= 0 && colorPosition <= 8) {
            ItemStack stack = teamForJoin.color.getWool();
            ItemMeta stackMeta = stack.getItemMeta();
            stackMeta.setDisplayName(teamForJoin.color.chatColor + teamForJoin.name);
            stack.setItemMeta(stackMeta);
            player.player.getInventory().setItem(colorPosition, stack);
        }
    }

    if (getOriginalOrInheritedColoredLeatherByTeamInLobby()) {
        ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
        LeatherArmorMeta meta = (LeatherArmorMeta) chestplate.getItemMeta();
        meta.setColor(teamForJoin.color.leatherColor);
        chestplate.setItemMeta(meta);
        player.player.getInventory().setChestplate(chestplate);
    }

    if (!teamsInGame.contains(current)) {
        teamsInGame.add(current);
    }
}
 
Example #21
Source File: PickerMatchModule.java    From PGM with GNU Affero General Public License v3.0 4 votes vote down vote up
private ItemStack createTeamJoinButton(final MatchPlayer player, final Team team) {
  JoinMatchModule jmm = match.needModule(JoinMatchModule.class);

  ItemStack item = new ItemStack(Button.TEAM_JOIN.material);
  String capacityMessage =
      this.getTeamSizeDescription(team.getPlayers().size(), team.getMaxPlayers());
  List<String> lore = Lists.newArrayList(capacityMessage);

  JoinResult result = jmm.queryJoin(player, team);
  if (result instanceof GenericJoinResult) {
    switch (((GenericJoinResult) result).getStatus()) {
      default:
        lore.add(
            ChatColor.GREEN
                + TextTranslations.translate("picker.clickToJoin", player.getBukkit()));
        break;

      case REJOINED:
        lore.add(
            ChatColor.GREEN
                + TextTranslations.translate("picker.clickToRejoin", player.getBukkit()));
        break;

      case CHOICE_DENIED:
        lore.add(
            ChatColor.GOLD
                + TextTranslations.translate("picker.noPermissions", player.getBukkit()));
        break;

      case FULL:
        lore.add(
            ChatColor.DARK_RED
                + TextTranslations.translate("picker.capacity", player.getBukkit()));
        break;
    }
  }

  LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
  meta.setColor(team.getFullColor());
  meta.setDisplayName(team.getColor().toString() + ChatColor.BOLD + team.getNameLegacy());
  meta.setLore(lore);
  item.setItemMeta(meta);

  return item;
}