Compare commits

...
6 Commits
3 changed files with 17 additions and 12 deletions
-3
View File
@@ -63,9 +63,6 @@ jobs:
cp "SpigotCore/build/libs/SpigotCore-all.jar" "deploy/SpigotCore.jar" cp "SpigotCore/build/libs/SpigotCore-all.jar" "deploy/SpigotCore.jar"
cp "Teamserver/build/libs/Teamserver.jar" "deploy/Builder.jar" cp "Teamserver/build/libs/Teamserver.jar" "deploy/Builder.jar"
cp "TowerRun/build/libs/TowerRun.jar" "deploy/TowerRun.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 "WebsiteBackend/build/libs/WebsiteBackend-all.jar" "deploy/website-api.jar"
cp "CLI/build/distributions/sw.zip" "deploy/sw.zip" cp "CLI/build/distributions/sw.zip" "deploy/sw.zip"
@@ -30,6 +30,7 @@ import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
@ToString @ToString
public final class GameModeConfig<M, W> { public final class GameModeConfig<M, W> {
@@ -710,13 +711,26 @@ public final class GameModeConfig<M, W> {
Map<Set<M>, Integer> Limited = new HashMap<>(); Map<Set<M>, Integer> Limited = new HashMap<>();
for (Map<?, ?> entry : loader.getMapList("Limited")) { for (Map<?, ?> entry : loader.getMapList("Limited")) {
int amount = (Integer) entry.get("Amount"); 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) { if (amount == 0) {
materials.forEach(material -> { materials.forEach(material -> {
Limited.put(Collections.singleton(loader.materialMapper.apply(material.toUpperCase())), 0); Limited.put(Collections.singleton(material), 0);
}); });
} else { } 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 -> { SQLWrapper.impl.getMaterialWithGreaterBlastResistance(MaxBlastResistance).forEach(material -> {
-6
View File
@@ -251,11 +251,5 @@ include("TowerRun")
include("TutorialSystem") include("TutorialSystem")
include(
"VelocityCore",
"VelocityCore:Dependencies",
"VelocityCore:Persistent"
)
include("TNTLeague") include("TNTLeague")
include("WebsiteBackend") include("WebsiteBackend")