mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 10:49:07 +00:00
oh shit
This commit is contained in:
1 parent
b6e3ee8404
commit
ce8c9b3b94
1 file changed
-31
@@ -4308,37 +4308,6 @@ public class ScriptDocument {
|
||||
return resolveTypeAndTrackUsage(typeName);
|
||||
}
|
||||
|
||||
private TypeInfo substituteTypeParams(TypeInfo type, int position) {
|
||||
if (type == null)
|
||||
return null;
|
||||
|
||||
if (!type.isResolved() && type.getSimpleName() != null
|
||||
&& !type.getSimpleName().contains(".")) {
|
||||
TypeInfo sub = resolveType(type.getSimpleName(), position);
|
||||
return (sub != null && sub.isResolved()) ? sub : type;
|
||||
}
|
||||
|
||||
if (type.isParameterized()) {
|
||||
List<TypeInfo> args = type.getAppliedTypeArgs();
|
||||
if (args != null && !args.isEmpty()) {
|
||||
List<TypeInfo> substituted = new ArrayList<>(args.size());
|
||||
boolean anyChanged = false;
|
||||
for (TypeInfo arg : args) {
|
||||
TypeInfo sub = substituteTypeParams(arg, position);
|
||||
if (sub != arg)
|
||||
anyChanged = true;
|
||||
substituted.add(sub);
|
||||
}
|
||||
if (anyChanged) {
|
||||
TypeInfo raw = type.getRawType();
|
||||
return raw != null ? raw.parameterize(substituted) : type.parameterize(substituted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively resolve any unresolved type names inside a TypeInfo using position-aware resolution.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user