From f51de58921ecce5576cd82fdd42f5bd291bf4277 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 29 Nov 2024 13:17:52 +0100 Subject: [PATCH] Fix checking deleted schematic limbo --- .../velocitycore/commands/CheckCommand.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index af6328b2..7fb5118a 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -272,12 +272,13 @@ public class CheckCommand extends SWCommand { } private boolean concludeCheckSession(String reason, SchematicType type) { - if(SchematicNode.getSchematicNode(schematic.getId()) == null) // Schematic was deleted - return false; + boolean exists = SchematicNode.getSchematicNode(schematic.getId()) != null; - CheckedSchematic.create(schematic, checker.user().getId(), startTime, Timestamp.from(Instant.now()), reason); - if(type != null) - schematic.setSchemtype(type); + if(exists) { + CheckedSchematic.create(schematic, checker.user().getId(), startTime, Timestamp.from(Instant.now()), reason); + if(type != null) + schematic.setSchemtype(type); + } remove(); VelocityCore.schedule(() -> { @@ -285,7 +286,7 @@ public class CheckCommand extends SWCommand { if(subserver != null) subserver.stop(); }).schedule(); - return true; + return exists; } private void remove() {