From e61a98c2a3407951248758d25716329b3a0dae44 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 1 Jun 2022 23:19:30 +0200 Subject: [PATCH] Update some stuff --- CommonCore | 2 +- src/de/steamwar/bungeecore/commands/EventCommand.java | 9 ++++++--- src/de/steamwar/bungeecore/sql/Event.java | 5 +++++ src/de/steamwar/bungeecore/sql/SchematicType.java | 6 ------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CommonCore b/CommonCore index 0f03b57..919c4d5 160000 --- a/CommonCore +++ b/CommonCore @@ -1 +1 @@ -Subproject commit 0f03b57e437c1d843816b7202d95b79ff0a8d2df +Subproject commit 919c4d525ea39756b24bd961bb72d8d58bdd5bd4 diff --git a/src/de/steamwar/bungeecore/commands/EventCommand.java b/src/de/steamwar/bungeecore/commands/EventCommand.java index 3719ed2..fc49281 100644 --- a/src/de/steamwar/bungeecore/commands/EventCommand.java +++ b/src/de/steamwar/bungeecore/commands/EventCommand.java @@ -81,9 +81,12 @@ public class EventCommand extends BasicCommand { if(now.isBefore(e.getDeadline().toInstant())) { Message.send("EVENT_COMING_DEADLINE", player, e.getDeadline()); } - SchematicType schematicType = SchematicType.get(e); - if (schematicType != null && schematicType.deadline() != null && now.isBefore(schematicType.deadline().toInstant())) { - Message.send("EVENT_COMING_SCHEM_DEADLINE", player, e.getDeadline()); + String checkType = e.getCheckType(); + if (checkType != null) { + SchematicType schematicType = SchematicType.fromDB(checkType); + if (schematicType != null && schematicType.deadline() != null && now.isBefore(schematicType.deadline().toInstant())) { + Message.send("EVENT_COMING_SCHEM_DEADLINE", player, e.getDeadline()); + } } if(!teams.isEmpty()){ StringBuilder tline = new StringBuilder(); diff --git a/src/de/steamwar/bungeecore/sql/Event.java b/src/de/steamwar/bungeecore/sql/Event.java index 93fd211..41a5b03 100644 --- a/src/de/steamwar/bungeecore/sql/Event.java +++ b/src/de/steamwar/bungeecore/sql/Event.java @@ -41,6 +41,7 @@ public class Event { private final boolean publicSchemsOnly; private final boolean spectateSystem; private final Timestamp deadline; + private final String checkType; private static Event current = null; @@ -53,6 +54,7 @@ public class Event { this.publicSchemsOnly = rs.getBoolean("PublicSchemsOnly"); this.spectateSystem = rs.getBoolean("SpectateSystem"); this.deadline = rs.getTimestamp("Deadline"); + this.checkType = rs.getString("CheckType"); } public static Event get(){ @@ -123,4 +125,7 @@ public class Event { public Timestamp getDeadline() { return deadline; } + public String getCheckType() { + return checkType; + } } diff --git a/src/de/steamwar/bungeecore/sql/SchematicType.java b/src/de/steamwar/bungeecore/sql/SchematicType.java index 1ccb33c..f63633e 100644 --- a/src/de/steamwar/bungeecore/sql/SchematicType.java +++ b/src/de/steamwar/bungeecore/sql/SchematicType.java @@ -37,7 +37,6 @@ public class SchematicType { private static final Map fromDB; private static final Map fightType; private static final List types; - private static final Map eventSchematicTypes; static { File folder = new File(ProxyServer.getInstance().getPluginsFolder(), "FightSystem"); @@ -106,7 +105,6 @@ public class SchematicType { fromDB = Collections.unmodifiableMap(tmpFromDB); fightType = Collections.unmodifiableMap(tmpFightType); types = Collections.unmodifiableList(tmpTypes); - eventSchematicTypes = Collections.unmodifiableMap(tmpEventType); } private final String name; @@ -177,10 +175,6 @@ public class SchematicType { return types; } - public static SchematicType get(Event event) { - return eventSchematicTypes.get(event.getEventID()); - } - enum Type{ NORMAL, CHECK_TYPE,