Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Format 0xAARRGGBB (int)

Nicolas Montchamp edited this page Jan 31, 2024 · 7 revisions

Pour récupérer une couleur int au format 0xAARRGGBB, vous devez utiliser :

  • AZManager.getColor(String hexColor)

Exemple d'utilisation

import fr.speccy.azclientapi.bukkit.AZManager;
import fr.thebatteur.items.AZItem;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

public class Exemple {

    private void customColor(Player player) {
        int color = AZManager.getColor("#4287f5");
        // color = -12417035 (Blue color)

        AZItem iron_sword = new AZItem(new ItemStack(Material.IRON_SWORD));
        iron_sword.addPacDisplay(new AZItem.PacDisplay().setColor(color))
                .addPacRender(new AZItem.PacRender().setColor(color));

        player.getInventory().setItem(4, iron_sword.getItemStack());
    }
}

Clone this wiki locally