Fix multi source maps not working
This commit is contained in:
parent
04dc72fa77
commit
ce66748dc3
@ -426,6 +426,7 @@ public abstract class Game extends ListenerComponent implements Lifetimed
|
||||
|
||||
// Scoreboard
|
||||
Scoreboard = new GameScoreboard(this);
|
||||
WorldData = new WorldData(this);
|
||||
|
||||
// Stat Trackers
|
||||
registerStatTrackers(
|
||||
|
@ -367,7 +367,7 @@ public class GameCreationManager implements Listener
|
||||
{
|
||||
MapPref = MapPref.replace(" ", "");
|
||||
|
||||
System.out.println("Map Preference: " + MapPref);
|
||||
System.out.println("Map Preference: " + MapPref + " in " + MapSource);
|
||||
|
||||
Map<GameType, List<String>> matches = new HashMap<>();
|
||||
|
||||
@ -375,22 +375,28 @@ public class GameCreationManager implements Listener
|
||||
{
|
||||
GameType entryType = entry.getKey();
|
||||
List<String> maps = entry.getValue();
|
||||
|
||||
if (MapSource != null && entryType != MapSource)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> matchList = new ArrayList<>();
|
||||
|
||||
maps.forEach(map ->
|
||||
{
|
||||
if (map.replace(" ", "").toLowerCase().contains(MapPref.toLowerCase()))
|
||||
{
|
||||
if (MapSource == null || entryType == MapSource)
|
||||
{
|
||||
matchList.add(map);
|
||||
System.out.print("Map Preference Found: " + map);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!matchList.isEmpty())
|
||||
{
|
||||
matches.put(entryType, matchList);
|
||||
}
|
||||
}
|
||||
|
||||
if (!matches.isEmpty())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user