2017-03-28 08:02:23 +02:00
|
|
|
package com.minelittlepony;
|
|
|
|
|
|
|
|
import com.mumfrey.liteloader.util.ModUtilities;
|
|
|
|
import net.minecraft.client.model.ModelBiped;
|
2017-06-16 07:41:36 +02:00
|
|
|
import net.minecraft.client.renderer.entity.RenderManager;
|
|
|
|
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
2017-03-28 08:02:23 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2017-06-16 07:41:36 +02:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2017-03-28 08:02:23 +02:00
|
|
|
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;
|
2017-06-16 07:41:36 +02:00
|
|
|
import java.util.Optional;
|
|
|
|
import java.util.function.Function;
|
2017-06-13 05:55:50 +02:00
|
|
|
|
2017-03-28 08:02:23 +02:00
|
|
|
public class ForgeProxy {
|
|
|
|
|
|
|
|
private static boolean forgeLoaded = ModUtilities.fmlIsPresent();
|
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
public static String getArmorTexture(Entity entity, ItemStack armor, String def, EntityEquipmentSlot slot, @Nullable String type) {
|
2017-03-28 08:02:23 +02:00
|
|
|
if (forgeLoaded)
|
|
|
|
return ForgeHooksClient.getArmorTexture(entity, armor, def, slot, type);
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static ModelBiped getArmorModel(EntityLivingBase entity, ItemStack item, EntityEquipmentSlot slot, ModelBiped def) {
|
|
|
|
if (forgeLoaded)
|
|
|
|
return ForgeHooksClient.getArmorModel(entity, item, slot, def);
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
2017-06-16 07:41:36 +02:00
|
|
|
public static Optional<Function<RenderManager,LayerRenderer<EntityPlayer>>> createShoulderLayer() {
|
|
|
|
if (forgeLoaded) {
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
return Optional.empty();
|
|
|
|
}
|
|
|
|
|
2017-03-28 08:02:23 +02:00
|
|
|
}
|