Jump to content

[1.11.2] Entity Rendering Problem


Starjay811

Recommended Posts

So, a friend and I have been working on a modification that worked just fine in 1.9.4 and 1.10.2, but in 1.11.2 we've fixed all the various bugs... except for the fact that the mobs just render as cuboid white prisms, and my friend says that it appears the methods in render class don't get called at all. The mobile in question is virtually a copy of vanilla wolves, but with various spawning differences, different textures, and sometimes, different behaviors. However, RenderWolf and ModelWolf were copied to give the wolves their models and such. Right now, we simply cannot figure out what is wrong with the rendering on these mobs.

 

The modification adds various wolves to the Minecraft world, all of which are modeled after the vanilla wolf and use basically the same behavior. But the various kinds spawn in different biomes and have their own textures. Code is in the spoiler below. 

 

Spoiler

ClientProxy.java


package slvr.LupineMod.proxy;

import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import slvr.LupineMod.entities.*;
import slvr.LupineMod.init.ModItems;

public class ClientProxy implements CommonProxy{
	
	@Override
	public void preInit(){
		try{
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityAfricanWildDog.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityRedWolf.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityCoyote.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityNetherhound.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityGermanShepherd.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityGoldenRetriever.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityPitBull.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityDingo.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityArcticWolf.class, new VariedWolfRenderFactory());
			RenderingRegistry.registerEntityRenderingHandler(slvr.LupineMod.entities.EntityEndWolf.class, new VariedWolfRenderFactory());
			}catch(Exception e){
				e.printStackTrace();
			}
	}
	public void init(){
		ModItems.registerRenders();

		
	}
	

}

 

EntityVariedWolf.java


package slvr.LupineMod.entities;

import com.google.common.base.Predicate;
import java.util.UUID;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAIBeg;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
import net.minecraft.entity.ai.EntityAISit;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITargetNonTamed;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

	public abstract class EntityVariedWolf extends EntityTameable {
	    private static final DataParameter<Float> DATA_HEALTH_ID = EntityDataManager.<Float>createKey(EntityVariedWolf.class, DataSerializers.FLOAT);
	    private static final DataParameter<Boolean> BEGGING = EntityDataManager.<Boolean>createKey(EntityVariedWolf.class, DataSerializers.BOOLEAN);
	    private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.<Integer>createKey(EntityVariedWolf.class, DataSerializers.VARINT);
	    /** Float used to smooth the rotation of the wolf head */
	    private float headRotationCourse;
	    private float headRotationCourseOld;
	    /** true is the wolf is wet else false */
	    private boolean isWet;
	    /** True if the wolf is shaking else False */
	    private boolean isShaking;
	    /** This time increases while wolf is shaking and emitting water particles. */
	    private float timeWolfIsShaking;
	    private float prevTimeWolfIsShaking;
		private Object net;

	    /*
		 *African Wild Dog: 1
		 *Red Wolf: 2
		 *Coyote: 3
		 *Netherhound: 4
		 *Stray German Shepherd White: 5
		 *Stray German Shepherd Black: 6
		 *Stray German Shepherd Normal: 7
		 *Stray Golden Retriever: 8
		 *Stray Pit Bull: 9
		 *Dingo: 10
		 *Arctic Wolf: 11
		 *End Wolf: 12
		 */
		private static final DataParameter<Integer> WOLF_TYPE = EntityDataManager.<Integer>createKey(EntityVariedWolf.class, DataSerializers.VARINT);
	    
	    public EntityVariedWolf(World worldIn)
	    {
	        super(worldIn);
	        this.setSize(0.6F, 0.85F);
	        this.setTamed(false);
	    }

	    protected void initEntityAI()
	    {
	        this.tasks.addTask(1, new EntityAISwimming(this));
	        this.tasks.addTask(2, this.aiSit = new EntityAISit(this));
	        this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
	        this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, true));
	        this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
	        this.tasks.addTask(6, new EntityAIWolfMateModified(this, 1.0D));
	        this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
	        this.tasks.addTask(8, new EntityAIVariedWolfBeg(this, 8.0F));
	        this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	        this.tasks.addTask(9, new EntityAILookIdle(this));
	        this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
	        this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
	        this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
	        this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
	        {
	            public boolean apply(@Nullable Entity p_apply_1_)
	            {
	                return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
	            }
	        }));
	        this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, false));
	        }
	    protected void applyEntityAttributes()
	    {
	        super.applyEntityAttributes();
	        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);

	        if (this.isTamed())
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
	        }
	        else
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(8.0D);
	        }
	        	this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(2.0D);  	
	    }

	    /**
	     * Sets the active target the Task system uses for tracking
	     */
	    public void setAttackTarget(@Nullable EntityLivingBase entitylivingbaseIn)
	    {
	        super.setAttackTarget(entitylivingbaseIn);

	        if (entitylivingbaseIn == null)
	        {
	            this.setAngry(false);
	        }
	        else if (!this.isTamed())
	        {
	            this.setAngry(true);
	        }
	    }

	    protected void updateAITasks()
	    {
	        this.dataManager.set(DATA_HEALTH_ID, Float.valueOf(this.getHealth()));
	    }

	    protected void entityInit()
	    {
	        super.entityInit();
	        this.dataManager.register(DATA_HEALTH_ID, Float.valueOf(this.getHealth()));
	        this.dataManager.register(BEGGING, Boolean.valueOf(false));
	        this.dataManager.register(COLLAR_COLOR, Integer.valueOf(EnumDyeColor.RED.getDyeDamage()));
	        this.dataManager.register(WOLF_TYPE, Integer.valueOf(0));
	        
	    }

	    protected void playStepSound(BlockPos pos, Block blockIn)
	    {
	        this.playSound(SoundEvents.ENTITY_WOLF_STEP, 0.15F, 1.0F);
	    }

	    /**
	     * (abstract) Protected helper method to write subclass entity data to NBT.
	     */
	    public void writeEntityToNBT(NBTTagCompound compound)
	    {
	        super.writeEntityToNBT(compound);
	        compound.setBoolean("Angry", this.isAngry());
	        compound.setByte("CollarColor", (byte)this.getCollarColor().getDyeDamage());
	        compound.setInteger("wolftype", this.getWolfType());
	    }

	    /**
	     * (abstract) Protected helper method to read subclass entity data from NBT.
	     */
	    public void readEntityFromNBT(NBTTagCompound compound)
	    {
	        super.readEntityFromNBT(compound);
	        this.setAngry(compound.getBoolean("Angry"));

	        if (compound.hasKey("CollarColor", 99))
	        {
	            this.setCollarColor(EnumDyeColor.byDyeDamage(compound.getByte("CollarColor")));
	        }
	        this.setWolfType(compound.getInteger("wolftype"));
	    }
	    public int getWolfType(){
			return ((Integer)this.dataManager.get(WOLF_TYPE)).intValue();
		}
	    public void setWolfType(int i){
			this.dataManager.set(WOLF_TYPE, Integer.valueOf(i));
		}


	    protected SoundEvent getAmbientSound()
	    {
	        return this.isAngry() ? SoundEvents.ENTITY_WOLF_GROWL : (this.rand.nextInt(3) == 0 ? (this.isTamed() && ((Float)this.dataManager.get(DATA_HEALTH_ID)).floatValue() < 10.0F ? SoundEvents.ENTITY_WOLF_WHINE : SoundEvents.ENTITY_WOLF_PANT) : SoundEvents.ENTITY_WOLF_AMBIENT);
	    }

	    protected SoundEvent getHurtSound()
	    {
	        return SoundEvents.ENTITY_WOLF_HURT;
	    }

	    protected SoundEvent getDeathSound()
	    {
	        return SoundEvents.ENTITY_WOLF_DEATH;
	    }

	    /**
	     * Returns the volume for the sounds this mob makes.
	     */
	    protected float getSoundVolume()
	    {
	        return 0.4F;
	    }

	    @Nullable
	    protected ResourceLocation getLootTable()
	    {
	        return LootTableList.ENTITIES_WOLF;
	    }

	    /**
	     * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
	     * use this to react to sunlight and start to burn.
	     */
	    public void onLivingUpdate()
	    {
	        super.onLivingUpdate();

	        if (!this.world.isRemote && this.isWet && !this.isShaking && !this.hasPath() && this.onGround)
	        {
	            this.isShaking = true;
	            this.timeWolfIsShaking = 0.0F;
	            this.prevTimeWolfIsShaking = 0.0F;
	            this.world.setEntityState(this, (byte)8);
	        }

	        if (!this.world.isRemote && this.getAttackTarget() == null && this.isAngry())
	        {
	            this.setAngry(false);
	        }
	        if (this.getWolfType() == 12) {
	        	this.world.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]);
	        }
	    }

	    /**
	     * Called to update the entity's position/logic.
	     */
	    public void onUpdate()
	    {
	        super.onUpdate();
	        this.headRotationCourseOld = this.headRotationCourse;

	        if (this.isBegging())
	        {
	            this.headRotationCourse += (1.0F - this.headRotationCourse) * 0.4F;
	        }
	        else
	        {
	            this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F;
	        }

	        if (this.isWet())
	        {
	            this.isWet = true;
	            this.isShaking = false;
	            this.timeWolfIsShaking = 0.0F;
	            this.prevTimeWolfIsShaking = 0.0F;
	        }
	        else if ((this.isWet || this.isShaking) && this.isShaking)
	        {
	            if (this.timeWolfIsShaking == 0.0F)
	            {
	                this.playSound(SoundEvents.ENTITY_WOLF_SHAKE, this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
	            }

	            this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
	            this.timeWolfIsShaking += 0.05F;

	            if (this.prevTimeWolfIsShaking >= 2.0F)
	            {
	                this.isWet = false;
	                this.isShaking = false;
	                this.prevTimeWolfIsShaking = 0.0F;
	                this.timeWolfIsShaking = 0.0F;
	            }

	            if (this.timeWolfIsShaking > 0.4F)
	            {
	                float f = (float)this.getEntityBoundingBox().minY;
	                int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F);

	                for (int j = 0; j < i; ++j)
	                {
	                    float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
	                    float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
	                    this.world.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ, new int[0]);
	                }
	            }
	        }
	    }

	    /**
	     * True if the wolf is wet
	     */
	    @SideOnly(Side.CLIENT)
	    public boolean isWolfWet()
	    {
	        return this.isWet;
	    }

	    /**
	     * Used when calculating the amount of shading to apply while the wolf is wet.
	     */
	    @SideOnly(Side.CLIENT)
	    public float getShadingWhileWet(float p_70915_1_)
	    {
	        return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F;
	    }

	    @SideOnly(Side.CLIENT)
	    public float getShakeAngle(float p_70923_1_, float p_70923_2_)
	    {
	        float f = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F;

	        if (f < 0.0F)
	        {
	            f = 0.0F;
	        }
	        else if (f > 1.0F)
	        {
	            f = 1.0F;
	        }

	        return MathHelper.sin(f * (float)Math.PI) * MathHelper.sin(f * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI;
	    }

	    @SideOnly(Side.CLIENT)
	    public float getInterestedAngle(float p_70917_1_)
	    {
	        return (this.headRotationCourseOld + (this.headRotationCourse - this.headRotationCourseOld) * p_70917_1_) * 0.15F * (float)Math.PI;
	    }

	    public float getEyeHeight()
	    {
	        return this.height * 0.8F;
	    }

	    /**
	     * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
	     * use in wolves.
	     */
	    public int getVerticalFaceSpeed()
	    {
	        return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
	    }

	    /**
	     * Called when the entity is attacked.
	     */
	    public boolean attackEntityFrom(DamageSource source, float amount)
	    {
	        if (this.isEntityInvulnerable(source))
	        {
	            return false;
	        }
	        else
	        {
	            Entity entity = source.getEntity();

	            if (this.aiSit != null)
	            {
	                this.aiSit.setSitting(false);
	            }

	            if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow))
	            {
	                amount = (amount + 1.0F) / 2.0F;
	            }

	            return super.attackEntityFrom(source, amount);
	        }
	    }

	    public boolean attackEntityAsMob(Entity entityIn)
	    {
	        boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue()));

	        if (flag)
	        {
	            this.applyEnchantments(this, entityIn);
	        }

	        return flag;
	    }

	    public void setTamed(boolean tamed)
	    {
	        super.setTamed(tamed);

	        if (tamed)
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
	        }
	        else
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(8.0D);
	        }
	    }
	    
	    private void tryToTame(EntityPlayer player, ItemStack stack, int chance){
	        if (!player.capabilities.isCreativeMode)
	                {
	                    stack.shrink(1);
	                }

	                if (!this.world.isRemote)
	                {
	                    if (this.rand.nextInt(chance) == 0)
	                    {
	                        this.setTamed(true);
	                        this.navigator.clearPathEntity();
	                        this.setAttackTarget((EntityLivingBase)null);
	                        this.aiSit.setSitting(true);
	                        this.setHealth(20.0F);
	                        this.setOwnerId(player.getUniqueID());
	                        this.playTameEffect(true);
	                        this.world.setEntityState(this, (byte)7);
	                    }
	                    else
	                    {
	                        this.playTameEffect(false);
	                        this.world.setEntityState(this, (byte)6);
	                    }
	                }
	        }


	    public boolean processInteract(EntityPlayer player, EnumHand hand)
	    {
	    	ItemStack stack = player.getHeldItem(hand);
	    	
	        if (this.isTamed())
	        {
	            if (stack != null)
	            {
	                if (stack.getItem() instanceof ItemFood)
	                {
	                    ItemFood itemfood = (ItemFood)stack.getItem();

	                    if (itemfood.isWolfsFavoriteMeat() && ((Float)this.dataManager.get(DATA_HEALTH_ID)).floatValue() < 20.0F)
	                    {
	                        if (!player.capabilities.isCreativeMode)
	                        {
	                            stack.shrink(1);
	                        }

	                        this.heal((float)itemfood.getHealAmount(stack));
	                        return true;
	                    }
	                }
	                else if (stack.getItem() == Items.DYE)
	                {
	                    EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

	                    if (enumdyecolor != this.getCollarColor())
	                    {
	                        this.setCollarColor(enumdyecolor);

	                        if (!player.capabilities.isCreativeMode)
	                        {
	                        	stack.shrink(1);
	                        }

	                        return true;
	                    }
	                }
	            }

	            if (this.isOwner(player) && !this.world.isRemote && !this.isBreedingItem(stack))
	            {
	                this.aiSit.setSitting(!this.isSitting());
	                this.isJumping = false;
	                this.navigator.clearPathEntity();
	                this.setAttackTarget((EntityLivingBase)null);
	            }
	        }
	        else {
	        	if(stack != null && !this.isAngry()){
	                if(this.getWolfType() == 4){
	                if(stack.getItem() == Items.SKULL && stack.getMetadata() == 1){
	                this.tryToTame(player, stack, 1);
	                return true;
	                }
	                }else if (this.getWolfType() == 12){
	                if(stack.getItem() == Items.ENDER_PEARL){
	                this.tryToTame(player, stack, 4);
	                return true;
	                }
	                }else{
	                if(stack.getItem() == Items.BONE){
	                this.tryToTame(player, stack, 3);
	                return true;
	                }
	                }
	                }
	        }

	        return super.processInteract(player, hand);
	    }

	    @SideOnly(Side.CLIENT)
	    public void handleStatusUpdate(byte id)
	    {
	        if (id == 8)
	        {
	            this.isShaking = true;
	            this.timeWolfIsShaking = 0.0F;
	            this.prevTimeWolfIsShaking = 0.0F;
	        }
	        else
	        {
	            super.handleStatusUpdate(id);
	        }
	    }

	    @SideOnly(Side.CLIENT)
	    public float getTailRotation()
	    {
	        return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - ((Float)this.dataManager.get(DATA_HEALTH_ID)).floatValue()) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));
	    }

	    /**
	     * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
	     * the animal type)
	     */
	    public boolean isBreedingItem(@Nullable ItemStack stack)
	    {
	    	return stack == null ? false : (!(stack.getItem() instanceof ItemFood) ? false : ((ItemFood)stack.getItem()).isWolfsFavoriteMeat());
	    }

	    /**
	     * Will return how many at most can spawn in a chunk at once.
	     */
	    public int getMaxSpawnedInChunk()
	    {
	        return 8;
	    }

	    /**
	     * Determines whether this wolf is angry or not.
	     */
	    public boolean isAngry()
	    {
	        return (((Byte)this.dataManager.get(TAMED)).byteValue() & 2) != 0;
	    }

	    /**
	     * Sets whether this wolf is angry or not.
	     */
	    public void setAngry(boolean angry)
	    {
	        byte b0 = ((Byte)this.dataManager.get(TAMED)).byteValue();

	        if (angry)
	        {
	            this.dataManager.set(TAMED, Byte.valueOf((byte)(b0 | 2)));
	        }
	        else
	        {
	            this.dataManager.set(TAMED, Byte.valueOf((byte)(b0 & -3)));
	        }
	    }

	    public EnumDyeColor getCollarColor()
	    {
	        return EnumDyeColor.byDyeDamage(((Integer)this.dataManager.get(COLLAR_COLOR)).intValue() & 15);
	    }

	    public void setCollarColor(EnumDyeColor collarcolor)
	    {
	        this.dataManager.set(COLLAR_COLOR, Integer.valueOf(collarcolor.getDyeDamage()));
	    }

	    public EntityVariedWolf createChild(EntityAgeable ageable)
	    {
	        EntityVariedWolf entitywolf;
	        if (rand.nextBoolean() && ageable instanceof EntityVariedWolf){
	        	entitywolf = EntityVariedWolf.getNewWolfFromType(((EntityVariedWolf)ageable).getWolfType(), this.world);
	        }else{
	        	entitywolf = EntityVariedWolf.getNewWolfFromType(this.getWolfType(), this.world);
	        }

	        UUID uuid = this.getOwnerId();

	        if (uuid != null && entitywolf != null)
	        {
	            entitywolf.setOwnerId(uuid);
	            entitywolf.setTamed(true);
	        }

	        return entitywolf;
	    }
	    
	    public static EntityVariedWolf getNewWolfFromType(int type, World world){
	    	switch(type){
	    	case 1:
	    		return new EntityAfricanWildDog(world);
	    	case 2:
	    		return new EntityRedWolf(world);
	    	case 3:
	    		return new EntityCoyote(world);
	    	case 4:
	    		return new EntityNetherhound(world);
	    	case 5:
	    		return new EntityGermanShepherd(world);
	    	case 6:
	    		return new EntityGermanShepherd(world);
	    	case 7:
	    		return new EntityGermanShepherd(world);
	    	case 8:
	    		return new EntityGoldenRetriever(world);
	    	case 9:
	    		return new EntityPitBull(world);
	    	case 10:
	    		return new EntityDingo(world);
	    	case 11:
	    		return new EntityArcticWolf(world);
	    	case 12:
	    		return new EntityEndWolf(world);
	    	}
	    	return null;
	    }

	    public void setBegging(boolean beg)
	    {
	        this.dataManager.set(BEGGING, Boolean.valueOf(beg));
	    }

	    /**
	     * Returns true if the mob is currently able to mate with the specified mob.
	     */
	    public boolean canMateWith(EntityAnimal otherAnimal)
	    {
	        if (otherAnimal == this)
	        {
	            return false;
	        }
	        else if (!this.isTamed())
	        {
	            return false;
	        }
	        else if (!(otherAnimal instanceof EntityVariedWolf))
	        {
	            return false;
	        }
	        else
	        {
	            EntityVariedWolf entitywolf = (EntityVariedWolf)otherAnimal;
	            return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove());
	        }
	    }

	    public boolean isBegging()
	    {
	        return ((Boolean)this.dataManager.get(BEGGING)).booleanValue();
	    }

	    /**
	     * Determines if an entity can be despawned, used on idle far away entities
	     */
	    protected boolean canDespawn()
	    {
	        return false;
	    }

	    public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
	    {
	        if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
	        {
	            if (p_142018_1_ instanceof EntityVariedWolf)
	            {
	                EntityVariedWolf entitywolf = (EntityVariedWolf)p_142018_1_;

	                if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
	                {
	                    return false;
	                }
	            }

	            return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
	        }
	        else
	        {
	            return false;
	        }
	    }

	    public boolean canBeLeashedTo(EntityPlayer player)
	    {
	        return !this.isAngry() && super.canBeLeashedTo(player);
	    }
	}

 

LayerVariedWolfCollar.java


package slvr.LupineMod.entities;

import com.google.common.base.Predicate;
import java.util.UUID;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAIBeg;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
import net.minecraft.entity.ai.EntityAISit;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITargetNonTamed;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

	public abstract class EntityVariedWolf extends EntityTameable {
	    private static final DataParameter<Float> DATA_HEALTH_ID = EntityDataManager.<Float>createKey(EntityVariedWolf.class, DataSerializers.FLOAT);
	    private static final DataParameter<Boolean> BEGGING = EntityDataManager.<Boolean>createKey(EntityVariedWolf.class, DataSerializers.BOOLEAN);
	    private static final DataParameter<Integer> COLLAR_COLOR = EntityDataManager.<Integer>createKey(EntityVariedWolf.class, DataSerializers.VARINT);
	    /** Float used to smooth the rotation of the wolf head */
	    private float headRotationCourse;
	    private float headRotationCourseOld;
	    /** true is the wolf is wet else false */
	    private boolean isWet;
	    /** True if the wolf is shaking else False */
	    private boolean isShaking;
	    /** This time increases while wolf is shaking and emitting water particles. */
	    private float timeWolfIsShaking;
	    private float prevTimeWolfIsShaking;
		private Object net;

	    /*
		 *African Wild Dog: 1
		 *Red Wolf: 2
		 *Coyote: 3
		 *Netherhound: 4
		 *Stray German Shepherd White: 5
		 *Stray German Shepherd Black: 6
		 *Stray German Shepherd Normal: 7
		 *Stray Golden Retriever: 8
		 *Stray Pit Bull: 9
		 *Dingo: 10
		 *Arctic Wolf: 11
		 *End Wolf: 12
		 */
		private static final DataParameter<Integer> WOLF_TYPE = EntityDataManager.<Integer>createKey(EntityVariedWolf.class, DataSerializers.VARINT);
	    
	    public EntityVariedWolf(World worldIn)
	    {
	        super(worldIn);
	        this.setSize(0.6F, 0.85F);
	        this.setTamed(false);
	    }

	    protected void initEntityAI()
	    {
	        this.tasks.addTask(1, new EntityAISwimming(this));
	        this.tasks.addTask(2, this.aiSit = new EntityAISit(this));
	        this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
	        this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, true));
	        this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
	        this.tasks.addTask(6, new EntityAIWolfMateModified(this, 1.0D));
	        this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
	        this.tasks.addTask(8, new EntityAIVariedWolfBeg(this, 8.0F));
	        this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	        this.tasks.addTask(9, new EntityAILookIdle(this));
	        this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
	        this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
	        this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
	        this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
	        {
	            public boolean apply(@Nullable Entity p_apply_1_)
	            {
	                return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
	            }
	        }));
	        this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, false));
	        }
	    protected void applyEntityAttributes()
	    {
	        super.applyEntityAttributes();
	        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);

	        if (this.isTamed())
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
	        }
	        else
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(8.0D);
	        }
	        	this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(2.0D);  	
	    }

	    /**
	     * Sets the active target the Task system uses for tracking
	     */
	    public void setAttackTarget(@Nullable EntityLivingBase entitylivingbaseIn)
	    {
	        super.setAttackTarget(entitylivingbaseIn);

	        if (entitylivingbaseIn == null)
	        {
	            this.setAngry(false);
	        }
	        else if (!this.isTamed())
	        {
	            this.setAngry(true);
	        }
	    }

	    protected void updateAITasks()
	    {
	        this.dataManager.set(DATA_HEALTH_ID, Float.valueOf(this.getHealth()));
	    }

	    protected void entityInit()
	    {
	        super.entityInit();
	        this.dataManager.register(DATA_HEALTH_ID, Float.valueOf(this.getHealth()));
	        this.dataManager.register(BEGGING, Boolean.valueOf(false));
	        this.dataManager.register(COLLAR_COLOR, Integer.valueOf(EnumDyeColor.RED.getDyeDamage()));
	        this.dataManager.register(WOLF_TYPE, Integer.valueOf(0));
	        
	    }

	    protected void playStepSound(BlockPos pos, Block blockIn)
	    {
	        this.playSound(SoundEvents.ENTITY_WOLF_STEP, 0.15F, 1.0F);
	    }

	    /**
	     * (abstract) Protected helper method to write subclass entity data to NBT.
	     */
	    public void writeEntityToNBT(NBTTagCompound compound)
	    {
	        super.writeEntityToNBT(compound);
	        compound.setBoolean("Angry", this.isAngry());
	        compound.setByte("CollarColor", (byte)this.getCollarColor().getDyeDamage());
	        compound.setInteger("wolftype", this.getWolfType());
	    }

	    /**
	     * (abstract) Protected helper method to read subclass entity data from NBT.
	     */
	    public void readEntityFromNBT(NBTTagCompound compound)
	    {
	        super.readEntityFromNBT(compound);
	        this.setAngry(compound.getBoolean("Angry"));

	        if (compound.hasKey("CollarColor", 99))
	        {
	            this.setCollarColor(EnumDyeColor.byDyeDamage(compound.getByte("CollarColor")));
	        }
	        this.setWolfType(compound.getInteger("wolftype"));
	    }
	    public int getWolfType(){
			return ((Integer)this.dataManager.get(WOLF_TYPE)).intValue();
		}
	    public void setWolfType(int i){
			this.dataManager.set(WOLF_TYPE, Integer.valueOf(i));
		}


	    protected SoundEvent getAmbientSound()
	    {
	        return this.isAngry() ? SoundEvents.ENTITY_WOLF_GROWL : (this.rand.nextInt(3) == 0 ? (this.isTamed() && ((Float)this.dataManager.get(DATA_HEALTH_ID)).floatValue() < 10.0F ? SoundEvents.ENTITY_WOLF_WHINE : SoundEvents.ENTITY_WOLF_PANT) : SoundEvents.ENTITY_WOLF_AMBIENT);
	    }

	    protected SoundEvent getHurtSound()
	    {
	        return SoundEvents.ENTITY_WOLF_HURT;
	    }

	    protected SoundEvent getDeathSound()
	    {
	        return SoundEvents.ENTITY_WOLF_DEATH;
	    }

	    /**
	     * Returns the volume for the sounds this mob makes.
	     */
	    protected float getSoundVolume()
	    {
	        return 0.4F;
	    }

	    @Nullable
	    protected ResourceLocation getLootTable()
	    {
	        return LootTableList.ENTITIES_WOLF;
	    }

	    /**
	     * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
	     * use this to react to sunlight and start to burn.
	     */
	    public void onLivingUpdate()
	    {
	        super.onLivingUpdate();

	        if (!this.world.isRemote && this.isWet && !this.isShaking && !this.hasPath() && this.onGround)
	        {
	            this.isShaking = true;
	            this.timeWolfIsShaking = 0.0F;
	            this.prevTimeWolfIsShaking = 0.0F;
	            this.world.setEntityState(this, (byte)8);
	        }

	        if (!this.world.isRemote && this.getAttackTarget() == null && this.isAngry())
	        {
	            this.setAngry(false);
	        }
	        if (this.getWolfType() == 12) {
	        	this.world.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]);
	        }
	    }

	    /**
	     * Called to update the entity's position/logic.
	     */
	    public void onUpdate()
	    {
	        super.onUpdate();
	        this.headRotationCourseOld = this.headRotationCourse;

	        if (this.isBegging())
	        {
	            this.headRotationCourse += (1.0F - this.headRotationCourse) * 0.4F;
	        }
	        else
	        {
	            this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F;
	        }

	        if (this.isWet())
	        {
	            this.isWet = true;
	            this.isShaking = false;
	            this.timeWolfIsShaking = 0.0F;
	            this.prevTimeWolfIsShaking = 0.0F;
	        }
	        else if ((this.isWet || this.isShaking) && this.isShaking)
	        {
	            if (this.timeWolfIsShaking == 0.0F)
	            {
	                this.playSound(SoundEvents.ENTITY_WOLF_SHAKE, this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
	            }

	            this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
	            this.timeWolfIsShaking += 0.05F;

	            if (this.prevTimeWolfIsShaking >= 2.0F)
	            {
	                this.isWet = false;
	                this.isShaking = false;
	                this.prevTimeWolfIsShaking = 0.0F;
	                this.timeWolfIsShaking = 0.0F;
	            }

	            if (this.timeWolfIsShaking > 0.4F)
	            {
	                float f = (float)this.getEntityBoundingBox().minY;
	                int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F);

	                for (int j = 0; j < i; ++j)
	                {
	                    float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
	                    float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
	                    this.world.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ, new int[0]);
	                }
	            }
	        }
	    }

	    /**
	     * True if the wolf is wet
	     */
	    @SideOnly(Side.CLIENT)
	    public boolean isWolfWet()
	    {
	        return this.isWet;
	    }

	    /**
	     * Used when calculating the amount of shading to apply while the wolf is wet.
	     */
	    @SideOnly(Side.CLIENT)
	    public float getShadingWhileWet(float p_70915_1_)
	    {
	        return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F;
	    }

	    @SideOnly(Side.CLIENT)
	    public float getShakeAngle(float p_70923_1_, float p_70923_2_)
	    {
	        float f = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F;

	        if (f < 0.0F)
	        {
	            f = 0.0F;
	        }
	        else if (f > 1.0F)
	        {
	            f = 1.0F;
	        }

	        return MathHelper.sin(f * (float)Math.PI) * MathHelper.sin(f * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI;
	    }

	    @SideOnly(Side.CLIENT)
	    public float getInterestedAngle(float p_70917_1_)
	    {
	        return (this.headRotationCourseOld + (this.headRotationCourse - this.headRotationCourseOld) * p_70917_1_) * 0.15F * (float)Math.PI;
	    }

	    public float getEyeHeight()
	    {
	        return this.height * 0.8F;
	    }

	    /**
	     * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
	     * use in wolves.
	     */
	    public int getVerticalFaceSpeed()
	    {
	        return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
	    }

	    /**
	     * Called when the entity is attacked.
	     */
	    public boolean attackEntityFrom(DamageSource source, float amount)
	    {
	        if (this.isEntityInvulnerable(source))
	        {
	            return false;
	        }
	        else
	        {
	            Entity entity = source.getEntity();

	            if (this.aiSit != null)
	            {
	                this.aiSit.setSitting(false);
	            }

	            if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow))
	            {
	                amount = (amount + 1.0F) / 2.0F;
	            }

	            return super.attackEntityFrom(source, amount);
	        }
	    }

	    public boolean attackEntityAsMob(Entity entityIn)
	    {
	        boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue()));

	        if (flag)
	        {
	            this.applyEnchantments(this, entityIn);
	        }

	        return flag;
	    }

	    public void setTamed(boolean tamed)
	    {
	        super.setTamed(tamed);

	        if (tamed)
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20.0D);
	        }
	        else
	        {
	            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(8.0D);
	        }
	    }
	    
	    private void tryToTame(EntityPlayer player, ItemStack stack, int chance){
	        if (!player.capabilities.isCreativeMode)
	                {
	                    stack.shrink(1);
	                }

	                if (!this.world.isRemote)
	                {
	                    if (this.rand.nextInt(chance) == 0)
	                    {
	                        this.setTamed(true);
	                        this.navigator.clearPathEntity();
	                        this.setAttackTarget((EntityLivingBase)null);
	                        this.aiSit.setSitting(true);
	                        this.setHealth(20.0F);
	                        this.setOwnerId(player.getUniqueID());
	                        this.playTameEffect(true);
	                        this.world.setEntityState(this, (byte)7);
	                    }
	                    else
	                    {
	                        this.playTameEffect(false);
	                        this.world.setEntityState(this, (byte)6);
	                    }
	                }
	        }


	    public boolean processInteract(EntityPlayer player, EnumHand hand)
	    {
	    	ItemStack stack = player.getHeldItem(hand);
	    	
	        if (this.isTamed())
	        {
	            if (stack != null)
	            {
	                if (stack.getItem() instanceof ItemFood)
	                {
	                    ItemFood itemfood = (ItemFood)stack.getItem();

	                    if (itemfood.isWolfsFavoriteMeat() && ((Float)this.dataManager.get(DATA_HEALTH_ID)).floatValue() < 20.0F)
	                    {
	                        if (!player.capabilities.isCreativeMode)
	                        {
	                            stack.shrink(1);
	                        }

	                        this.heal((float)itemfood.getHealAmount(stack));
	                        return true;
	                    }
	                }
	                else if (stack.getItem() == Items.DYE)
	                {
	                    EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

	                    if (enumdyecolor != this.getCollarColor())
	                    {
	                        this.setCollarColor(enumdyecolor);

	                        if (!player.capabilities.isCreativeMode)
	                        {
	                        	stack.shrink(1);
	                        }

	                        return true;
	                    }
	                }
	            }

	            if (this.isOwner(player) && !this.world.isRemote && !this.isBreedingItem(stack))
	            {
	                this.aiSit.setSitting(!this.isSitting());
	                this.isJumping = false;
	                this.navigator.clearPathEntity();
	                this.setAttackTarget((EntityLivingBase)null);
	            }
	        }
	        else {
	        	if(stack != null && !this.isAngry()){
	                if(this.getWolfType() == 4){
	                if(stack.getItem() == Items.SKULL && stack.getMetadata() == 1){
	                this.tryToTame(player, stack, 1);
	                return true;
	                }
	                }else if (this.getWolfType() == 12){
	                if(stack.getItem() == Items.ENDER_PEARL){
	                this.tryToTame(player, stack, 4);
	                return true;
	                }
	                }else{
	                if(stack.getItem() == Items.BONE){
	                this.tryToTame(player, stack, 3);
	                return true;
	                }
	                }
	                }
	        }

	        return super.processInteract(player, hand);
	    }

	    @SideOnly(Side.CLIENT)
	    public void handleStatusUpdate(byte id)
	    {
	        if (id == 8)
	        {
	            this.isShaking = true;
	            this.timeWolfIsShaking = 0.0F;
	            this.prevTimeWolfIsShaking = 0.0F;
	        }
	        else
	        {
	            super.handleStatusUpdate(id);
	        }
	    }

	    @SideOnly(Side.CLIENT)
	    public float getTailRotation()
	    {
	        return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - ((Float)this.dataManager.get(DATA_HEALTH_ID)).floatValue()) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));
	    }

	    /**
	     * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
	     * the animal type)
	     */
	    public boolean isBreedingItem(@Nullable ItemStack stack)
	    {
	    	return stack == null ? false : (!(stack.getItem() instanceof ItemFood) ? false : ((ItemFood)stack.getItem()).isWolfsFavoriteMeat());
	    }

	    /**
	     * Will return how many at most can spawn in a chunk at once.
	     */
	    public int getMaxSpawnedInChunk()
	    {
	        return 8;
	    }

	    /**
	     * Determines whether this wolf is angry or not.
	     */
	    public boolean isAngry()
	    {
	        return (((Byte)this.dataManager.get(TAMED)).byteValue() & 2) != 0;
	    }

	    /**
	     * Sets whether this wolf is angry or not.
	     */
	    public void setAngry(boolean angry)
	    {
	        byte b0 = ((Byte)this.dataManager.get(TAMED)).byteValue();

	        if (angry)
	        {
	            this.dataManager.set(TAMED, Byte.valueOf((byte)(b0 | 2)));
	        }
	        else
	        {
	            this.dataManager.set(TAMED, Byte.valueOf((byte)(b0 & -3)));
	        }
	    }

	    public EnumDyeColor getCollarColor()
	    {
	        return EnumDyeColor.byDyeDamage(((Integer)this.dataManager.get(COLLAR_COLOR)).intValue() & 15);
	    }

	    public void setCollarColor(EnumDyeColor collarcolor)
	    {
	        this.dataManager.set(COLLAR_COLOR, Integer.valueOf(collarcolor.getDyeDamage()));
	    }

	    public EntityVariedWolf createChild(EntityAgeable ageable)
	    {
	        EntityVariedWolf entitywolf;
	        if (rand.nextBoolean() && ageable instanceof EntityVariedWolf){
	        	entitywolf = EntityVariedWolf.getNewWolfFromType(((EntityVariedWolf)ageable).getWolfType(), this.world);
	        }else{
	        	entitywolf = EntityVariedWolf.getNewWolfFromType(this.getWolfType(), this.world);
	        }

	        UUID uuid = this.getOwnerId();

	        if (uuid != null && entitywolf != null)
	        {
	            entitywolf.setOwnerId(uuid);
	            entitywolf.setTamed(true);
	        }

	        return entitywolf;
	    }
	    
	    public static EntityVariedWolf getNewWolfFromType(int type, World world){
	    	switch(type){
	    	case 1:
	    		return new EntityAfricanWildDog(world);
	    	case 2:
	    		return new EntityRedWolf(world);
	    	case 3:
	    		return new EntityCoyote(world);
	    	case 4:
	    		return new EntityNetherhound(world);
	    	case 5:
	    		return new EntityGermanShepherd(world);
	    	case 6:
	    		return new EntityGermanShepherd(world);
	    	case 7:
	    		return new EntityGermanShepherd(world);
	    	case 8:
	    		return new EntityGoldenRetriever(world);
	    	case 9:
	    		return new EntityPitBull(world);
	    	case 10:
	    		return new EntityDingo(world);
	    	case 11:
	    		return new EntityArcticWolf(world);
	    	case 12:
	    		return new EntityEndWolf(world);
	    	}
	    	return null;
	    }

	    public void setBegging(boolean beg)
	    {
	        this.dataManager.set(BEGGING, Boolean.valueOf(beg));
	    }

	    /**
	     * Returns true if the mob is currently able to mate with the specified mob.
	     */
	    public boolean canMateWith(EntityAnimal otherAnimal)
	    {
	        if (otherAnimal == this)
	        {
	            return false;
	        }
	        else if (!this.isTamed())
	        {
	            return false;
	        }
	        else if (!(otherAnimal instanceof EntityVariedWolf))
	        {
	            return false;
	        }
	        else
	        {
	            EntityVariedWolf entitywolf = (EntityVariedWolf)otherAnimal;
	            return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove());
	        }
	    }

	    public boolean isBegging()
	    {
	        return ((Boolean)this.dataManager.get(BEGGING)).booleanValue();
	    }

	    /**
	     * Determines if an entity can be despawned, used on idle far away entities
	     */
	    protected boolean canDespawn()
	    {
	        return false;
	    }

	    public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
	    {
	        if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
	        {
	            if (p_142018_1_ instanceof EntityVariedWolf)
	            {
	                EntityVariedWolf entitywolf = (EntityVariedWolf)p_142018_1_;

	                if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
	                {
	                    return false;
	                }
	            }

	            return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
	        }
	        else
	        {
	            return false;
	        }
	    }

	    public boolean canBeLeashedTo(EntityPlayer player)
	    {
	        return !this.isAngry() && super.canBeLeashedTo(player);
	    }
	}

 

RenderVariedWolf.java


package slvr.LupineMod.entities;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerWolfCollar;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RenderVariedWolf extends RenderLiving<EntityVariedWolf> {
	private ResourceLocation angryTexture;
	private ResourceLocation normalTexture;
	private ResourceLocation tamedTexture;

	public RenderVariedWolf(RenderManager p_i47187_1_)
    {
        super(p_i47187_1_, new VariedWolfModel(), 0.5F);
        this.addLayer(new LayerVariedWolfCollar(this));
    }

    /**
     * Defines what float the third param in setRotationAngles of ModelBase is
     */
    protected float handleRotationFloat(EntityVariedWolf livingBase, float partialTicks)
    {
        return livingBase.getTailRotation();
    }

    /**
     * Renders the desired {@code T} type Entity.
     */
    public void doRender(EntityVariedWolf entity, double x, double y, double z, float entityYaw, float partialTicks)
    {
    	System.out.println("SLUPINEMOD: DORENDER");
        if (entity.isWolfWet())
        {
            float f = entity.getBrightness(partialTicks) * entity.getShadingWhileWet(partialTicks);
            GlStateManager.color(f, f, f);
        }

        super.doRender(entity, x, y, z, entityYaw, partialTicks);
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(EntityVariedWolf entity)
    {
	angryTexture = new ResourceLocation("slupinemod:textures/entity/wolf_" + ((EntityVariedWolf)entity).getWolfType() + "_angry.png");
normalTexture = new ResourceLocation("slupinemod:textures/entity/wolf_" + ((EntityVariedWolf)entity).getWolfType() + ".png");
tamedTexture = new ResourceLocation("slupinemod:textures/entity/wolf_" + ((EntityVariedWolf)entity).getWolfType()+ "_tamed.png");
        return entity.isTamed() ? tamedTexture : (entity.isAngry() ? angryTexture : normalTexture);
    }
	
}

 

VariedWolfModel.java


package slvr.LupineMod.entities;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class VariedWolfModel extends ModelBase
{
	 /** main box for the wolf head */
    public ModelRenderer wolfHeadMain;
    /** The wolf's body */
    public ModelRenderer wolfBody;
    /** Wolf'se first leg */
    public ModelRenderer wolfLeg1;
    /** Wolf's second leg */
    public ModelRenderer wolfLeg2;
    /** Wolf's third leg */
    public ModelRenderer wolfLeg3;
    /** Wolf's fourth leg */
    public ModelRenderer wolfLeg4;
    /** The wolf's tail */
    ModelRenderer wolfTail;
    /** The wolf's mane */
    ModelRenderer wolfMane;

    public VariedWolfModel()
    {
        float f = 0.0F;
        float f1 = 13.5F;
        this.wolfHeadMain = new ModelRenderer(this, 0, 0);
        this.wolfHeadMain.addBox(-2.0F, -3.0F, -2.0F, 6, 6, 4, 0.0F);
        this.wolfHeadMain.setRotationPoint(-1.0F, 13.5F, -7.0F);
        this.wolfBody = new ModelRenderer(this, 18, 14);
        this.wolfBody.addBox(-3.0F, -2.0F, -3.0F, 6, 9, 6, 0.0F);
        this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F);
        this.wolfMane = new ModelRenderer(this, 21, 0);
        this.wolfMane.addBox(-3.0F, -3.0F, -3.0F, 8, 6, 7, 0.0F);
        this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F);
        this.wolfLeg1 = new ModelRenderer(this, 0, 18);
        this.wolfLeg1.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
        this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
        this.wolfLeg2 = new ModelRenderer(this, 0, 18);
        this.wolfLeg2.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
        this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
        this.wolfLeg3 = new ModelRenderer(this, 0, 18);
        this.wolfLeg3.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
        this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
        this.wolfLeg4 = new ModelRenderer(this, 0, 18);
        this.wolfLeg4.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
        this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
        this.wolfTail = new ModelRenderer(this, 9, 18);
        this.wolfTail.addBox(0.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
        this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
        this.wolfHeadMain.setTextureOffset(16, 14).addBox(-2.0F, -5.0F, 0.0F, 2, 2, 1, 0.0F);
        this.wolfHeadMain.setTextureOffset(16, 14).addBox(2.0F, -5.0F, 0.0F, 2, 2, 1, 0.0F);
        this.wolfHeadMain.setTextureOffset(0, 10).addBox(-0.5F, 0.0F, -5.0F, 3, 3, 4, 0.0F);
    }

    /**
     * Sets the models various rotation angles then renders the model.
     */
    public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
    {
        super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);

        if (this.isChild)
        {
            float f = 2.0F;
            GlStateManager.pushMatrix();
            GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale);
            this.wolfHeadMain.renderWithRotation(scale);
            GlStateManager.popMatrix();
            GlStateManager.pushMatrix();
            GlStateManager.scale(0.5F, 0.5F, 0.5F);
            GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
            this.wolfBody.render(scale);
            this.wolfLeg1.render(scale);
            this.wolfLeg2.render(scale);
            this.wolfLeg3.render(scale);
            this.wolfLeg4.render(scale);
            this.wolfTail.renderWithRotation(scale);
            this.wolfMane.render(scale);
            GlStateManager.popMatrix();
        }
        else
        {
            this.wolfHeadMain.renderWithRotation(scale);
            this.wolfBody.render(scale);
            this.wolfLeg1.render(scale);
            this.wolfLeg2.render(scale);
            this.wolfLeg3.render(scale);
            this.wolfLeg4.render(scale);
            this.wolfTail.renderWithRotation(scale);
            this.wolfMane.render(scale);
        }
    }

    /**
     * Used for easily adding entity-dependent animations. The second and third float params here are the same second
     * and third as in the setRotationAngles method.
     */
    public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTickTime)
    {
        EntityVariedWolf entitywolf = (EntityVariedWolf)entitylivingbaseIn;

        if (entitywolf.isAngry())
        {
            this.wolfTail.rotateAngleY = 0.0F;
        }
        else
        {
            this.wolfTail.rotateAngleY = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
        }

        if (entitywolf.isSitting())
        {
            this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F);
            this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F);
            this.wolfMane.rotateAngleY = 0.0F;
            this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F);
            this.wolfBody.rotateAngleX = ((float)Math.PI / 4F);
            this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F);
            this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F);
            this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F);
            this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F);
            this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F);
            this.wolfLeg3.rotateAngleX = 5.811947F;
            this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F);
            this.wolfLeg4.rotateAngleX = 5.811947F;
            this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F);
        }
        else
        {
            this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F);
            this.wolfBody.rotateAngleX = ((float)Math.PI / 2F);
            this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F);
            this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX;
            this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
            this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
            this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
            this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
            this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
            this.wolfLeg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
            this.wolfLeg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
            this.wolfLeg3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
            this.wolfLeg4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
        }

        this.wolfHeadMain.rotateAngleZ = entitywolf.getInterestedAngle(partialTickTime) + entitywolf.getShakeAngle(partialTickTime, 0.0F);
        this.wolfMane.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.08F);
        this.wolfBody.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.16F);
        this.wolfTail.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.2F);
    }

    /**
     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
     * "far" arms and legs can swing at most.
     */
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
    {
        super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
        this.wolfHeadMain.rotateAngleX = headPitch * 0.017453292F;
        this.wolfHeadMain.rotateAngleY = netHeadYaw * 0.017453292F;
        this.wolfTail.rotateAngleX = ageInTicks;
    }
}

 

VariedWolfIRenderFactory.java


package slvr.LupineMod.entities;

import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;

public class VariedWolfRenderFactory implements IRenderFactory<EntityVariedWolf>{
	
	
	
	public RenderVariedWolf createRenderFor(RenderManager manager){
		return new RenderVariedWolf(manager);
	}

}

 

And here's one of the entity classes  just for sake of example: EntityAfricanWildDog.java


package slvr.LupineMod.entities;

import net.minecraft.world.World;

public class EntityAfricanWildDog extends EntityVariedWolf{
	
	public EntityAfricanWildDog(World dWorld){
		super(dWorld);
	}
	
	protected void entityInit(){
		super.entityInit();
		this.setWolfType(1);
	}

}

 

 
Not signed in

 

Link to comment
Share on other sites

Main mod class: LupineMod.java

package slvr.LupineMod;

import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import slvr.LupineMod.proxy.*;
import net.minecraftforge.common.BiomeManager.BiomeType;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.SpawnListEntry;
import net.minecraftforge.fml.common.Mod;
import slvr.LupineMod.entities.*;
import slvr.LupineMod.init.ModItems;
import slvr.LupineMod.proxy.CommonProxy;
import net.minecraftforge.common.BiomeDictionary;
import static net.minecraftforge.common.BiomeDictionary.Type;

@Mod(modid =Reference.MOD_ID, name =Reference.NAME, version =Reference.VERSION, acceptedMinecraftVersions =Reference.ACCEPTED_VERSIONS)
public class LupineMod {

	@Instance
	public static LupineMod instance;
	
	@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
	public static CommonProxy proxy;
	
	@EventHandler
	public void preInit(FMLPreInitializationEvent event)
	{
		System.out.println("Pre Init");
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "africanWildDog"), EntityAfricanWildDog.class, "africanWildDog", 9, this, 50, 2, true, 0, 0);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "redWolf"), EntityRedWolf.class, "redWolf", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "coyote"), EntityCoyote.class, "coyote", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "netherhound"), EntityNetherhound.class, "netherhound", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "germanShepherd"), EntityGermanShepherd.class, "germanShepherd", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "goldenRetriever"), EntityGoldenRetriever.class, "goldenRetriever", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "pitBull"), EntityPitBull.class, "pitBull", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "dingo"), EntityDingo.class, "dingo", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "arcticWolf"), EntityArcticWolf.class, "arcticWolf", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "endWolf"), EntityEndWolf.class, "endWolf", 9, this, 50, 2, true);
		ModItems.init();
		ModItems.register();
		
	}	
	
	@EventHandler
	public void init(FMLInitializationEvent event)
	{
		System.out.println("Init");
		proxy.init();
	}
	
	@EventHandler
	public void postInit(FMLPostInitializationEvent event)
	{
		System.out.println("Post Init");
		MinecraftForge.EVENT_BUS.register(new LupineEventHandler());
		SpawnListEntry african = new SpawnListEntry(EntityAfricanWildDog.class, 4, 2, 4);
		SpawnListEntry red = new SpawnListEntry(EntityRedWolf.class, 4, 2, 6);
		SpawnListEntry coyote = new SpawnListEntry(EntityCoyote.class, 1, 4, 4);
		SpawnListEntry netherhound = new SpawnListEntry(EntityNetherhound.class, 25, 1, 2);
		SpawnListEntry gs = new SpawnListEntry(EntityGermanShepherd.class, 1, 1, 1);
		SpawnListEntry golden = new SpawnListEntry(EntityGoldenRetriever.class, 1, 1, 1);
		SpawnListEntry pit = new SpawnListEntry(EntityPitBull.class, 1, 1, 1);
		SpawnListEntry dingo = new SpawnListEntry(EntityDingo.class, 2, 1, 1);
		SpawnListEntry arctic = new SpawnListEntry(EntityArcticWolf.class, 4, 4, 4);
		SpawnListEntry end = new SpawnListEntry(EntityEndWolf.class, 5, 4, 4);
		
		Object biomes[] = BiomeDictionary.getBiomes(Type.SANDY).toArray();
		for (int i = 0; i < biomes.length; i++){
			if(BiomeDictionary.hasType((Biome)biomes[i], Type.HOT)){
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(dingo);
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(african);
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(red);
			}
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.SNOWY).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(arctic);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.PLAINS).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(african);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.FOREST).toArray();
		for (int i = 0; i < biomes.length; i++){
			if(!BiomeDictionary.hasType((Biome)biomes[i], Type.SNOWY)){
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(red);
			}
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.NETHER).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.MONSTER).add(netherhound);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.END).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.MONSTER).add(end);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.WASTELAND).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(red);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.MOUNTAIN).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.MUSHROOM).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
			
		}
		
		biomes = BiomeDictionary.getBiomes(Type.JUNGLE).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.SWAMP).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.WATER).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
		}
	}

}

 

