13
0
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-11-27 10:41:47 +01:00
Ursprung c22109daa9
Commit 82fb26592c
2 geänderte Dateien mit 10 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -44,6 +44,11 @@ public class GUI {
private static void list(Player player) { private static void list(Player player) {
SchematicSelector selector = new SchematicSelector(player, SchematicSelector.selectSchematic(), new SchematicSelectorInjectable() { SchematicSelector selector = new SchematicSelector(player, SchematicSelector.selectSchematic(), new SchematicSelectorInjectable() {
@Override
public String createTitle(Player player) {
return "Schematic GUI: {1}";
}
@Override @Override
public void onListRender(SchematicSelector selector, SWListInv<SchematicNode> inv, SchematicNode parent) { public void onListRender(SchematicSelector selector, SWListInv<SchematicNode> inv, SchematicNode parent) {
if(parent == null) { if(parent == null) {
@ -54,11 +59,8 @@ public class GUI {
}); });
} }
} }
}, node -> { }, node -> info(player, node));
info(player, node);
});
selector.setSingleDirOpen(false); selector.setSingleDirOpen(false);
selector.setTitle(player1 -> "Schematic GUI: {1}");
selector.open(); selector.open();
} }

Datei anzeigen

@ -405,11 +405,6 @@ public class SchematicCommand extends SWCommand {
return; return;
} }
if(SchematicNode.getAllParentsOfNode(node).contains(node)) {
player.sendMessage(SchematicSystem.PREFIX + "§cDas kann nur Fehler machen, vertrau mir!");
return;
}
if (name.equals("/")) { if (name.equals("/")) {
node.setParent(0); node.setParent(0);
} else { } else {
@ -418,6 +413,10 @@ public class SchematicCommand extends SWCommand {
String[] layers = name.split("/"); String[] layers = name.split("/");
if (invalidSchemName(player, layers)) return; if (invalidSchemName(player, layers)) return;
SchematicNode newNode = mkdirs(layers, user, 0); SchematicNode newNode = mkdirs(layers, user, 0);
if(SchematicNode.getAllParentsOfNode(newNode).contains(node)) {
player.sendMessage(SchematicSystem.PREFIX + "§cDas kann nur Fehler machen, vertrau mir!");
return;
}
node.setParent(newNode.getId()); node.setParent(newNode.getId());
} }
player.sendMessage(SchematicSystem.PREFIX + "§7Die Schematic ist nun unter §e" + node.generateBreadcrumbs(user) + " §7zu finden"); player.sendMessage(SchematicSystem.PREFIX + "§7Die Schematic ist nun unter §e" + node.generateBreadcrumbs(user) + " §7zu finden");