Dieser Commit ist enthalten in:
Ursprung
174808befc
Commit
a2ccc6ce43
@ -99,7 +99,7 @@ public class SchematicCommand extends SWCommand {
|
|||||||
@Register("list")
|
@Register("list")
|
||||||
@Register({"list", "/"})
|
@Register({"list", "/"})
|
||||||
public void schemList(Player player, @OptionalValue(value = "1", onlyUINIG = true) int page) {
|
public void schemList(Player player, @OptionalValue(value = "1", onlyUINIG = true) int page) {
|
||||||
createCachedSchemList(player, SchematicNode.list(getUser(player), 0), Math.max(page - 1, 0), null, SchematicListBehavior.DEFAULT);
|
createCachedSchemList(player, SchematicNode.list(getUser(player), null), Math.max(page - 1, 0), null, SchematicListBehavior.DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"list", "public"})
|
@Register({"list", "public"})
|
||||||
@ -110,7 +110,7 @@ public class SchematicCommand extends SWCommand {
|
|||||||
@Register({"list", "public"})
|
@Register({"list", "public"})
|
||||||
@Register({"list", "public", "/"})
|
@Register({"list", "public", "/"})
|
||||||
public void schemListPublic(Player player, @OptionalValue(value = "1", onlyUINIG = true) int page) {
|
public void schemListPublic(Player player, @OptionalValue(value = "1", onlyUINIG = true) int page) {
|
||||||
createCachedSchemList(player, SchematicNode.list(SteamwarUser.get(0), 0), Math.max(page - 1, 0), null, SchematicListBehavior.builder().setPublics(true).setPageCommandGen(integer -> "/schem list public " + integer).build());
|
createCachedSchemList(player, SchematicNode.list(SteamwarUser.get(0), null), Math.max(page - 1, 0), null, SchematicListBehavior.builder().setPublics(true).setPageCommandGen(integer -> "/schem list public " + integer).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("list")
|
@Register("list")
|
||||||
@ -272,7 +272,7 @@ public class SchematicCommand extends SWCommand {
|
|||||||
if(SchematicNode.getSchematicNode(schematicNode.getName(), newNode == null ? 0 : newNode.getId()) != null) {
|
if(SchematicNode.getSchematicNode(schematicNode.getName(), newNode == null ? 0 : newNode.getId()) != null) {
|
||||||
schematicNode.setName(schematicNode.getName() + "-" + Instant.now().getEpochSecond() % 1000);
|
schematicNode.setName(schematicNode.getName() + "-" + Instant.now().getEpochSecond() % 1000);
|
||||||
}
|
}
|
||||||
schematicNode.setParent(newNode == null ? 0 : newNode.getId());
|
schematicNode.setParent(newNode == null ? null : newNode.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,16 +318,16 @@ public class SchematicCommandUtils {
|
|||||||
Optional<SchematicNode> currentNode = Optional.empty();
|
Optional<SchematicNode> currentNode = Optional.empty();
|
||||||
for (int i = 0; i < layers.length - minus; i++) {
|
for (int i = 0; i < layers.length - minus; i++) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
List<SchematicNode> nodes = SchematicNode.list(user, currentNode.map(SchematicNode::getId).orElse(0)).stream()
|
List<SchematicNode> nodes = SchematicNode.list(user, currentNode.map(SchematicNode::getId).orElse(null)).stream()
|
||||||
.filter(node -> node.getName().equalsIgnoreCase(layers[finalI]))
|
.filter(node -> node.getName().equalsIgnoreCase(layers[finalI]))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (nodes.isEmpty()) {
|
if (nodes.isEmpty()) {
|
||||||
currentNode = Optional.ofNullable(SchematicNode.byIdAndUser(user, SchematicNode.createSchematicDirectory(user.getId(), layers[i], currentNode.map(SchematicNode::getId).orElse(0)).getId()));
|
currentNode = Optional.ofNullable(SchematicNode.byIdAndUser(user, SchematicNode.createSchematicDirectory(user.getId(), layers[i], currentNode.map(SchematicNode::getId).orElse(null)).getId()));
|
||||||
} else {
|
} else {
|
||||||
if(nodes.stream().anyMatch(SchematicNode::isDir)) {
|
if(nodes.stream().anyMatch(SchematicNode::isDir)) {
|
||||||
currentNode = nodes.stream().filter(SchematicNode::isDir).findFirst();
|
currentNode = nodes.stream().filter(SchematicNode::isDir).findFirst();
|
||||||
} else {
|
} else {
|
||||||
currentNode = Optional.ofNullable(SchematicNode.byIdAndUser(user, SchematicNode.createSchematicDirectory(user.getId(), layers[i] + "-dir-" + System.currentTimeMillis() % 100, currentNode.map(SchematicNode::getId).orElse(0)).getId()));
|
currentNode = Optional.ofNullable(SchematicNode.byIdAndUser(user, SchematicNode.createSchematicDirectory(user.getId(), layers[i] + "-dir-" + System.currentTimeMillis() % 100, currentNode.map(SchematicNode::getId).orElse(null)).getId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren