mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 02:20:57 +00:00
only apply shortcut if loaded config is a string
This commit is contained in:
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user