Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jul 8, 2020. It is now read-only.

MC-API/uuid-java

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uuid-java Build Status

A Java implementation of the mc-api.net API.

Bugs and Issues

If you encounter any issues or bugs with our services or this library, please report them here.

Custom Handlers

A handler decides how a uuid or username is obtained. The default handler will just query the API and then cache the result. However you can create your own, custom handler.

There are two premade for Bukkit/Spigot and BungeeCord:

  • Bukkit Handler: Checks if player is online or has played before, before querying API
  • Bungee Handler: Checks if player is online before querying API

Just implement these somewhere within your project and then set it as the active handler using this example (example is for the BungeeHandler.

UUIDAPI.setHandler(new BungeeHandler());

We suggest you put it in the package: net.mcapi.uuid.handlers

Implementation

Setting request server

MC-API has multiple mirrors, you can choose your mirror like so:

UUIDAPI.setRegion(ServerRegion)

A list of mirrors can be found here. The default mirror is set to US.

Usage examples:

Username to UUID

UUID uuid = UUIDAPI.getUUID("AeroPvP");

Would return the UUID object for AeroPvP.

You can also get a string alternative (which does not contain hyphens)

String uuid = UUIDAPI.getUUIDString("AeroPvP");

UUID to Username

String playerName = UUIDAPI.getUsername("a8889e3068b84ce8963f4ea259c3ebe3");

Would return:

njb_said

Errors

If the given username or UUID is invalid, NULL would be returned!

Compilation

To compile just run mvn clean package or download the latest build from build.mc-api.net

Maven Repository

There is a maven repository at build.mc-api.net/plugin/repository/everything

Maven Configuration:

    <repositories>
        <repository>
            <id>mcapi</id>
            <url>http://build.mc-api.net/plugin/repository/everything/</url>
        </repository>
    </repositories>
    
    <dependencies>
        <dependency>
            <groupId>net.mcapi.uuid</groupId>
            <artifactId>uuid-java</artifactId>
            <version>1.1.3</version>
        </dependency>
    </dependencies>

About

[Deprecated] Java UUID API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.