9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 20:39:10 +00:00

允许染色配方

This commit is contained in:
XiaoMoMi
2025-05-11 15:44:33 +08:00
parent 8edd7c46e5
commit e253c31e93
3 changed files with 109 additions and 58 deletions

View File

@@ -27,6 +27,7 @@ public class ItemSettings {
boolean renameable = true;
boolean canPlaceRelatedVanillaBlock = false;
ProjectileMeta projectileMeta;
boolean dyeable = false;
private ItemSettings() {}
@@ -56,6 +57,7 @@ public class ItemSettings {
newSettings.renameable = settings.renameable;
newSettings.canPlaceRelatedVanillaBlock = settings.canPlaceRelatedVanillaBlock;
newSettings.projectileMeta = settings.projectileMeta;
newSettings.dyeable = settings.dyeable;
return newSettings;
}
@@ -95,6 +97,10 @@ public class ItemSettings {
return tags;
}
public boolean dyeable() {
return dyeable;
}
public List<AnvilRepairItem> repairItems() {
return anvilRepairItems;
}
@@ -144,6 +150,11 @@ public class ItemSettings {
return this;
}
public ItemSettings dyeable(boolean bool) {
this.dyeable = bool;
return this;
}
@FunctionalInterface
public interface Modifier {
@@ -217,6 +228,10 @@ public class ItemSettings {
Quaternionf rotation = MiscUtils.getAsQuaternionf(ResourceConfigUtils.get(args, "rotation-left", "rotation"), "rotation-left");
return settings -> settings.projectileMeta(new ProjectileMeta(customTridentItemId, displayType, scale, translation, rotation));
}));
registerFactory("dyeable", (value -> {
boolean bool = (boolean) value;
return settings -> settings.dyeable(bool);
}));
}
private static void registerFactory(String id, ItemSettings.Modifier.Factory factory) {