CryptoMorin / XSeries

Library for cross-version Minecraft Bukkit support and various efficient API methods.
https://www.spigotmc.org/threads/378136/
MIT License
390 stars 128 forks source link

[XSkull] Legacy support #274

Closed Condordito closed 3 months ago

Condordito commented 3 months ago

This PR fixes #273 and some other minor bugs

Changes

CryptoMorin commented 3 months ago

Btw, I forgot this, but I'm not sure why you removed public static final Deque<GameProfile> UserCache_gameProfiles;

That is present in older versions and is still considered a part of the cache.

I will add back UserCacheEntry_setLastAccess because we are still modifying a cache. You can't just remove this just because it doesn't exist in older versions.

Condordito commented 3 months ago

@CryptoMorin

public static final Deque UserCache_gameProfiles; That is present in older versions and is still considered a part of the cache.

I will add back UserCacheEntry_setLastAccess because we are still modifying a cache. You can't just remove this just because it doesn't exist in older versions.

MojangAPI#cacheProfile already handles this when calling the server implementation. Should it also increase the last access field when reading from it? It's not present in all versions and it might not have any side effects

1.8.8

Screenshot 2024-06-22 at 1 39 51 AM

1.20.6

Screenshot 2024-06-22 at 1 42 50 AM Screenshot 2024-06-22 at 1 42 45 AM
CryptoMorin commented 3 months ago

Oh I see, my bad. I added the Deque just to remove from it which is not needed anymore. I'm not sure of any current side effects of setLastAccess() either (except for usercache.json order), but since we're using the cache, let's just keep it consistent.