UUIDAPI - Offline UUID Build 2

API for Developers to get UUID from an offline player name.

  1. Gober
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    Source Code:
    https://github.com/JyckoS/UUIDAPI
    UUIDAPI
    When I make some private projects, I think that it would be great to add some features like offline payment or, offline whatever. So it came in my mind to make some UUID API to help me and developers to get UUID from a name and vice versa.

    Code (Java):
    public boolean checkUUIDAPI() {
            boolean enabled = Bukkit.getServer().getPluginManager().isPluginEnabled("UUIDAPI");
            if (!enabled) {
                // Warn
                this.setEnabled(false);
           
            }
            return enabled;
    }
    Code (YAML):
    #
    # Add softdepend: [UUIDAPI] to it.
    #
    # If you want to add multiple dependencies, incase you haven't
    # understand yet, use

    # softdepend: [UUIDAPI, Whatplugin, Plugin2] etc
    softdepend
    : [UUIDAPI]
     
    Code (Java):

    public class ExampleUsage {
        public void setOfflineSomeThing(String name) {
            UUID uuid = UUIDAPI.getUUID(name); // Get UUID
            if (uuid == null) { // Player never existed
                    return;
            }
            OfflinePlayer ofp = Bukkit.getOfflinePlayer(uuid);
            String name = ofp.getName(); // Etc..
            /*Get file of player*/File file = new File(this.getDataFolder(), "data" + File.separator + uuid.toString() + ".yml");
            YamlConfiguration yml = YamlConfiguration.loadConfiguration(file);
            /*
             * TODO
             * Do something
             */

      }
    }
     
    UUIDAPI#getName
    UUIDAPI#getUUID

    Icon by Smashicons
    TomCreeper and Govindas like this.

Recent Updates

  1. Added getAllUUID and getAllnames

Recent Reviews

  1. Esterreicher
    Esterreicher
    5/5,
    Version: Build 2
    Very nice! Like it a lot
    -------------------------------------------------------
    1. Gober
      Author's Response
      Thanks for the review Esterreicher ^-^