diff --git a/common/src/main/java/dev/dhyces/trimmed/api/data/model/source/BaseModelSourceDataProvider.java b/common/src/main/java/dev/dhyces/trimmed/api/data/model/source/BaseModelSourceDataProvider.java index 3764675e..fb26fb42 100644 --- a/common/src/main/java/dev/dhyces/trimmed/api/data/model/source/BaseModelSourceDataProvider.java +++ b/common/src/main/java/dev/dhyces/trimmed/api/data/model/source/BaseModelSourceDataProvider.java @@ -12,6 +12,7 @@ import dev.dhyces.trimmed.impl.client.models.source.ModelSourceRegistry; import dev.dhyces.trimmed.impl.client.models.source.TrimModelSource; import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; +import net.minecraft.core.Holder; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.CachedOutput; import net.minecraft.data.DataProvider; @@ -46,12 +47,24 @@ public void addTwoLayerTrimsSource(ArmorMaterial armorMaterial) { addTwoLayerTrimsSource(id, id, materialId); } + public void addTwoLayerTrimsSource(Holder armorMaterial) { + ResourceLocation materialId = armorMaterial.unwrapKey().orElseThrow().location(); + ResourceLocation id = materialId.withSuffix("_armor"); + addTwoLayerTrimsSource(id, id, materialId); + } + public void addThreeLayerTrimsSource(ArmorMaterial armorMaterial) { ResourceLocation materialId = BuiltInRegistries.ARMOR_MATERIAL.getResourceKey(armorMaterial).orElseThrow().location(); ResourceLocation id = materialId.withSuffix("_armor"); addThreeLayerTrimsSource(id, id, materialId); } + public void addThreeLayerTrimsSource(Holder armorMaterial) { + ResourceLocation materialId = armorMaterial.unwrapKey().orElseThrow().location(); + ResourceLocation id = materialId.withSuffix("_armor"); + addThreeLayerTrimsSource(id, id, materialId); + } + public void addTwoLayerTrimsSource(ResourceLocation id, ResourceLocation overlayTextures, ResourceLocation overrideTextures) { addTrimsSource(id, TWO_LAYER_TEMPLATE, ClientMapKeys.TRIM_OVERLAYS.makeSubKey(overlayTextures), ClientMapKeys.TRIM_MATERIAL_OVERRIDES.makeSubKey(overrideTextures)); }