Skip to content

Commit

Permalink
fix: The option of Attribute Modify appears in configurations that do…
Browse files Browse the repository at this point in the history
…n't contain such ability
  • Loading branch information
MATRIX-feather committed Nov 20, 2024
1 parent 42843c1 commit 0148ea8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,27 @@ public ISkillOption fromMap(@Nullable Map<String, Object> map)
var modifiers = map == null ? null : tryGet(map, "modifiers", List.class);
var defaultInfo = new AttributeInfo();

if (modifiers != null) modifiers.forEach(o ->
if (modifiers != null)
{
if (!(o instanceof Map<?, ?> optionMap)) return;
modifiers.forEach(o ->
{
if (!(o instanceof Map<?, ?> optionMap)) return;

var mmap = new Object2ObjectOpenHashMap<String, Object>();
var mmap = new Object2ObjectOpenHashMap<String, Object>();

optionMap.forEach((k, v) ->
{
if (!(k instanceof String kStr)) return;
mmap.put(kStr, v);
});
optionMap.forEach((k, v) ->
{
if (!(k instanceof String kStr)) return;
mmap.put(kStr, v);
});

instance.modifiers.add((AttributeInfo) defaultInfo.fromMap(mmap));
});
instance.modifiers.add((AttributeInfo) defaultInfo.fromMap(mmap));
});
}
else
{
return null;
}

return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void update(int currentVersion)

private void migrate_attribute()
{
logger.info("Migrating attribute names...");
logger.info("Starting migration of attribute names...");
var files = directoryStorage.getFiles(".*\\.json$");

var abilityInstance = new AttributeModifyingAbility();
Expand Down

0 comments on commit 0148ea8

Please sign in to comment.