SteamWar/FightSystem
Archiviert
13
1

Revert lowercase
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Fix SchematicType not used for checking available schematics
Fix leader not present to enable public only schem selection
Dieser Commit ist enthalten in:
yoyosource 2023-12-01 18:15:28 +01:00
Ursprung c0665b1868
Commit 3ee7411591
3 geänderte Dateien mit 13 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -21,7 +21,10 @@ package de.steamwar.fightsystem;
import de.steamwar.fightsystem.utils.Region; import de.steamwar.fightsystem.utils.Region;
import de.steamwar.fightsystem.winconditions.Winconditions; import de.steamwar.fightsystem.winconditions.Winconditions;
import de.steamwar.sql.*; import de.steamwar.sql.Event;
import de.steamwar.sql.EventFight;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.Team;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -178,8 +181,8 @@ public class Config {
int schemsizeY = config.getInt("Schematic.Size.y"); int schemsizeY = config.getInt("Schematic.Size.y");
int schemsizeZ = config.getInt("Schematic.Size.z"); int schemsizeZ = config.getInt("Schematic.Size.z");
RanksEnabled = !config.getStringList("Ranks").isEmpty(); RanksEnabled = !config.getStringList("Ranks").isEmpty();
SchematicType = de.steamwar.sql.SchematicType.fromDB(Objects.requireNonNull(config.getString("Schematic.Type", "normal").toLowerCase())); SchematicType = de.steamwar.sql.SchematicType.fromDB(Objects.requireNonNull(config.getString("Schematic.Type", "normal")));
SubTypes = config.getStringList("Schematic.SubTypes").stream().map(String::toLowerCase).map(de.steamwar.sql.SchematicType::fromDB).collect(Collectors.toList()); SubTypes = config.getStringList("Schematic.SubTypes").stream().map(de.steamwar.sql.SchematicType::fromDB).collect(Collectors.toList());
IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly", false); IgnorePublicOnly = config.getBoolean("Schematic.IgnorePublicOnly", false);
boolean rotate = config.getBoolean("Schematic.Rotate", true); boolean rotate = config.getBoolean("Schematic.Rotate", true);
PasteAligned = config.getBoolean("Schematic.PasteAligned", false); PasteAligned = config.getBoolean("Schematic.PasteAligned", false);

Datei anzeigen

@ -190,18 +190,18 @@ public class GUI {
} }
if (type.checkType() != null && type.checkType() != type && !SchematicNode.getAllAccessibleSchematicsOfType(SteamwarUser.get(p.getUniqueId()).getId(), type.checkType().toDB()).isEmpty()) { if (type.checkType() != null && type.checkType() != type && !SchematicNode.getAllAccessibleSchematicsOfType(SteamwarUser.get(p.getUniqueId()).getId(), type.checkType().toDB()).isEmpty()) {
inv.setItem(row * 9 + 4, Material.ANVIL, msg.parse("SCHEM_UNCHECKED", p, Config.GameName), (ClickType click) -> { inv.setItem(row * 9 + 4, Material.ANVIL, msg.parse("SCHEM_UNCHECKED", p, type.name()), (ClickType click) -> {
p.closeInventory(); p.closeInventory();
schemDialog(p, type, false, true); schemDialog(p, type, false, true);
}); });
} }
if (SchematicNode.getAllAccessibleSchematicsOfType(SteamwarUser.get(p.getUniqueId()).getId(), Config.SchematicType.toDB()).isEmpty() && !Config.test()) { if (SchematicNode.getAllAccessibleSchematicsOfType(SteamwarUser.get(p.getUniqueId()).getId(), type.toDB()).isEmpty() && !Config.test()) {
inv.setItem(row * 9, SWItem.getDye(8), (byte)8, msg.parse("SCHEM_NO_PRIVATE", p, Config.GameName), (ClickType click)->{}); inv.setItem(row * 9, SWItem.getDye(8), (byte)8, msg.parse("SCHEM_NO_PRIVATE", p, type.name()), (ClickType click)->{});
return; return;
} }
inv.setItem(row * 9, SWItem.getMaterial("CAULDRON_ITEM"), msg.parse("SCHEM_PRIVATE", p, Config.GameName), (ClickType click) -> { inv.setItem(row * 9, SWItem.getMaterial("CAULDRON_ITEM"), msg.parse("SCHEM_PRIVATE", p, type.name()), (ClickType click) -> {
p.closeInventory(); p.closeInventory();
schemDialog(p, type, false, false); schemDialog(p, type, false, false);
}); });

Datei anzeigen

@ -146,6 +146,9 @@ public class Fight {
if (Config.IgnorePublicOnly || ArenaMode.RankedEvent.contains(Config.mode)) { if (Config.IgnorePublicOnly || ArenaMode.RankedEvent.contains(Config.mode)) {
return false; return false;
} }
if (redTeam.getLeader() == null || blueTeam.getLeader() == null) {
return false;
}
return redTeam.isPublicsOnly() || blueTeam.isPublicsOnly(); return redTeam.isPublicsOnly() || blueTeam.isPublicsOnly();
} }
} }