fixed crafting advancement and crafting bug

This commit is contained in:
2024-12-29 16:33:38 +01:00
parent 224f4a9f1e
commit e45bbfc07b
3 changed files with 35 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ public class PixelBlockItem {
public static final NamespacedKey recipeKey = new NamespacedKey(Main.plugin(), "pixelblock");
public static NamespacedKey idProperty = new NamespacedKey(Main.plugin(), "id");
public static NamespacedKey ownerProperty = new NamespacedKey(Main.plugin(), "owner");
public static UUID emptyBlockUUID = UUID.fromString("98fdf0ae-c3ab-4ef7-ae25-efd518d600de");
public static final String itemTexture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQ" +
"ubmV0L3RleHR1cmUvYzE5NGU5ZTc3NTdkMDZkNmY1ZTViZTg0NTQ4YTdjYjUyMTczZDY4Y2NmODAyZDIxMTI3NWQzMWNkYmEwYTA2ZSJ9fX0=";
@@ -68,12 +69,13 @@ public class PixelBlockItem {
ItemStack item = HeadUtil.getCustomTextureHead(itemTexture);
ItemMeta meta = item.getItemMeta();
meta.setMaxStackSize(1);
meta.itemName(Component.text(emptyBlockUUID.toString()));
meta.displayName(Component.text("Leerer Pixelblock"));
meta.lore(List.of(
Component.text("Der erste Spieler, der den Block platziert wird zum Besitzer des Blocks."),
Component.text("Klicke auf den gesetzten Block, um diesen zu bearbeiten!")
));
meta.getPersistentDataContainer().set(idProperty, PersistentDataType.STRING, UUID.randomUUID().toString());
meta.getPersistentDataContainer().set(idProperty, PersistentDataType.STRING, emptyBlockUUID.toString());
item.setItemMeta(meta);
return item;
}