Jump to content

[1.11.2]Mob Model Error??


many231

Recommended Posts

Okay so I am making a custom mob and I believe it isn't loading the java file of the model, or it isn't rendering properly. There is no white box there just is nothing except for a shadow. Please be specific as you can with answers and keep in mind I am still kinda new to java. :)

Main Class:

package masterminer.mods;

import masterminer.mods.entity.EntityDeer;
import masterminer.mods.entity.RenderDeer;
import masterminer.mods.init.ModItems;
import masterminer.mods.proxy.CommonProxy;
import masterminer.mods.utils.Reference;
import masterminer.mods.utils.Utils;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
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;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class MastersMobs
{
	@Mod.Instance(Reference.MODID)
	public static MastersMobs instance;
	@SidedProxy(serverSide = Reference.SERVER_PROXY_CLASS, clientSide = Reference.CLIENT_PROXY_CLASS)
	public static CommonProxy proxy;
	public static final ResourceLocation LOOT_DEER = LootTableList.register(new ResourceLocation("mmm", "loot_tables/entities/deer"));
	public ModItems items;
    @Mod.EventHandler
    public void preinit(FMLPreInitializationEvent event)
    {
    	ResourceLocation resourceLocation = new ResourceLocation("mmm", "deer");
    	EntityRegistry.registerModEntity(resourceLocation, EntityDeer.class, resourceLocation.toString(), 0, instance, 64, 1, true, 0, 16777215);
    }
    
    @Mod.EventHandler
    public void init(FMLInitializationEvent event)
    {
    	this.items = new ModItems();
    	this.items.init();
    	this.items.register();
    	proxy.registerClient();
    	RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, new RenderDeer());
    }
    
    @Mod.EventHandler
    public void postinit(FMLPostInitializationEvent event)
    {
    	
    }
}

Entity Class:

package masterminer.mods.entity;

import javax.annotation.Nullable;

import masterminer.mods.MastersMobs;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAvoidEntity;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityPolarBear;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class EntityDeer extends EntityAnimal {

	public EntityDeer(World worldIn)
    {
        super(worldIn);
        this.setSize(0.9F, 1.4F);
    }

    public static void registerFixesDeer(DataFixer fixer)
    {
        EntityLiving.registerFixesMob(fixer, EntityDeer.class);
    }
    
    protected void initEntityAI()
    {
        this.tasks.addTask(0, new EntityAISwimming(this));
        this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
        this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
        this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.WHEAT, false));
        this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
        this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
        this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
        this.tasks.addTask(7, new EntityAILookIdle(this));
    }

    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.20000000298023224D);
    }

    protected SoundEvent getAmbientSound()
    {
        return SoundEvents.ENTITY_COW_AMBIENT;
    }

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

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

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

    /**
     * Returns the volume for the sounds this mob makes.
     */
    protected float getSoundVolume()
    {
        return 0.4F;
    }
    
    @Nullable
    protected ResourceLocation getLootTable()
    {
        return MastersMobs.LOOT_DEER;
    }
    
    public EntityDeer createChild(EntityAgeable ageable)
    {
        return new EntityDeer(this.world);
    }

    public float getEyeHeight()
    {
        return this.isChild() ? this.height : 1.3F;
    }
}

Render Class:

package masterminer.mods.entity;

import javax.annotation.Nonnull;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RenderDeer extends RenderLiving<EntityDeer> {
	
	private static final ResourceLocation mobTexture = new ResourceLocation("mmm:textures/entity/deer/deer.png");

    public RenderDeer() {
        super(Minecraft.getMinecraft().getRenderManager(), new ModelDeer(), 0.5F);
    }

    protected ResourceLocation getEntityTexture(EntityDeer entity) {
        return mobTexture;
    }

}

Model Class:

package masterminer.mods.entity;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;

public class ModelDeer extends ModelBase
{
	private ModelRenderer head;
	private ModelRenderer body;
	private ModelRenderer nose1;
	private ModelRenderer nose2;
	private ModelRenderer FLLeg;
	private ModelRenderer FRLeg;
	private ModelRenderer BLLeg;
	private ModelRenderer BRLeg;
	private ModelRenderer tail;
	private ModelRenderer ant1b;
	private ModelRenderer ant1m;
	private ModelRenderer ant1t;
	private ModelRenderer ant2b;
	private ModelRenderer ant2m;
	private ModelRenderer ant2t;
	private ModelRenderer neck;

	public ModelDeer()
	{
		this.textureWidth = 512;
		this.textureHeight = 512;
		this.body = new ModelRenderer(this, 1, 1); // DeerBody
		this.neck = new ModelRenderer(this, 73, 1); // Neck
		this.head = new ModelRenderer(this, 105, 1); // Head
		this.nose1 = new ModelRenderer(this, 137, 1); // Nose1
		this.nose2 = new ModelRenderer(this, 161, 1); // Nose2
		this.ant1b = new ModelRenderer(this, 1, 1); // Ant1B
		this.ant1m = new ModelRenderer(this, 65, 1); // Ant1M
		this.ant1t = new ModelRenderer(this, 73, 1); // Ant1T
		this.ant2b = new ModelRenderer(this, 97, 1); // Ant2B
		this.ant2m = new ModelRenderer(this, 105, 1); // Ant2M
		this.ant2t = new ModelRenderer(this, 185, 1); // Ant2T
		this.FLLeg = new ModelRenderer(this, 193, 1); // LFLeg
		this.FRLeg = new ModelRenderer(this, 209, 1); // RFLeg
		this.BLLeg = new ModelRenderer(this, 225, 1); // LBLeg
		this.BRLeg = new ModelRenderer(this, 241, 1); // RBLeg
		this.tail = new ModelRenderer(this, 257, 1); // Tail

		this.body.addBox(0F, 0F, 0F, 24, 10, 11, 0F); // DeerBody
		this.body.setRotationPoint(0F, -10F, -5F);

		this.neck.addBox(0F, 0F, 0F, 7, 8, 7, 0F); // Neck
		this.neck.setRotationPoint(-3F, -13F, -3F);
		this.neck.rotateAngleZ = 0.40142573F;

		this.head.addBox(0F, 0F, 0F, 10, 8, 9, 0F); // Head
		this.head.setRotationPoint(-6F, -20F, -4F);
		this.head.rotateAngleZ = 0.12217305F;

		this.nose1.addBox(0F, 0F, 0F, 5, 2, 5, 0F); // Nose1
		this.nose1.setRotationPoint(-9.9F, -14F, -2F);
		this.nose1.rotateAngleZ = 0.12217305F;

		this.nose2.addBox(0F, 0F, 0F, 5, 2, 5, 0F); // Nose2
		this.nose2.setRotationPoint(-10.2F, -15F, -2F);
		this.nose2.rotateAngleZ = 0.33161256F;

		this.ant1b.addBox(0F, 0F, 0F, 1, 4, 1, 0F); // Ant1B
		this.ant1b.setRotationPoint(-2F, -24F, -5.5F);
		this.ant1b.rotateAngleX = 0.34906585F;
		this.ant1b.rotateAngleZ = 0.12217305F;

		this.ant1m.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant1M
		this.ant1m.setRotationPoint(-2F, -25.6F, -8.95F);
		this.ant1m.rotateAngleX = 1.09955743F;
		this.ant1m.rotateAngleZ = 0.08726646F;

		this.ant1t.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant1T
		this.ant1t.setRotationPoint(-2F, -28.8F, -2.2F);
		this.ant1t.rotateAngleX = -0.62831853F;

		this.ant2b.addBox(0F, 0F, 0F, 1, 4, 1, 0F); // Ant2B
		this.ant2b.setRotationPoint(-2F, -24F, 5.5F);
		this.ant2b.rotateAngleX = -0.34906585F;
		this.ant2b.rotateAngleZ = 0.12217305F;

		this.ant2m.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant2M
		this.ant2m.setRotationPoint(-2F, -26.4F, 9.6F);
		this.ant2m.rotateAngleX = -1.09955743F;
		this.ant2m.rotateAngleZ = 0.08726646F;

		this.ant2t.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant2T
		this.ant2t.setRotationPoint(-2F, -27.9F, 2F);
		this.ant2t.rotateAngleX = 0.66322512F;

		this.FLLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // LFLeg
		this.FLLeg.setRotationPoint(0.5F, 0F, 3F);

		this.FRLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // RFLeg
		this.FRLeg.setRotationPoint(0.5F, 0F, -5F);

		this.BLLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // LBLeg
		this.BLLeg.setRotationPoint(20.5F, 0F, 3F);

		this.BRLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // RBLeg
		this.BRLeg.setRotationPoint(20.5F, 0F, -5F);

		this.tail.addBox(0F, 0F, 0F, 2, 3, 3, 0F); // Tail
		this.tail.setRotationPoint(23F, -12F, -1F);
		this.tail.rotateAngleZ = -0.29670597F;


	}

	public void getItemModel(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
	{
		if (this.isChild) {
			float f = 2.0F;
			GlStateManager.pushMatrix();
			GlStateManager.translate(0.0F, 6.0F * scale, 0.0F);
			this.head.render(scale);
			GlStateManager.popMatrix();
			GlStateManager.pushMatrix();
			GlStateManager.scale(1.4F / f, 1.0F / f, 1.2F / f);
			GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
			this.body.render(scale);
			GlStateManager.popMatrix();
		} else {
			this.head.render(scale);
			this.body.render(scale);
		}
	}

	public void setRotateAngles(ModelRenderer modelRenderer, float x, float y, float z)
	{
		modelRenderer.rotateAngleX = x;
		modelRenderer.rotateAngleY = y;
		modelRenderer.rotateAngleZ = z;
	}
	
	public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entity) {
		this.head.rotateAngleX = (headPitch * 0.017453292F);
	}

}

 

Link to comment
Share on other sites

RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, new RenderDeer());

this is deprecated.

Use this:

RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, RenderDeer::new);

And PUT IT IN PREINIT.

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

2 hours ago, Leomelonseeds said:

RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, new RenderDeer());

this is deprecated.

Use this:

RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, RenderDeer::new);

And PUT IT IN PREINIT.

Didn't change a thing

Link to comment
Share on other sites

Only error showing

21:58:48] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[21:58:48] [Server thread/INFO]: Player359[local:E:0cf49a4f] logged in with entity id 814 at (-10.5, 69.0, 257.5)
[21:58:48] [Server thread/INFO]: Player359 joined the game
[21:58:48] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2255ms behind, skipping 45 tick(s)
[21:58:50] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@4d9796d[id=f79c4f00-774e-3daf-ac9c-aebcbcc29c64,name=Player359,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
	at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?]
	at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3056) [Minecraft.class:?]
	at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
[21:59:01] [Server thread/INFO]: [Player359: Object successfully summoned]
[21:59:01] [Client thread/INFO]: [CHAT] Object successfully summoned
[21:59:02] [Server thread/INFO]: Saving and pausing game...
[21:59:02] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
[21:59:03] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
[21:59:03] [Server thread/INFO]: Saving chunks for level 'New World'/The End

 

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.