mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-20 09:17:19 +07:00
Uncap content names in resolution
This commit is contained in:
parent
5a58f9c71a
commit
78317e6126
@ -704,10 +704,9 @@ public class ContentParser{
|
|||||||
<T> Class<T> resolve(String base, Class<T> def){
|
<T> Class<T> resolve(String base, Class<T> def){
|
||||||
//no base class specified
|
//no base class specified
|
||||||
if(base.isEmpty() && def != null) return def;
|
if(base.isEmpty() && def != null) return def;
|
||||||
if(!base.isEmpty() && Character.isLowerCase(base.charAt(0))) base = Strings.capitalize(base);
|
|
||||||
|
|
||||||
//return mapped class if found in the global map
|
//return mapped class if found in the global map
|
||||||
var out = ClassMap.classes.get(base);
|
var out = ClassMap.classes.get(!base.isEmpty() && Character.isLowerCase(base.charAt(0)) ? Strings.capitalize(base) : base);
|
||||||
if(out != null) return (Class<T>)out;
|
if(out != null) return (Class<T>)out;
|
||||||
|
|
||||||
//try to resolve it as a raw class name if it's allowed
|
//try to resolve it as a raw class name if it's allowed
|
||||||
|
Loading…
Reference in New Issue
Block a user