Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

+ Support for CustomModelData on wands #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/de/False/BuildersWand/items/Wand.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Wand

private String name;
private Material material;
private int customModelData = -1;

private boolean craftingEnabled;
private boolean craftingShapeless;
Expand Down Expand Up @@ -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() + "");

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down