From 30a499be1ddef061133b7f38c6690356fe6b9899 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Thu, 23 Apr 2026 23:32:57 +0200 Subject: [PATCH] Hotfix CheckCommand Remove uneeded stuff in SQLWrapper --- .../SQL/src/de/steamwar/sql/SQLWrapper.java | 3 --- .../src/de/steamwar/sql/SQLWrapperImpl.java | 10 ---------- .../velocitycore/commands/CheckCommand.java | 17 +++-------------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/SQLWrapper.java b/CommonCore/SQL/src/de/steamwar/sql/SQLWrapper.java index 47331406..f049f680 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/SQLWrapper.java +++ b/CommonCore/SQL/src/de/steamwar/sql/SQLWrapper.java @@ -36,8 +36,5 @@ public interface SQLWrapper { return Collections.emptyList(); } - default void processSchematicType(GameModeConfig gameModeConfig) { - } - void additionalExceptionMetadata(StringBuilder builder); } diff --git a/VelocityCore/src/de/steamwar/sql/SQLWrapperImpl.java b/VelocityCore/src/de/steamwar/sql/SQLWrapperImpl.java index 8e469d20..ce6e06d7 100644 --- a/VelocityCore/src/de/steamwar/sql/SQLWrapperImpl.java +++ b/VelocityCore/src/de/steamwar/sql/SQLWrapperImpl.java @@ -22,7 +22,6 @@ package de.steamwar.sql; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.server.RegisteredServer; import de.steamwar.velocitycore.VelocityCore; -import de.steamwar.velocitycore.commands.CheckCommand; import java.io.File; @@ -38,15 +37,6 @@ public class SQLWrapperImpl implements SQLWrapper { return new GameModeConfig<>(file, GameModeConfig.ToString, GameModeConfig.ToString, GameModeConfig.ToInternalName, true); } - @Override - public void processSchematicType(GameModeConfig gameModeConfig) { - SchematicType type = gameModeConfig.Schematic.Type; - if (type.checkType() != null) { - CheckCommand.setCheckQuestions(type.checkType(), gameModeConfig.CheckQuestions); - CheckCommand.addFightType(type.checkType(), type); - } - } - @Override public void additionalExceptionMetadata(StringBuilder builder) { builder.append("\nServers: "); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index fe78a018..c3957503 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -48,20 +48,9 @@ import java.util.logging.Level; @Linked public class CheckCommand extends SWCommand { - private static final Map fightTypes = new HashMap<>(); - private static final Map> checkQuestions = new HashMap<>(); - private static final Map currentCheckers = new HashMap<>(); private static final Map currentSchems = new HashMap<>(); - public static void setCheckQuestions(SchematicType checkType, List checkQuestions) { - CheckCommand.checkQuestions.put(checkType, checkQuestions); - } - - public static void addFightType(SchematicType checkType, SchematicType fightType) { - fightTypes.put(checkType, fightType); - } - public static boolean isChecking(Player player){ return currentCheckers.containsKey(player.getUniqueId()); } @@ -248,9 +237,9 @@ public class CheckCommand extends SWCommand { this.checker = checker; this.schematic = schematic; this.startTime = Timestamp.from(Instant.now()); - this.checkList = checkQuestions.get(schematic.getSchemtype()).listIterator(); + this.checkList = GameModeConfig.getBySchematicType(schematic.getSchemtype()).CheckQuestions.listIterator(); - GameModeConfig mode = ArenaMode.getBySchemType(fightTypes.get(schematic.getSchemtype())); + GameModeConfig mode = GameModeConfig.getBySchematicType(schematic.getSchemtype()); new ServerStarter().test(mode, mode.getRandomMap(), checker.getPlayer()).check(schematic.getId()).callback(subserver -> { currentCheckers.put(checker.user().getUUID(), this); currentSchems.put(schematic.getId(), this); @@ -304,7 +293,7 @@ public class CheckCommand extends SWCommand { } private void accept(){ - concludeCheckSession("freigegeben", fightTypes.get(schematic.getSchemtype()), () -> { + concludeCheckSession("freigegeben", GameModeConfig.getBySchematicType(schematic.getSchemtype()).Schematic.Type, () -> { Chatter owner = Chatter.of(SteamwarUser.byId(schematic.getOwner()).getUUID()); owner.withPlayerOrOffline( player -> owner.system("CHECK_ACCEPTED", schematic.getSchemtype().name(), schematic.getName()),