-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix XSkull#applySkin with name or UUID inputs (#254) #256
Fix XSkull#applySkin with name or UUID inputs (#254) #256
Conversation
- Add support for offline-mode servers - Implement asynchronous texture fetching option - Remove MOJANG_SHA_FAKE_ID_ENUMERATOR to prevent item stacking issues after restarts (UUIDs are now generated using texture hashes) - Store UUIDs in usercache.json and cache textures on first request - Ensure cached textures remain consistent across plugin interactions
I think we need to make an inner class that makes dynamically configurable requests like ParticleDisplay. Or we could just use the XSkull class itself instead of creating a new inner class. public static Builder of(ItemStack item) { return new Builder(item); }
public static final class Builder {
private ItemStack item;
private SkullMeta meta;
private SkullValue value;
private GameProfile defaultValue = DEFAULT_PROFILE; // Or maybe a default SkullValue instead.
private boolean propagateError = false;
public Builder propogateError() {
this.propogateError = true;
return this;
}
public Builder fromString(String string) {
value = /* detect it */;
return this;
}
public Builder fromUsername(String name) {
// fromUUID, fromBase64 etc
value = new SkullValue(ValueType.NAME, name);
return this;
}
public SkullMeta apply() {
return applySkin(meta, value); // should make a separate method for this
}
public CompletableFuture<SkullMeta> applyAsync() {
return CompletableFuture.supplyAsync(this::apply, PROFILE_EXECUTOR);
}
} Also, which versions did you test this with? It should support 1.8+ |
37aafb0
to
715d905
Compare
I made it more configurable and moved it into a separate package. It now logs exceptions using the debug level. So far, I've tested it on 1.8.9, 1.12.2, 1.19.4, and 1.20.4. I still need to document it and check for any additional remaps |
- Fix `XSkull.TEXTURES` constant (old clients require the HTTP protocol to render properly). - Add 1.8 remap for MinecraftServer getter. - Remove `XSkull.applySkin` in favor of `XSkull#of`. - Remove cache for profiles generated from base64. - Log exceptions using debug level.
715d905
to
44f6b74
Compare
Thank you very much! I'll have to test this a little and see if more changes are needed. |
Additions
Changes
Fixes