forked from SteamWar/SteamWar
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa6e6d3dc9 | ||
|
|
c146391646 | ||
|
|
32611fd1d6 | ||
|
|
56fd93a474
|
||
|
|
c27789daa8 | ||
|
|
56a7344d67 |
@@ -63,9 +63,6 @@ jobs:
|
||||
cp "SpigotCore/build/libs/SpigotCore-all.jar" "deploy/SpigotCore.jar"
|
||||
cp "Teamserver/build/libs/Teamserver.jar" "deploy/Builder.jar"
|
||||
cp "TowerRun/build/libs/TowerRun.jar" "deploy/TowerRun.jar"
|
||||
cp "VelocityCore/Persistent/build/libs/Persistent.jar" "deploy/PersistentVelocityCore.jar"
|
||||
cp "VelocityCore/Dependencies/build/libs/Dependencies-all.jar" "deploy/DependenciesVelocityCore.jar"
|
||||
cp "VelocityCore/build/libs/VelocityCore-all.jar" "deploy/VelocityCore.jar"
|
||||
cp "WebsiteBackend/build/libs/WebsiteBackend-all.jar" "deploy/website-api.jar"
|
||||
cp "CLI/build/distributions/sw.zip" "deploy/sw.zip"
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ToString
|
||||
public final class GameModeConfig<M, W> {
|
||||
@@ -710,13 +711,26 @@ public final class GameModeConfig<M, W> {
|
||||
Map<Set<M>, Integer> Limited = new HashMap<>();
|
||||
for (Map<?, ?> entry : loader.getMapList("Limited")) {
|
||||
int amount = (Integer) entry.get("Amount");
|
||||
Set<String> materials = new HashSet<>((List<String>) entry.get("Materials"));
|
||||
Set<M> materials = Stream.of((List<String>) entry.get("Materials"))
|
||||
.filter(Objects::nonNull)
|
||||
.flatMap(List::stream)
|
||||
.map(String::toUpperCase)
|
||||
.map(material -> {
|
||||
try {
|
||||
return loader.materialMapper.apply(material);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (amount == 0) {
|
||||
materials.forEach(material -> {
|
||||
Limited.put(Collections.singleton(loader.materialMapper.apply(material.toUpperCase())), 0);
|
||||
Limited.put(Collections.singleton(material), 0);
|
||||
});
|
||||
} else {
|
||||
Limited.put(Collections.unmodifiableSet(materials.stream().map(String::toUpperCase).map(loader.materialMapper).collect(Collectors.toSet())), amount);
|
||||
Limited.put(materials, amount);
|
||||
}
|
||||
}
|
||||
SQLWrapper.impl.getMaterialWithGreaterBlastResistance(MaxBlastResistance).forEach(material -> {
|
||||
|
||||
@@ -251,11 +251,5 @@ include("TowerRun")
|
||||
|
||||
include("TutorialSystem")
|
||||
|
||||
include(
|
||||
"VelocityCore",
|
||||
"VelocityCore:Dependencies",
|
||||
"VelocityCore:Persistent"
|
||||
)
|
||||
|
||||
include("TNTLeague")
|
||||
include("WebsiteBackend")
|
||||
|
||||
Reference in New Issue
Block a user