9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-27 02:49:15 +00:00

添加简易的迁移指令

This commit is contained in:
XiaoMoMi
2025-06-11 20:28:09 +08:00
parent 6adf7de9a4
commit 2c06db83af
5 changed files with 79 additions and 5 deletions

View File

@@ -153,6 +153,11 @@ public class ItemSettings {
return this;
}
public ItemSettings craftRemainder(Key key) {
this.craftRemainder = key;
return this;
}
public ItemSettings canRepair(boolean canRepair) {
this.canRepair = canRepair;
return this;
@@ -246,6 +251,10 @@ public class ItemSettings {
if (value == null) settings.consumeReplacement(null);
else settings.consumeReplacement(Key.of(value.toString()));
}));
registerFactory("craft-remainder", (value -> settings -> {
if (value == null) settings.craftRemainder(null);
else settings.craftRemainder(Key.of(value.toString()));
}));
registerFactory("tags", (value -> {
List<String> tags = MiscUtils.getAsStringList(value);
return settings -> settings.tags(tags.stream().map(Key::of).collect(Collectors.toSet()));
@@ -298,9 +307,6 @@ public class ItemSettings {
);
return settings -> settings.foodData(data);
}));
// registerFactory("craft-remainder", (value -> {
//
// }));
}
private static void registerFactory(String id, ItemSettings.Modifier.Factory factory) {