Format code

This commit is contained in:
2026-05-16 23:08:09 +02:00
parent 81dd8045f2
commit d110df924e
562 changed files with 11025 additions and 10059 deletions
@@ -28,22 +28,22 @@ import org.bukkit.entity.Player;
public class SafeSchematicNode {
public static Result setParent(@NonNull SteamwarUser user, @NonNull SchematicNode node, SchematicNode newParent) {
if(user.getId() != node.getOwner()) {
if (user.getId() != node.getOwner()) {
return Result.NOT_OWNER;
}
if(newParent == null) {
if(SchematicNode.list(user, null)
if (newParent == null) {
if (SchematicNode.list(user, null)
.stream().map(SchematicNode::getName).anyMatch(s -> s.equalsIgnoreCase(node.getName()))) {
return Result.ALREADY_IN_DIRECTORY;
}
node.setParent(null);
} else {
if(!newParent.isDir()) {
if (!newParent.isDir()) {
return Result.NOT_A_DIR;
}
if(SchematicNode.list(user, newParent.getId())
if (SchematicNode.list(user, newParent.getId())
.stream().map(SchematicNode::getName).anyMatch(s -> s.equalsIgnoreCase(node.getName()))) {
return Result.ALREADY_IN_DIRECTORY;
}
@@ -54,15 +54,15 @@ public class SafeSchematicNode {
}
public static Result setName(@NonNull SteamwarUser user, @NonNull SchematicNode node, @NonNull String name) {
if(user.getId() != node.getOwner()) {
if (user.getId() != node.getOwner()) {
return Result.NOT_OWNER;
}
if(SchematicNode.invalidSchemName(new String[]{name})) {
if (SchematicNode.invalidSchemName(new String[]{name})) {
return Result.INVALID_NAME;
}
if(SchematicNode.list(user, node.getParent()).stream().map(SchematicNode::getName).anyMatch(s -> s.equalsIgnoreCase(name))) {
if (SchematicNode.list(user, node.getParent()).stream().map(SchematicNode::getName).anyMatch(s -> s.equalsIgnoreCase(name))) {
return Result.ALREADY_IN_DIRECTORY;
}