Как загрузить текстуру для entity.

Версия Minecraft
1.8+
Есть entity:

Java:
package com.feldsher_.gopnimod.entity;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public class EntityCanned extends EntityThrowable{

    public EntityCanned(World worldIn)
    {
        super(worldIn);
    }

    public EntityCanned(World worldIn, EntityLivingBase p_i1774_2_)
    {
        super(worldIn, p_i1774_2_);
    }

    public EntityCanned(World worldIn, double x, double y, double z)
    {
        super(worldIn, x, y, z);
    }
   
    protected void onImpact(MovingObjectPosition p_70184_1_)
    {
        if (p_70184_1_.entityHit != null)
        {
            if (p_70184_1_.entityHit instanceof EntityLivingBase)
            {
                ((EntityLivingBase)p_70184_1_.entityHit).addPotionEffect(new PotionEffect(Potion.invisibility.id, 100, 0));
            }
            p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 4.0F);
           
        }
       
        for (int i = 0; i < 8; ++i)
        {
            this.worldObj.spawnParticle(EnumParticleTypes.BARRIER, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        }

        if (!this.worldObj.isRemote)
        {
            this.setDead();
        }
    }
}
Но есть вопрос как загрузит для нево текстурку.
 
Решение
Этот метод надо вызвать во время FMLInitializationEvent на стороне клиента.
И зарегистрировать свою Entity в FMLPreInitializationEvent с обоих сторон:
Java:
EntityRegistry.registerGlobalEntityID(YourEntity.class, "Your_entity", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(YourEntity.class, "Your_entity", 0, instance, 64, 15, true);
243
28
202
Item это инстанс твоего предмета, который ты бросаешь. Достаётся по ссылке на его поле оттуда где ты его объявлял (для ванили это например так - Items#diamond).

RenderManager и RenderItem клиентские классы, их экземпляры можно достать из Minecraft:
Minecraft.getMinecraft().getRenderManager() и Minecraft.getMinecraft().getRenderItem().
 
Я зделал так:
Java:
public class ClientProxy extends CommonProxy{
   
    @Override
    public void registerRenders()
    {
        RenderingRegistry.registerEntityRenderingHandler(EntityCanned.class, new RenderSnowball(Minecraft.getMinecraft().getRenderManager(), GopniItems.canned, Minecraft.getMinecraft().getRenderItem()));
        GopniItems.registerRenders();
    }
}
Но не работет.
 
178
4
42
Этот метод надо вызвать во время FMLInitializationEvent на стороне клиента.
И зарегистрировать свою Entity в FMLPreInitializationEvent с обоих сторон:
Java:
EntityRegistry.registerGlobalEntityID(YourEntity.class, "Your_entity", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(YourEntity.class, "Your_entity", 0, instance, 64, 15, true);
 
Сверху