only apply shortcut if loaded config is a string

This commit is contained in:
dfsek
2025-12-30 11:58:48 -07:00
parent 2215ea8336
commit 5dc9f419ac

View File

@@ -35,8 +35,7 @@ public class ShortcutHolder<T> implements TypeLoader<T> {
@Override @Override
public T load(@NotNull AnnotatedType annotatedType, @NotNull Object o, @NotNull ConfigLoader configLoader, DepthTracker depthTracker) public T load(@NotNull AnnotatedType annotatedType, @NotNull Object o, @NotNull ConfigLoader configLoader, DepthTracker depthTracker)
throws LoadException { throws LoadException {
String id = (String) o; if(o instanceof String id && id.contains(":")) {
if(id.contains(":")) {
String shortcut = id.substring(0, id.indexOf(":")); String shortcut = id.substring(0, id.indexOf(":"));
if(shortcuts.containsKey(shortcut)) { if(shortcuts.containsKey(shortcut)) {
return shortcuts.get(shortcut).load(configLoader, id.substring(id.indexOf(":") + 1), return shortcuts.get(shortcut).load(configLoader, id.substring(id.indexOf(":") + 1),