mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Fixed script loading for Turkish locale
This commit is contained in:
parent
5f83c92829
commit
8f91576f85
@ -24,6 +24,7 @@ import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@ -526,7 +527,7 @@ public class Mods implements Loadable{
|
||||
if(mod.root.child("content").exists()){
|
||||
Fi contentRoot = mod.root.child("content");
|
||||
for(ContentType type : ContentType.all){
|
||||
Fi folder = contentRoot.child(type.name().toLowerCase() + "s");
|
||||
Fi folder = contentRoot.child(type.name().toLowerCase(Locale.ROOT) + "s");
|
||||
if(folder.exists()){
|
||||
for(Fi file : folder.findAll(f -> f.extension().equals("json") || f.extension().equals("hjson"))){
|
||||
runs.add(new LoadRun(type, file, mod));
|
||||
@ -646,8 +647,8 @@ public class Mods implements Loadable{
|
||||
ModMeta meta = json.fromJson(ModMeta.class, Jval.read(metaf.readString()).toString(Jformat.plain));
|
||||
meta.cleanup();
|
||||
String camelized = meta.name.replace(" ", "");
|
||||
String mainClass = meta.main == null ? camelized.toLowerCase() + "." + camelized + "Mod" : meta.main;
|
||||
String baseName = meta.name.toLowerCase().replace(" ", "-");
|
||||
String mainClass = meta.main == null ? camelized.toLowerCase(Locale.ROOT) + "." + camelized + "Mod" : meta.main;
|
||||
String baseName = meta.name.toLowerCase(Locale.ROOT).replace(" ", "-");
|
||||
|
||||
var other = mods.find(m -> m.name.equals(baseName));
|
||||
|
||||
@ -771,7 +772,7 @@ public class Mods implements Loadable{
|
||||
this.loader = loader;
|
||||
this.main = main;
|
||||
this.meta = meta;
|
||||
this.name = meta.name.toLowerCase().replace(" ", "-");
|
||||
this.name = meta.name.toLowerCase(Locale.ROOT).replace(" ", "-");
|
||||
}
|
||||
|
||||
/** @return whether this is a java class mod. */
|
||||
|
@ -18,6 +18,7 @@ import rhino.module.provider.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.util.regex.*;
|
||||
|
||||
public class Scripts implements Disposable{
|
||||
@ -32,7 +33,7 @@ public class Scripts implements Disposable{
|
||||
LoadedMod currentMod = null;
|
||||
|
||||
public static boolean allowClass(String type){
|
||||
return !blacklist.contains(type.toLowerCase()::contains) || whitelist.contains(type.toLowerCase()::contains);
|
||||
return !blacklist.contains(t -> type.toLowerCase(Locale.ROOT).contains(t)) || whitelist.contains(t -> type.toLowerCase(Locale.ROOT).contains(t));
|
||||
}
|
||||
|
||||
public Scripts(){
|
||||
|
@ -570,7 +570,7 @@ public class JoinDialog extends BaseDialog{
|
||||
if(isIpv6 && ip.lastIndexOf("]:") != -1 && ip.lastIndexOf("]:") != ip.length() - 1){
|
||||
int idx = ip.indexOf("]:");
|
||||
this.ip = ip.substring(1, idx);
|
||||
this.port = Integer.parseInt(ip.substring(idx + 2, ip.length()));
|
||||
this.port = Integer.parseInt(ip.substring(idx + 2));
|
||||
}else if(!isIpv6 && ip.lastIndexOf(':') != -1 && ip.lastIndexOf(':') != ip.length() - 1){
|
||||
int idx = ip.lastIndexOf(':');
|
||||
this.ip = ip.substring(0, idx);
|
||||
|
Loading…
Reference in New Issue
Block a user