From 4c3ae80c6113a067b3b7d877463edeb2b5966d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Pustoslem=C5=A1ek?= Date: Tue, 27 Oct 2020 16:58:08 +0100 Subject: [PATCH] + Support for CustoModelData on wands --- src/main/java/de/False/BuildersWand/items/Wand.java | 7 +++++++ .../java/de/False/BuildersWand/manager/WandManager.java | 1 + 2 files changed, 8 insertions(+) diff --git a/src/main/java/de/False/BuildersWand/items/Wand.java b/src/main/java/de/False/BuildersWand/items/Wand.java index 53523ad..1d4bb9b 100644 --- a/src/main/java/de/False/BuildersWand/items/Wand.java +++ b/src/main/java/de/False/BuildersWand/items/Wand.java @@ -17,6 +17,7 @@ public class Wand private String name; private Material material; + private int customModelData = -1; private boolean craftingEnabled; private boolean craftingShapeless; @@ -59,6 +60,10 @@ public ItemStack getRecipeResult() itemMeta.setLore(lore); } + if(customModelData != -1){ + itemMeta.setCustomModelData(customModelData); + } + buildersWand.setItemMeta(itemMeta); buildersWand = nms.setTag(buildersWand, "uuid", UUID.randomUUID() + ""); @@ -225,6 +230,8 @@ public void setDurabilityText(String durabilityText) this.durabilityText = durabilityText; } + public void setCustomModelData(int customModelData) { this.customModelData = customModelData; } + public boolean isInventoryEnabled() { return inventoryEnabled; diff --git a/src/main/java/de/False/BuildersWand/manager/WandManager.java b/src/main/java/de/False/BuildersWand/manager/WandManager.java index 13eb0e0..9a14f82 100644 --- a/src/main/java/de/False/BuildersWand/manager/WandManager.java +++ b/src/main/java/de/False/BuildersWand/manager/WandManager.java @@ -64,6 +64,7 @@ private Wand getWand(String key) wand.setParticleCount(config.getInt(configPrefix + "particles.count")); wand.setInventoryEnabled(config.getBoolean(configPrefix + "storage.enabled")); wand.setInventorySize(config.getInt(configPrefix + "storage.size")); + wand.setCustomModelData(config.getInt(configPrefix + "customModelData", -1)); if(config.isSet(configPrefix + "permission")) {