[SPIGOT-3348] Skin cache fix Created: 17/Jun/17  Updated: 11/Dec/17  Resolved: 18/Jun/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Kostya Assignee: md_5
Resolution: Fixed Votes: 1
Labels: cache, skin
Environment:

1.11.2



 Description   

Current skinCache in TileEntitySkull has small issue. It searches skin for skull and writes it in cache with pair of name-gameprofile.

Issue is really small. It searches in cache with normal nick name, and if skin not found, it lookups for the skin and writes it with lower cased name!

To fix skin cache you need:

  1. Go to TileEntitiSkull
  2. Search for method ` public static void b(final GameProfile gameprofile, final Predicate<GameProfile> callback) { `
  3. Find line with `final GameProfile profile = skinCache.getUnchecked(gameprofile.getName().toLowerCase());`
  4. Change this line to `final GameProfile profile = skinCache.getUnchecked(gameprofile.getName());`

And skin cache will be fixed! No more workarounds for heads!

 

p.s. version copied from another issue. I don't see fix here:

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse/CraftBukkit-Patches/0092-Convert-player-skulls-async.patch

So, i reported about this. Sorry for bad english.



 Comments   
Comment by Black Hole [ 17/Jun/17 ]

A better fix would be to always search by lower case. (And fix the toLowerCase() to always use the same locale.)

Comment by Kostya [ 17/Jun/17 ]

Oh, yes! You must make some fixes in CraftMetaSkull in setOwner method.

This: profile = TileEntitySkull.skinCache.getIfPresent(name.toLowerCase(java.util.Locale.ROOT));

must be: profile = TileEntitySkull.skinCache.getIfPresent(name);

Generated at Tue Apr 15 11:10:31 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.