mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-04 15:41:38 +00:00
tag防呆
This commit is contained in:
@@ -325,7 +325,13 @@ public class ItemSettings {
|
|||||||
}));
|
}));
|
||||||
registerFactory("tags", (value -> {
|
registerFactory("tags", (value -> {
|
||||||
List<String> tags = MiscUtils.getAsStringList(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 -> {
|
registerFactory("equippable", (value -> {
|
||||||
Map<String, Object> args = MiscUtils.castToMap(value, false);
|
Map<String, Object> args = MiscUtils.castToMap(value, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user