Skip to content

Thorinwasher/ColorBukkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

A library for plugins to request hex colors from users using an intuitive, book-based, in-game selection interface. This is solely meant to be used as an library for other plugins.

Instructions

How to use

Have the plugin in the plugins repository for your server, then you're up and ready.

PAPER IS REQUIRED FOR THIS TO WORK

The API

Maven (note that before compilation, you have to install the plugin locally):

<dependency>
  <groupId>dev.thorinwasher.utils</groupId>
  <artifactId>colorbukkit</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

Get a chatcolor and print it to console. The user will get a book gui popup letting you pick a color

ColorBukkitAPI.getColorFromUser(user, (color) - > {
        Bukkit.getLogger().log(Level.INFO, color.getName());
});

Alternativly chose an initial hue for the user to start with. The hue values are inbetween 0 and 1, if you're using the 360 hue scale, then you need to do (float)hue/360.

ColorBukkitAPI.getColorFromUser(user, 0.5f, (color) - > {
        Bukkit.getLogger().log(Level.INFO, color.getName());
});

That's everything; it does not get simplier than that.

About

A simple yet powerfull colorpicker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages