Adjusts output of blacksmith setting messages

This commit is contained in:
2022-08-08 20:08:39 +02:00
parent 1dea0f6c6a
commit 755db8c497
6 changed files with 77 additions and 13 deletions

View File

@ -47,6 +47,7 @@ public enum NPCSetting {
private final String childPath;
private final Object value;
private final String commandName;
private final String nodeName;
/**
* Instantiates a new setting
@ -61,6 +62,11 @@ public enum NPCSetting {
String[] pathParts = path.split("\\.");
this.childPath = String.join(".", Arrays.copyOfRange(pathParts, 1, pathParts.length));
this.commandName = commandName;
if (pathParts.length > 0) {
this.nodeName = pathParts[pathParts.length - 1];
} else {
this.nodeName = "";
}
}
/**
@ -99,4 +105,13 @@ public enum NPCSetting {
return commandName;
}
/**
* Gets the name of this configuration node
*
* @return <p>The name of this configuration node</p>
*/
public String getNodeName() {
return nodeName;
}
}