13
0

member parent
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
Chaoscaot 2022-04-16 10:39:45 +02:00
Ursprung 73cca7675c
Commit cd401a389e

Datei anzeigen

@ -432,7 +432,8 @@ public class SchematicCommand extends SWCommand {
@Register("move")
public void move(Player player, SchematicNode node, @Mapper("dirStringMapper") String name) {
SteamwarUser user = getUser(player);
if (node.getOwner() != user.getId()) {
NodeMember member = NodeMember.getNodeMember(node.getId(), user.getId());
if (node.getOwner() != user.getId() && member == null) {
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst nur deine eigenen Schems verschieben.");
return;
}
@ -445,14 +446,18 @@ public class SchematicCommand extends SWCommand {
String[] layers = name.split("/");
if (invalidSchemName(player, layers)) return;
SchematicNode newNode = mkdirs(layers, user, 0);
if(SchematicNode.getAllParentsOfNode(newNode).contains(node)) {
player.sendMessage(SchematicSystem.PREFIX + "§cDas gibt nur Fehler, vertrau mir.");
return;
}
SafeSchematicNode.Result result = SafeSchematicNode.setParent(user, node, newNode);
if(!result.isSuccessful()) {
result.sendError(player);
return;
if(node.getOwner() == user.getId()) {
if(SchematicNode.getAllParentsOfNode(newNode).contains(node)) {
player.sendMessage(SchematicSystem.PREFIX + "§cDas gibt nur Fehler, vertrau mir.");
return;
}
SafeSchematicNode.Result result = SafeSchematicNode.setParent(user, node, newNode);
if(!result.isSuccessful()) {
result.sendError(player);
return;
}
} else {
member.setParentNode(newNode == null ? null : node.getId());
}
}
player.sendMessage(SchematicSystem.PREFIX + "§7Die Schematic ist nun unter §e" + node.generateBreadcrumbs(user) + " §7zu finden");