2017-03-28 08:02:23 +02:00
|
|
|
package com.minelittlepony;
|
|
|
|
|
|
|
|
import com.mumfrey.liteloader.util.ModUtilities;
|
|
|
|
import net.minecraft.client.model.ModelBiped;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
import net.minecraft.inventory.EntityEquipmentSlot;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraftforge.client.ForgeHooksClient;
|
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Proxy class for accessing forge fields and methods.
|
|
|
|
*/
|
2017-03-28 08:02:23 +02:00
|
|
|
public class ForgeProxy {
|
2018-04-27 13:49:33 +02:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* True if forge is present.
|
|
|
|
*/
|
2017-03-28 08:02:23 +02:00
|
|
|
private static boolean forgeLoaded = ModUtilities.fmlIsPresent();
|
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
2018-05-06 13:34:11 +02:00
|
|
|
* Gets the mod armour texture for an associated item and slot.
|
2018-04-27 13:49:33 +02:00
|
|
|
*
|
2018-04-25 21:29:49 +02:00
|
|
|
* @param entity The entity to get armour for.
|
|
|
|
* @param item The armour item
|
|
|
|
* @param def Default return value if no mods present
|
|
|
|
* @param slot The slot this armour piece is place in.
|
|
|
|
* @param type unknown
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public static String getArmorTexture(Entity entity, ItemStack item, String def, EntityEquipmentSlot slot, @Nullable String type) {
|
2017-03-28 08:02:23 +02:00
|
|
|
if (forgeLoaded)
|
2018-04-25 21:29:49 +02:00
|
|
|
return ForgeHooksClient.getArmorTexture(entity, item, def, slot, type);
|
2017-03-28 08:02:23 +02:00
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
2018-05-06 13:34:11 +02:00
|
|
|
* Gets the mod armour model for an associated item and slot.
|
2018-04-27 13:49:33 +02:00
|
|
|
*
|
2018-04-25 21:29:49 +02:00
|
|
|
* @param entity The entity to get armour for.
|
|
|
|
* @param item The armour item
|
|
|
|
* @param slot The slot this armour piece is place in.
|
|
|
|
* @param def Default return value if no mods present
|
|
|
|
*/
|
2017-03-28 08:02:23 +02:00
|
|
|
public static ModelBiped getArmorModel(EntityLivingBase entity, ItemStack item, EntityEquipmentSlot slot, ModelBiped def) {
|
|
|
|
if (forgeLoaded)
|
|
|
|
return ForgeHooksClient.getArmorModel(entity, item, slot, def);
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|