⚡
xShyo_ Plugins Wiki
  • 👋 Welcome
  • PREMIUM PLUGINS
    • 🏠 PsMenu
      • Home
      • Installation
      • Commands & Permissions
      • Plugin´s Files
      • Flags
      • FAQ
    • 🛒 ShopMaster
      • Home
      • Installation
      • Commands & Permissions
      • item Creation
      • Economy Symbols Configuration
      • Menu Customization
      • Plugin´s Files
      • Development Portal
        • API Getting Started
        • Events
    • 🛠️ TheItemSkin
      • Home
      • Installation
      • Commands & Permissions
      • Plugin´s Files
      • Templates Skin
      • Development Portal
        • API Getting Started
        • Events
    • 🔴 NameGradient
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Plugin´s Files
      • Format Gradient
      • Development Portal
        • API Getting Started
        • Events
  • FREE PLUGINS
    • 🎁 TheRewards
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Layouts
      • Reward
      • Plugin´s Files
      • Addons
        • VoucherAddon
      • Development Portal
        • API Getting Started
        • Events
        • Addons
    • ✨ TheGlow
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Plugin´s Files
    • 🏷️ TheTags
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Plugin´s Files
      • Tags
    • ♂️ PlayerGender
      • Home
      • Installation
      • Commands & Permissions
      • PlaceholderAPI Support
      • Gender
      • Plugin´s Files
  • Setups
    • 🏃 Parkour Setup
      • Home
      • Installation
      • Frequently Asked Questions
    • ⛏️ Survival Setup
      • Home
      • Installation
      • 🛒 Monetization Guide - Setup Survival
      • Frequently Asked Questions
  • GENERAL
    • ❔ FAQ
    • ⚙️ Items | Custom Items
    • 📙 Support
Powered by GitBook
On this page
  • Introduction
  • Setup
  • Getting an API instance
  • API
  1. PREMIUM PLUGINS
  2. 🔴 NameGradient
  3. Development Portal

API Getting Started

Introduction

NameGradient contains an API

Setup

Replace VERSION with the plugin version

<dependencies>
        <dependency>
            <groupId>xshyo.us</groupId>
            <artifactId>NameGradient</artifactId>
            <version>1.4.3-STABLE</version>
            <scope>provided</scope>
        </dependency>
</dependencies>

In your plugin.yml file you must add as a dependency

depend: [NameGradient]

Getting an API instance

import xshyo.us.thegradient.NameGradientAPI;
import xshyo.us.therewards.NameGradient;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class Example extends JavaPlugin {

    private NameGradientAPI api;    
        
    @Override
    public void onEnable() {
        if (Bukkit.getPluginManager().isPluginEnabled("NameGradient")) {
            this.api = NameGradient.getInstance().getAPI();
        }

        if (this.api != null) {
    
        }
        
    }
}

API


/**
 * Checks if the player is in a preview
 *
 * @param Player The Player instance of the player 
 * @return true If the player is in a preview or false if it is not
 */
 public boolean isInPreview(Player player)
 
/**
 * Checks if a player has a gradient applied in the specified type.
 *
 * @param uuid The unique ID of the player.
 * @param gradientType The type of gradient to check (CHAT or NAME).
 * @return true if the player has a gradient applied in the specified type, false otherwise.
 */
public boolean hasGradientApplied(UUID uuid, GradientType gradientType)

/**
 * Checks if a gradient with the given ID exists for the specified type.
 *
 * @param gradientType The type of gradient (CHAT or NAME) to search in.
 * @param id The ID of the gradient to check.
 * @return true if a gradient with the specified ID exists, false otherwise.
 */
public boolean existsId(GradientType gradientType, String id) 

 /**
  * Retrieves the data of a gradient by its type and ID.
  *
  * @param gradientType The type of gradient (CHAT or NAME) to retrieve data from.
  * @param id The ID of the gradient to get data for.
  * @return A map containing the gradient data, or an empty map if the gradient type is invalid.
  */

public GradientCacheData getGradientData(GradientType gradientType, String id) 

PreviousDevelopment PortalNextEvents

Last updated 1 month ago