Archiviert
1
0

Update some stuff

Dieser Commit ist enthalten in:
yoyosource 2022-06-01 23:19:30 +02:00
Ursprung abc775009e
Commit e61a98c2a3
4 geänderte Dateien mit 12 neuen und 10 gelöschten Zeilen

@ -1 +1 @@
Subproject commit 0f03b57e437c1d843816b7202d95b79ff0a8d2df Subproject commit 919c4d525ea39756b24bd961bb72d8d58bdd5bd4

Datei anzeigen

@ -81,9 +81,12 @@ public class EventCommand extends BasicCommand {
if(now.isBefore(e.getDeadline().toInstant())) { if(now.isBefore(e.getDeadline().toInstant())) {
Message.send("EVENT_COMING_DEADLINE", player, e.getDeadline()); Message.send("EVENT_COMING_DEADLINE", player, e.getDeadline());
} }
SchematicType schematicType = SchematicType.get(e); String checkType = e.getCheckType();
if (schematicType != null && schematicType.deadline() != null && now.isBefore(schematicType.deadline().toInstant())) { if (checkType != null) {
Message.send("EVENT_COMING_SCHEM_DEADLINE", player, e.getDeadline()); 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()){ if(!teams.isEmpty()){
StringBuilder tline = new StringBuilder(); StringBuilder tline = new StringBuilder();

Datei anzeigen

@ -41,6 +41,7 @@ public class Event {
private final boolean publicSchemsOnly; private final boolean publicSchemsOnly;
private final boolean spectateSystem; private final boolean spectateSystem;
private final Timestamp deadline; private final Timestamp deadline;
private final String checkType;
private static Event current = null; private static Event current = null;
@ -53,6 +54,7 @@ public class Event {
this.publicSchemsOnly = rs.getBoolean("PublicSchemsOnly"); this.publicSchemsOnly = rs.getBoolean("PublicSchemsOnly");
this.spectateSystem = rs.getBoolean("SpectateSystem"); this.spectateSystem = rs.getBoolean("SpectateSystem");
this.deadline = rs.getTimestamp("Deadline"); this.deadline = rs.getTimestamp("Deadline");
this.checkType = rs.getString("CheckType");
} }
public static Event get(){ public static Event get(){
@ -123,4 +125,7 @@ public class Event {
public Timestamp getDeadline() { public Timestamp getDeadline() {
return deadline; return deadline;
} }
public String getCheckType() {
return checkType;
}
} }

Datei anzeigen

@ -37,7 +37,6 @@ public class SchematicType {
private static final Map<String, SchematicType> fromDB; private static final Map<String, SchematicType> fromDB;
private static final Map<SchematicType, SchematicType> fightType; private static final Map<SchematicType, SchematicType> fightType;
private static final List<SchematicType> types; private static final List<SchematicType> types;
private static final Map<Integer, SchematicType> eventSchematicTypes;
static { static {
File folder = new File(ProxyServer.getInstance().getPluginsFolder(), "FightSystem"); File folder = new File(ProxyServer.getInstance().getPluginsFolder(), "FightSystem");
@ -106,7 +105,6 @@ public class SchematicType {
fromDB = Collections.unmodifiableMap(tmpFromDB); fromDB = Collections.unmodifiableMap(tmpFromDB);
fightType = Collections.unmodifiableMap(tmpFightType); fightType = Collections.unmodifiableMap(tmpFightType);
types = Collections.unmodifiableList(tmpTypes); types = Collections.unmodifiableList(tmpTypes);
eventSchematicTypes = Collections.unmodifiableMap(tmpEventType);
} }
private final String name; private final String name;
@ -177,10 +175,6 @@ public class SchematicType {
return types; return types;
} }
public static SchematicType get(Event event) {
return eventSchematicTypes.get(event.getEventID());
}
enum Type{ enum Type{
NORMAL, NORMAL,
CHECK_TYPE, CHECK_TYPE,