Dieser Commit ist enthalten in:
Ursprung
6ff7170310
Commit
184e2e7480
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,35 +1,36 @@
|
||||
/*
|
||||
This file is a part of the SteamWar software.
|
||||
|
||||
Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
/*
|
||||
This file is a part of the SteamWar software.
|
||||
|
||||
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.
|
||||
Copyright (C) 2023 SteamWar.de-Serverteam
|
||||
|
||||
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 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.
|
||||
|
||||
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/>.
|
||||
*/
|
||||
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/>.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren