Merge pull request 'Fix Schem Delete Member' (#116) from fixes into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #116 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
73cca7675c
@ -37,6 +37,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
@ -272,6 +273,9 @@ public class SchematicCommand extends SWCommand {
|
||||
if (!nodes.isEmpty()) {
|
||||
for (SchematicNode schematicNode : nodes) {
|
||||
SchematicNode newNode = mkdirs(schematicNode.generateBreadcrumbs(user).split("/"), target, 1);
|
||||
if(SchematicNode.getSchematicNode(schematicNode.getName(), newNode == null ? 0 : newNode.getId()) != null) {
|
||||
schematicNode.setName(schematicNode.getName() + "-" + Instant.now().getEpochSecond() % 1000);
|
||||
}
|
||||
schematicNode.setParent(newNode == null ? 0 : newNode.getId());
|
||||
}
|
||||
}
|
||||
|
@ -202,14 +202,7 @@ public class SchematicCommandUtils {
|
||||
}
|
||||
|
||||
player.sendMessage("§7Format: §e" + (node.getSchemFormat() ? ".schem" : ".schematic"));
|
||||
List<CheckedSchematic> checkedSchematics = CheckedSchematic.getLastDeclined(player.getUniqueId());
|
||||
for (CheckedSchematic checkedSchematic : checkedSchematics) {
|
||||
if (checkedSchematic.getSchemName().equals(node.getName()) &&
|
||||
checkedSchematic.getSchemOwner() == node.getOwner()) {
|
||||
player.sendMessage("§cStatus: §c" + checkedSchematic.getStartTime() + " : " + checkedSchematic.getDeclineReason());
|
||||
break;
|
||||
}
|
||||
}
|
||||
CheckedSchematic.getLastDeclinedOfNode(node).stream().findFirst().ifPresent(checkedSchematic -> player.sendMessage("§cStatus: §c" + checkedSchematic.getStartTime() + " : " + checkedSchematic.getDeclineReason()));
|
||||
}
|
||||
List<String> schematicMembers = new ArrayList<>();
|
||||
NodeMember.getNodeMembers(node.getId()).forEach(nodeMember -> schematicMembers.add(SteamwarUser.get(nodeMember.getMember()).getUserName()));
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren