From 4395c2254ae6889c288dc63e9e509315c06728d2 Mon Sep 17 00:00:00 2001 From: dhyces <10985914+dhyces@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:13:57 -0700 Subject: [PATCH] Add some more overloads --- .../model/source/BaseModelSourceDataProvider.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)); }