Link to comment
Share on other sites

3 hours ago, Leomelonseeds said:

System.out.printLn() in your renderers. Are they being called?

-Shoudn't ClientProxy EXTEND CommonProxy?

-In each eventhandler of your main mod class, you need proxy.init(event); (or preinit, postinit)

 

Edited by Leomelonseeds

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Link to comment
Share on other sites

public static class Factory implements IRenderFactory<ENTITYCLASSNAME> {

        @Override
        public Render<? super ENTITYCLASSNAME> createRenderFor(RenderManager manager) {
            return new RENDERCLASSNAME(manager);
        }

Try this. Also client proxy should extend commonproxy.

Add this to your client proxy and common proxy.

//ClientProxy
@Override
    public void preInit(FMLPreInitializationEvent e) {
        super.preInit(e);
        ModEntities.initModels();
    }
//CommonProxy
public void preInit(FMLPreInitializationEvent e) {
        ModEntities.init();
    }

Then in your main mod class preinit do: proxy.preInit(event);

In your ModEntities have something like this.

public static void init() {
        // Every entity in our mod has an ID (local to this mod)
        int id = 1;
        ResourceLocation resourceLocation = new ResourceLocation("mmm", "fastZombie");
        EntityRegistry.registerModEntity(resourceLocation, EntityFastZombie.class, resourceLocation.toString(), 9990, MastersMobs.instance, 64, 1, true, 8388608, 32768);
        // We want our mob to spawn in Plains and ice plains biomes. If you don't add this then it will not spawn automatically
        // but you can of course still make it spawn manually
        EntityRegistry.addSpawn(ENTITYCLASS.class, 100, 3, 5, EnumCreatureType.MONSTER, Biomes.PLAINS, Biomes.ICE_PLAINS, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.DESERT, Biomes.EXTREME_HILLS);
    }

    @SideOnly(Side.CLIENT)
    public static void initModels() {
        RenderingRegistry.registerEntityRenderingHandler(ENTITYFLLASS.class, FACTORYCLASS.class);
    }

This is just how I would do it. I don't think your renders aren't being called.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.