MultiSchemTypes #403
@ -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);
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren