diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/skilltree/SkillTreeViewer.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/skilltree/SkillTreeViewer.java index 40df148a..4c3a0305 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/skilltree/SkillTreeViewer.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/skilltree/SkillTreeViewer.java @@ -345,6 +345,10 @@ public class SkillTreeViewer extends EditableInventory { if (skillTree.isNode(coordinates)) { SkillTreeNode node = skillTree.getNode(coordinates); + //If the node has its own display, it will be shown. + if(node.getItem()!=null) + return new Icon(node.getItem(),node.getCustomModelData()); + NodeType nodeType = NodeType.getNodeType(hasNorthPath, hasEastPath, hasSouthPath, hasWestPath); return icons.get(new NodeDisplayInfo(nodeType, playerData.getNodeState(node))); } else { diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java index 81b25a98..7a5f1636 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java @@ -11,6 +11,7 @@ import net.Indyuce.mmocore.gui.api.item.Placeholders; import net.Indyuce.mmocore.skilltree.tree.SkillTree; import org.apache.commons.lang.Validate; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -21,6 +22,9 @@ import java.util.*; public class SkillTreeNode implements ExperienceObject { private final SkillTree tree; private final String name, id; + + private Material item; + private int customModelData; private IntegerCoordinates coordinates; /** * The number of skill tree points this node requires. @@ -57,6 +61,9 @@ public class SkillTreeNode implements ExperienceObject { Validate.notNull(config, "Config cannot be null"); this.id = config.getName(); this.tree = tree; + if(config.contains("item")) + item = Material.valueOf(config.getString("item")); + customModelData= config.getInt("custom-model-data",0); name = Objects.requireNonNull(config.getString("name"), "Could not find node name"); size = Objects.requireNonNull(config.getInt("size")); isRoot = config.getBoolean("is-root", false); @@ -84,6 +91,14 @@ public class SkillTreeNode implements ExperienceObject { return tree; } + public Material getItem() { + return item; + } + + public int getCustomModelData() { + return customModelData; + } + public void setIsRoot() { isRoot = true; }