changed pixelblock item and added item to recipe book

This commit is contained in:
2024-08-31 19:58:57 +02:00
parent 2ad3f135c3
commit e35145f8ed
5 changed files with 84 additions and 27 deletions

View File

@@ -0,0 +1,22 @@
package eu.mhsl.minecraft.pixelblocks.utils;
import com.destroystokyo.paper.profile.PlayerProfile;
import com.destroystokyo.paper.profile.ProfileProperty;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import java.util.UUID;
public class HeadUtil {
public static ItemStack getCustomTextureHead(String base64) {
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) head.getItemMeta();
PlayerProfile profile = Bukkit.createProfile(UUID.randomUUID(), "");
profile.setProperty(new ProfileProperty("textures", base64));
meta.setPlayerProfile(profile);
head.setItemMeta(meta);
return head;
}
}