API Documentation

Introduction

This is the API Documentation page. You'll find helpful coding tips related to this plugin's api support here.

Note that you'll need to include a copy of this plugin's jarfile in your project's build path to be able to use the code.

Required Code

The following code is required for the api implementation in your project to function properly:

import com.gmail.br45entei.uuidmasterlist.UUIDMasterList

@Override
public void onEnable() {//Or whatever function suits your needs
boolean uuidPluginAvailable = (Bukkit.getServer().getPluginManager().getPlugin("UUIDMasterList") != null);
if (uuidPluginAvailable) {
//code here
//Type in "UUIDMasterList." to see a list of available functions in eclipse, or see the api documentation below.
}
}

UUID Conversion

No matter what you do, it is very likely you'll be having to deal with player uuid to player name conversion issues at some point. With this plugin, your life gets made easier by doing everything for you in one little function to fit your needs.

UUIDMasterList.getPlayerNameFromUUID(UUID uuid)

This function allows you to do just that - get the player's name from their uuid. One current drawback, however, is that if the player in question has never been on the server before, this function will return an empty string(""). One upside to this is that if the player has been online at some point(and this plugin was installed at the time), then you can get the player's name from their UUID at any time, forever, even if they have logged off. The next time they log in, if they changed their username, this plugin automatically updates the internal list to that change so that you don't have to worry about "JoeBob" logging out and logging back in as "BillyMan" with the same account - the UUID remains the same, so the player handle remains the same.

UUIDMasterList.getPlayerNameFromUUID(String uuid)

This function is a convenience function that does the exact same thing as the above function.

UUIDMasterList.getPlayerUUIDList()

This function returns the list itself - that is, an ArrayList<String[]> of all of the players' UUIDs and their usernames who have ever logged in(with this plugin installed). This useful because it can be used to iterate over a list of players who have ever logged into the server, allowing you to see and use that information for anything you like. This function can be used for some of the upcoming functions as well.

UUIDMasterList.getUUIDIndexInUUIDList(UUID uuid(Or String uuid or Player player))

Have you ever wanted to get the int location of an item or player in an ArrayList before? Well, with this plugin's list and this function, you can! This is useful for manually getting a player's username(or the player) directly from the list via list.get(index), but you could just use the getPlayerNameFromUUID functions mentioned above for that, so I'll leave this one's external purposes up to you to brainstorm and use :)

Want more features? Have a suggestion? Have a question? Don't hesitate to comment! I'd love to help you guys out in any way possible!


Comments

Posts Quoted:
Reply
Clear All Quotes