{"id":13408099,"url":"https://github.com/EngineHub/SquirrelID","last_synced_at":"2025-03-14T12:32:02.316Z","repository":{"id":19268179,"uuid":"22504455","full_name":"EngineHub/SquirrelID","owner":"EngineHub","description":"Mojang profile / UUID lookup and last known UUID -\u003e name cache Java library","archived":false,"fork":false,"pushed_at":"2023-03-23T15:14:49.000Z","size":285,"stargazers_count":53,"open_issues_count":1,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-14T01:50:35.124Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EngineHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"enginehub"}},"created_at":"2014-08-01T09:59:22.000Z","updated_at":"2023-10-13T17:50:29.000Z","dependencies_parsed_at":"2023-09-26T00:48:11.503Z","dependency_job_id":null,"html_url":"https://github.com/EngineHub/SquirrelID","commit_stats":{"total_commits":60,"total_committers":7,"mean_commits":8.571428571428571,"dds":0.4,"last_synced_commit":"a38de28edab88fabb564bbad8dc357e7b83dce61"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineHub%2FSquirrelID","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineHub%2FSquirrelID/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineHub%2FSquirrelID/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineHub%2FSquirrelID/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EngineHub","download_url":"https://codeload.github.com/EngineHub/SquirrelID/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243456651,"owners_count":20293907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:00:50.743Z","updated_at":"2025-03-14T12:32:02.274Z","avatar_url":"https://github.com/EngineHub.png","language":"Java","readme":"![SquirrelID](squirrelid-header.png)\n==========\n\nSquirrelID is a Java library for working with Mojang profiles.\n\n* The resolution of UUIDs from player names in bulk.\n* The Resolution of player names from UUIDs in bulk.  \n* \"Last seen\" UUID -\u003e name cache implementations.\n  * Available as SQLite-backed, MySQL-backed, or in-memory.\n* Thread-safe implementations.\n* Optional parallel fetching of UUIDs from player names.\n\nUsage\n-----\n\n#### Resolver\n\n```java\nProfileService resolver = HttpRepositoryService.forMinecraft();\nProfile profile = resolver.findByName(\"Notch\"); // May be null\n```\n\nOr in bulk:\n\n```java\nImmutableList\u003cProfile\u003e profiles = resolver.findAllByName(Arrays.asList(\"Notch\", \"jeb_\"));\n```\n\nAnd in parallel:\n\n```java\nint nThreads = 2; // Be kind\nProfileService resolver = HttpRepositoryService.forMinecraft();\nParallelProfileService service = new ParallelProfileService(resolver, nThreads);\nservice.findAllByName(Arrays.asList(\"Notch\", \"jeb_\"), new Predicate\u003cProfile\u003e() {\n    @Override\n    public boolean apply(Profile input) {\n        // Do something with the input\n        return false;\n    }\n});\n```\n\n#### UUID -\u003e Profile Cache\n\nChoose a cache implementation:\n\n```java\nFile file = new File(\"cache.sqlite\");\nSQLiteCache cache = new SQLiteCache(file);\n```\n\nStore entries:\n\n```java\nUUID uuid = UUID.fromString(\"069a79f4-44e9-4726-a5be-fca90e38aaf5\");\ncache.put(new Profile(uuid, \"Notch\"));\n```\n\nGet the last known profile:\n\n```java\nProfile profile = cache.getIfPresent(uuid); // May be null\n```\n\nBulk get last known profile:\n\n```java\nImmutableMap\u003cUUID, Profile\u003e results = cache.getAllPresent(Arrays.asList(uuid));\nProfile profile = results.get(uuid); // May be null\n```\n\n#### Combined Resolver + Cache\n\nCache all resolved names:\n\n```java\nProfileCache cache = new HashMapCache(); // Memory cache\n\nCacheForwardingService resolver = new CacheForwardingService(\n        HttpRepositoryService.forMinecraft(),\n        cache);\n\nProfile profile = resolver.findByName(\"Notch\");\nProfile cachedProfile = cache.getIfPresent(profile.getUniqueId());\n```\n\nAs a dependency\n---------------\n\nNote: We recommend shading or shadowing in SquirrelID for distribution, **relocating** the `org.enginehub.squirrelid` package to an internal package without your project.\n\n#### Maven\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003eenginehub-repo\u003c/id\u003e\n        \u003curl\u003ehttps://maven.enginehub.org/repo/\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.enginehub\u003c/groupId\u003e\n        \u003cartifactId\u003esquirrelid\u003c/artifactId\u003e\n        \u003cversion\u003e0.3.0\u003c/version\u003e\n        \u003cscope\u003ecompile\u003c/scope\u003e\n        \u003ctype\u003ejar\u003c/type\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n#### Gradle\n\n```groovy\nrepositories {\n    maven { url \"https://maven.enginehub.org/repo/\" }\n}\n\ndependencies {\n    compile 'org.enginehub:squirrelid:0.3.0'\n}\n```\n\nCompiling\n---------\n\nUse Gradle to compile SquirrelID.\n\n    gradlew build\n\nSome of the unit tests are actually integration tests and therefore make\ncontact with Mojang's servers. That means that the tests may take a\nnon-trivial amount of time to complete and may even fail if the Mojang\nprofile servers are unreachable. In the future, these tests may be moved\nso that this becomes no longer an issue.\n\nYou can disable tests with:\n\n    gradlew -x test build\n\nContributing\n------------\n\nSquirrelID is available under the GNU Lesser General Public License.\n\nWe happily accept contributions, especially through pull requests on GitHub.\n\nLinks\n-----\n\n* [Visit our website](https://enginehub.org/)\n* [Discord Guild](https://discord.gg/enginehub)\n","funding_links":["https://github.com/sponsors/enginehub"],"categories":["Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEngineHub%2FSquirrelID","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEngineHub%2FSquirrelID","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEngineHub%2FSquirrelID/lists"}