13
0

Add NoCheck
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Chaoscaot 2023-09-27 22:41:58 +02:00
Ursprung 6ff7170310
Commit 184e2e7480
Signiert von: Chaoscaot
GPG-Schlüssel-ID: BDF8FADD7D5EDB7A
4 geänderte Dateien mit 38 neuen und 46 gelöschten Zeilen

Datei anzeigen

@ -92,6 +92,7 @@ UTIL_TYPE_FIGHT_ALREADY=§cYou have already submitted this schematic
UTIL_TYPE_AFTER_DEADLINE=§cSchematics of this type can no longer be submitted. Deadline was: {0}
UTIL_TYPE_ERROR=§cThe Schematic is not compliant with the rules
UTIL_TYPE_EXTEND=§aThe preparation server is starting
UTIL_TYPE_CANNOT_EXTEND=§cThis schematic type cannot be extended
UTIL_SUBMIT_TITLE=Extend Schematic
UTIL_SUBMIT_REPLAY_ON=§aReplay allowed
UTIL_SUBMIT_REPLAY_OFF=§cReplay locked
@ -100,6 +101,7 @@ UTIL_SUBMIT_COLOR_OFF=§cDo not replace pink
UTIL_SUBMIT_DIRECT=§eSubmit directly
UTIL_SUBMIT_DIRECT_DONE=§aThe Schematic will be reviewed in a timely manner
UTIL_SUBMIT_EXTEND=§eExtend Schematic
UTIL_SUBMIT_EXTEND_NO=§cYou cannot extend this schematic
UTIL_SUBMIT_EXTEND_DONE=§aThe preparation server is starting
UTIL_CHECK_TYPE_NOT_FOUND=§cThe type {0} was not found
UTIL_CHECK_SUCCESS=§aThe schematic was checked successfully

Datei anzeigen

@ -79,6 +79,7 @@ UTIL_TYPE_FIGHT_ALREADY=§cDu hast diese Schematic bereits eingesendet
UTIL_TYPE_AFTER_DEADLINE=§cVon diesem Typen können keine Schematics mehr eingesendet werden. Einsendeschluss war: {0}
UTIL_TYPE_ERROR=§cDie Schematic ist nicht regelkonform
UTIL_TYPE_EXTEND=§aDer Vorbereitungsserver wird gestartet
UTIL_TYPE_CANNOT_EXTEND=§cDieser Schematictyp kann nicht ausgefahren werden
UTIL_SUBMIT_TITLE=Schematic ausfahren
UTIL_SUBMIT_REPLAY_ON=§aReplay erlaubt
UTIL_SUBMIT_REPLAY_OFF=§cReplay gesperrt
@ -87,6 +88,7 @@ UTIL_SUBMIT_COLOR_OFF=§cPink nicht ersetzen
UTIL_SUBMIT_DIRECT=§eDirekt einsenden
UTIL_SUBMIT_DIRECT_DONE=§aDie Schematic wird zeitnah überprüft
UTIL_SUBMIT_EXTEND=§eSchematic ausfahren
UTIL_SUBMIT_EXTEND_NO=§cDiese Schematic kann nicht ausgefahren werden
UTIL_SUBMIT_EXTEND_DONE=§aDer Vorbereitungsserver wird gestartet
COMMAND_INVALID_NODE=§cDie Schematic konnte nicht gefunden werden

Datei anzeigen

@ -1,35 +1,36 @@
/*
This file is a part of the SteamWar software.
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
Copyright (C) 2023 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.schematicsystem;
import de.steamwar.sql.SchematicType;
import lombok.Getter;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.*;
@Getter
public class CheckSchemType {
private static final Map<SchematicType, CheckSchemType> types = new HashMap<>();
@ -41,10 +42,12 @@ public class CheckSchemType {
private final Map<Set<String>, Integer> limits;
private final int maxBlocks;
private final Date deadline;
private final boolean hasCheckQuestions;
private CheckSchemType(ConfigurationSection section) {
hasCheckQuestions = section.isList("CheckQuestions");
String name = section.getString("Schematic.Type");
width = section.getInt("Schematic.Size.x");
height = section.getInt("Schematic.Size.y");
@ -98,26 +101,6 @@ public class CheckSchemType {
return types.get(type);
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public int getDepth() {
return depth;
}
public int getMaxDispenserItems() {
return maxDispenserItems;
}
public int getMaxBlocks(){
return maxBlocks;
}
public Map<Set<String>, Integer> getLimits() {
return new HashMap<>(limits);
}
@ -125,8 +108,4 @@ public class CheckSchemType {
public boolean isAfterDeadline() {
return deadline != null && deadline.before(Date.from(Instant.now()));
}
public Date getDeadline() {
return deadline;
}
}

Datei anzeigen

@ -458,6 +458,11 @@ public class SchematicCommandUtils {
if (extend == null) {
submitSchemGUI(player, node, type);
} else if (extend == SchematicCommand.Extend.AUSFAHREN) {
if (checkSchemType.isHasCheckQuestions()) {
SchematicSystem.MESSAGE.send("UTIL_TYPE_CANNOT_EXTEND", player);
return;
}
NetworkSender.send(new PrepareSchemPacket(SteamwarUser.get(player.getUniqueId()).getId(), node.getId(), type.toDB()));
SchematicSystem.MESSAGE.send("UTIL_TYPE_EXTEND", player);
}
@ -479,11 +484,15 @@ public class SchematicCommandUtils {
SchematicSystem.MESSAGE.send("UTIL_SUBMIT_DIRECT_DONE", player);
player.closeInventory();
});
inv.setItem(8, SWItem.getDye(10), (byte) 10, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_EXTEND", player), click -> {
NetworkSender.send(new PrepareSchemPacket(SteamwarUser.get(player.getUniqueId()).getId(), node.getId(), type.toDB()));
SchematicSystem.MESSAGE.send("UTIL_SUBMIT_EXTEND_DONE", player);
player.closeInventory();
});
if (CheckSchemType.get(type).isHasCheckQuestions()) {
inv.setItem(8, SWItem.getDye(8), (byte) 8, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_EXTEND_NO", player), clickType -> {});
} else {
inv.setItem(8, SWItem.getDye(10), (byte) 10, SchematicSystem.MESSAGE.parse("UTIL_SUBMIT_EXTEND", player), click -> {
NetworkSender.send(new PrepareSchemPacket(SteamwarUser.get(player.getUniqueId()).getId(), node.getId(), type.toDB()));
SchematicSystem.MESSAGE.send("UTIL_SUBMIT_EXTEND_DONE", player);
player.closeInventory();
});
}
inv.setCallback(-999, click -> player.closeInventory());
inv.open();
}