From 80c0ff40660b7ba10f9359028a5b9f2b67eee26a Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Sun, 1 Feb 2015 10:48:48 -0800 Subject: [PATCH] Fixed domain support in ArmorMaterial texture name. Closes #1675 --- .../entity/layers/LayerArmorBase.java.patch | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch index 652dead4e5..18df6de02b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch @@ -57,7 +57,7 @@ private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) { String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {p_177178_1_.func_82812_d().func_179242_c(), Integer.valueOf(p_177178_2_ ? 2 : 1), p_177178_3_ == null ? "" : String.format("_%s", new Object[]{p_177178_3_})}); -@@ -158,6 +161,35 @@ +@@ -158,6 +161,42 @@ protected abstract void func_177179_a(ModelBase p_177179_1_, int p_177179_2_); @@ -74,8 +74,15 @@ + public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, int slot, String type) + { + ItemArmor item = (ItemArmor)stack.func_77973_b(); -+ String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", -+ ((ItemArmor)stack.func_77973_b()).func_82812_d().func_179242_c(), (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); ++ String texture = ((ItemArmor)stack.func_77973_b()).func_82812_d().func_179242_c(); ++ String domain = "minecraft"; ++ int idx = texture.indexOf(':'); ++ if (idx != -1) ++ { ++ domain = texture.substring(0, idx); ++ texture = texture.substring(idx + 1); ++ } ++ String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); + + s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type); + ResourceLocation resourcelocation = (ResourceLocation)field_177191_j.get(s1);