GithubHelp home page GithubHelp logo

arcaniax-development / headdatabase-api Goto Github PK

View Code? Open in Web Editor NEW
33.0 2.0 5.0 528 KB

API for the famous HeadDatabase plugin

Home Page: https://www.spigotmc.org/resources/14280/

License: GNU General Public License v3.0

Java 100.00%
spigot hdb headdb heads headdatabase plugin minecraft

headdatabase-api's Introduction


Head Database is a fast and user-friendly plugin that allows you to obtain thousands of custom Minecraft skulls that feature unique designs. This easy-to-use heads plugin gives you access to creative designing opportunities that overall enhances the quality of your builds, and gives creative freedom to yourself and your players.

This is the API repository for HeadDatabase. This is not HeadDatabase. If you are looking for the plugin HeadDatabase, get it from spigot.

Links

How to use the API

Releases are published to the central repository, snapshots are published to S01 OSS Sonatype.

Gradle

repositories {
    mavenCentral()
}

dependencies {
    compileOnly("com.arcaniax:HeadDatabase-API:1.3.2")
}

Maven

<!-- HeadDatabase-API -->
<dependency>
    <groupId>com.arcaniax</groupId>
    <artifactId>HeadDatabase-API</artifactId>
    <version>1.3.2</version>
    <scope>provided</scope>
</dependency>

Building

Gradle is the recommended way to build the project. Use ./gradlew build in the main project directory to build the project.

Suggestions

Suggestions are welcome! We have a separate issue form for suggestions, that can be found here.

Example usage

import me.arcaniax.hdb.api.DatabaseLoadEvent;
import me.arcaniax.hdb.api.HeadDatabaseAPI;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public class HeadDatabaseAPIPlugin extends JavaPlugin implements Listener {

    public void onEnable() {
        this.getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onDatabaseLoad(DatabaseLoadEvent e) {
        HeadDatabaseAPI api = new HeadDatabaseAPI();
        try {
            ItemStack item = api.getItemHead("7129");
            getLogger().info(api.getItemID(item));
        } catch (NullPointerException nullPointerException) {
            getLogger().info("Could not find the head you were looking for");
        }
    }
}

Tips:

  • Don't forget to add HeadDatabase to depend or softdepend section of your plugin.yml
  • Listen to DatabaseLoadEvent and register your events afterwards. The event is fired once HeadDatabase is loaded successfully.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.