fix: translate to UUID
This commit is contained in:
parent
50d42549de
commit
f3284d3c05
1 changed files with 5 additions and 3 deletions
|
@ -5,12 +5,14 @@ import de.studiocode.invui.item.builder.SkullBuilder;
|
||||||
import de.studiocode.invui.item.impl.AsyncItem;
|
import de.studiocode.invui.item.impl.AsyncItem;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class SkinPlaceholder extends AsyncItem {
|
public class SkinPlaceholder extends AsyncItem {
|
||||||
public SkinPlaceholder(String name) {
|
public SkinPlaceholder(String name) {
|
||||||
super(new ItemBuilder(Material.PAINTING).setDisplayName("§7§oLoading..."), () -> {
|
super(new ItemBuilder(Material.PAINTING).setDisplayName("§7§oLoading..."), () -> {
|
||||||
System.out.println("name = " + name);
|
String uuid = name.replaceAll("(.{8})(.{4})(.{4})(.{4})(.+)", "$1-$2-$3-$4-$5");
|
||||||
final SkullBuilder skull = new SkullBuilder(name);
|
final SkullBuilder skull = new SkullBuilder(UUID.fromString(uuid));
|
||||||
skull.setDisplayName(name);
|
skull.setDisplayName("Skin");
|
||||||
skull.addLoreLines("§7Click to invalidate skin");
|
skull.addLoreLines("§7Click to invalidate skin");
|
||||||
return skull;
|
return skull;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue