9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-23 17:09:19 +00:00

修复encodeJava

This commit is contained in:
XiaoMoMi
2025-04-05 18:39:34 +08:00
parent 51dad2f602
commit d26fe2c6d7
3 changed files with 56 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ public class ItemSettings {
EquipmentGeneration equipment;
boolean canRepair = true;
List<AnvilRepairItem> anvilRepairItems = List.of();
boolean renameable = true;
private ItemSettings() {}
@@ -43,6 +44,7 @@ public class ItemSettings {
newSettings.equipment = settings.equipment;
newSettings.canRepair = settings.canRepair;
newSettings.anvilRepairItems = settings.anvilRepairItems;
newSettings.renameable = settings.renameable;
return newSettings;
}
@@ -66,6 +68,10 @@ public class ItemSettings {
return fuelTime;
}
public boolean renameable() {
return renameable;
}
public Set<Key> tags() {
return tags;
}
@@ -89,6 +95,11 @@ public class ItemSettings {
return this;
}
public ItemSettings renameable(boolean renameable) {
this.renameable = renameable;
return this;
}
public ItemSettings fuelTime(int fuelTime) {
this.fuelTime = fuelTime;
return this;
@@ -124,6 +135,10 @@ public class ItemSettings {
boolean bool = (boolean) value;
return settings -> settings.canRepair(bool);
}));
registerFactory("renameable", (value -> {
boolean bool = (boolean) value;
return settings -> settings.renameable(bool);
}));
registerFactory("anvil-repair-item", (value -> {
@SuppressWarnings("unchecked")
List<Map<String, Object>> materials = (List<Map<String, Object>>) value;