SteamWar/SpigotCore
Archiviert
13
0

Schematic Nodes #90

Zusammengeführt
Lixfel hat 48 Commits von schematic-node nach master 2021-11-20 13:12:32 +01:00 zusammengeführt
Nur Änderungen aus Commit cffb8798e1 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -296,7 +296,7 @@ public class SchematicNode {
updateDB();
}
public int getParent() {
public Integer getParent() {
return parent;
}
@ -367,13 +367,28 @@ public class SchematicNode {
return NodeMember.getNodeMembers(id);
}
public String generateBreadcrumbs() {
return generateBreadcrumbs("/");
}
public String generateBreadcrumbs(String split) {
StringBuilder builder = new StringBuilder(getName());
SchematicNode currentNode = this;
while (currentNode.parent != null) {
currentNode = currentNode.getParentNode();
builder.insert(0, split)
.insert(0, currentNode.getName());
}
return builder.toString();
}
private void updateDB() {
SQL.update("UPDATE SchematicNode SET NodeName = ?, NodeOwner = ?, ParentNode = ?, NodeItem = ?, NodeType = ?, NodeRank = ? WHERE NodeId = ?",
name, owner, parent == 0?null:parent, item, type, rank, id);
name, owner, parent == 0 ? null : parent, item, type, rank, id);
}
public void delete() {
if(isDir()) {
if (isDir()) {
getSchematicNodeInNode(getId()).forEach(SchematicNode::delete);
}
SQL.update("DELETE FROM SchematicNode WHERE NodeId = ?", id);