geforkt von SteamWar/BungeeCore
Hotfix case sensitive maps
Dieser Commit ist enthalten in:
Ursprung
42898b0d4d
Commit
9e579ee3d6
@ -94,6 +94,7 @@ public class ArenaMode {
|
|||||||
private final String serverJar;
|
private final String serverJar;
|
||||||
private final String config;
|
private final String config;
|
||||||
private final List<String> maps;
|
private final List<String> maps;
|
||||||
|
private final Map<String, String> lowerToRealMapNames = new HashMap<>();
|
||||||
private final boolean historic;
|
private final boolean historic;
|
||||||
private final String internalName;
|
private final String internalName;
|
||||||
|
|
||||||
@ -106,6 +107,7 @@ public class ArenaMode {
|
|||||||
this.serverJar = config.getString("Server.ServerJar");
|
this.serverJar = config.getString("Server.ServerJar");
|
||||||
this.config = internalName + ".yml";
|
this.config = internalName + ".yml";
|
||||||
this.maps = config.getStringList("Server.Maps");
|
this.maps = config.getStringList("Server.Maps");
|
||||||
|
maps.forEach(map -> lowerToRealMapNames.put(map.toLowerCase(), map));
|
||||||
this.displayName = config.getString("GameName", internalName);
|
this.displayName = config.getString("GameName", internalName);
|
||||||
this.chatNames = config.getStringList("Server.ChatNames");
|
this.chatNames = config.getStringList("Server.ChatNames");
|
||||||
this.schemType = config.getString("Schematic.Type", "").toLowerCase();
|
this.schemType = config.getString("Schematic.Type", "").toLowerCase();
|
||||||
@ -155,6 +157,10 @@ public class ArenaMode {
|
|||||||
return maps;
|
return maps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String convertToRealMapName(String map){
|
||||||
|
return lowerToRealMapNames.get(map.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
public String getChatName(){
|
public String getChatName(){
|
||||||
return chatNames.get(0);
|
return chatNames.get(0);
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,7 @@ public class TypeMappers {
|
|||||||
if (previousArguments.length == 0) return null;
|
if (previousArguments.length == 0) return null;
|
||||||
if (s.equalsIgnoreCase("random")) return "random";
|
if (s.equalsIgnoreCase("random")) return "random";
|
||||||
ArenaMode arenaMode = ArenaMode.getByChat(previousArguments[previousArguments.length - 1]);
|
ArenaMode arenaMode = ArenaMode.getByChat(previousArguments[previousArguments.length - 1]);
|
||||||
if (arenaMode.getMaps().contains(s)) return s;
|
return arenaMode.convertToRealMapName(s);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren