13
0

Safe Schematic Node
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Chaos 2022-01-21 20:50:32 +01:00
Ursprung 0591a1c5cc
Commit d42c116f60

Datei anzeigen

@ -24,6 +24,7 @@ import de.steamwar.command.SWCommandUtils;
import de.steamwar.command.TypeMapper;
import de.steamwar.inventory.SWAnvilInv;
import de.steamwar.inventory.SchematicSelector;
import de.steamwar.schematicsystem.SafeSchematicNode;
import de.steamwar.schematicsystem.SchematicSystem;
import de.steamwar.sql.*;
import net.md_5.bungee.api.ChatColor;
@ -407,7 +408,11 @@ public class SchematicCommand extends SWCommand {
player.sendMessage(SchematicSystem.PREFIX + "§cDas gibt nur Fehler, vertrau mir.");
return;
}
node.setParent(newNode.getId());
SafeSchematicNode.Result result = SafeSchematicNode.setParent(user, node, newNode);
if(!result.isSuccessful()) {
result.sendError(player);
return;
}
}
player.sendMessage(SchematicSystem.PREFIX + "§7Die Schematic ist nun unter §e" + node.generateBreadcrumbs(user) + " §7zu finden");
}
@ -422,7 +427,11 @@ public class SchematicCommand extends SWCommand {
if (invalidSchemName(player, new String[]{name})) {
return;
}
node.setName(name);
SafeSchematicNode.Result result = SafeSchematicNode.setName(user, node, name);
if(!result.isSuccessful()) {
result.sendError(player);
return;
}
player.sendMessage(SchematicSystem.PREFIX + "§7Die Schematic heist nun §e" + node.generateBreadcrumbs(user));
}