[1.12.x] Implement hooks allowing mods to add horse armor. Partially addresses #3975. (#3994)

This commit is contained in:
Daomephsta authored and LexManos committed 2018-01-18 12:04:37 -08:00
1 parent 61a16066e5
commit adf3c7164a
11 files changed
+278 -5

No files matched your search

@@ -75,6 +75,8 @@ import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.HorseArmorType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
@@ -754,4 +756,11 @@ public class ForgeHooksClient
{
MinecraftForge.EVENT_BUS.post(new InputUpdateEvent(player, movementInput));
}
public static String getHorseArmorTexture(EntityHorse horse, ItemStack armorStack)
{
String texture = armorStack.getItem().getHorseArmorTexture(horse, armorStack);
if(texture == null) texture = horse.getHorseArmorType().getTextureName();
return texture;
}
}