mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 01:49:30 +00:00
tag防呆
This commit is contained in:
@@ -325,7 +325,13 @@ public class ItemSettings {
|
||||
}));
|
||||
registerFactory("tags", (value -> {
|
||||
List<String> tags = MiscUtils.getAsStringList(value);
|
||||
return settings -> settings.tags(tags.stream().map(Key::of).collect(Collectors.toSet()));
|
||||
return settings -> settings.tags(tags.stream().map(it -> {
|
||||
if (it.charAt(0) == '#') {
|
||||
return Key.of(it.substring(1));
|
||||
} else {
|
||||
return Key.of(it);
|
||||
}
|
||||
}).collect(Collectors.toSet()));
|
||||
}));
|
||||
registerFactory("equippable", (value -> {
|
||||
Map<String, Object> args = MiscUtils.castToMap(value, false);
|
||||
|
||||
Reference in New Issue
Block a user