Skip to content

Commit

Permalink
Add some more overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed Jun 1, 2024
1 parent 9f49b3e commit 4395c22
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -46,12 +47,24 @@ public void addTwoLayerTrimsSource(ArmorMaterial armorMaterial) {
addTwoLayerTrimsSource(id, id, materialId);
}

public void addTwoLayerTrimsSource(Holder<ArmorMaterial> 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> 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));
}
Expand Down

0 comments on commit 4395c22

Please sign in to comment.