Sjouwer / pick-block-pro

An advanced client side Block, Entity, NBT, Tool and ID picker for minecraft
https://modrinth.com/mod/pick-block-pro
GNU Lesser General Public License v3.0
9 stars 5 forks source link

Suggestion: get heads from the GameProfile #5

Closed Zailer43 closed 2 years ago

Zailer43 commented 2 years ago

https://github.com/Sjouwer/pick-block-pro/blob/e0e2bde34d8b9ff8eaf2feb337ae6bdfac06f6df/src/main/java/io/github/sjouwer/pickblockpro/picker/BlockPicker.java#L96-L99 If instead of obtaining the head from the username you obtain it from the GameProfile you can have better compatibility in case it is a non-premium server and users use skin with /skin

item = new ItemStack(Items.PLAYER_HEAD);
NbtCompound skullOwner = new NbtCompound();
NbtHelper.writeGameProfile(skullOwner, player.getGameProfile());
item.setSubNbt(SkullItem.SKULL_OWNER_KEY, skullOwner);
Sjouwer commented 2 years ago

Thank you for the suggestion, that sounds like a good idea. I will implement that soon, or if you like you can also make a PR for it.