Jump to content

[1.11] Entity Mob Animation


ajose0538

Recommended Posts

Hi, I'm testing things, with the entities and well I want to add a mob that has an animation of its own. I already have the model and the animation created in MCAnimator but the format that gives me MCAnimator, it asks me some bookstores that I do not have, it is possible to change the libraries by others of minecraft ?, or another program of animation?

 

ModelEntity

 

package yourModPackage.client.models;

 

import java.util.HashMap;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.entity.Entity;

 

import yourModPackage.client.MCAClientLibrary.MCAModelRenderer;

import yourModPackage.common.MCACommonLibrary.MCAVersionChecker;

import yourModPackage.common.MCACommonLibrary.animation.AnimationHandler;

import yourModPackage.common.MCACommonLibrary.math.Matrix4f;

import yourModPackage.common.MCACommonLibrary.math.Quaternion;

import yourModPackage.common.entities.mobs.EntityLoompaWhite;

 

public class ModelLoompaWhite extends ModelBase {

public final int MCA_MIN_REQUESTED_VERSION = 5;

public HashMap<String, MCAModelRenderer> parts = new HashMap<String, MCAModelRenderer>();

 

MCAModelRenderer cuerpo;

MCAModelRenderer pierna1;

MCAModelRenderer pierna2;

MCAModelRenderer zapatos1;

MCAModelRenderer zapatos2;

MCAModelRenderer cabeza;

MCAModelRenderer brazo1;

MCAModelRenderer brazo2;

 

public ModelLoompaWhite()

{

MCAVersionChecker.checkForLibraryVersion(getClass(), MCA_MIN_REQUESTED_VERSION);

 

textureWidth = 64;

textureHeight = 64;

 

cuerpo = new MCAModelRenderer(this, "Cuerpo", 0, 0);

cuerpo.mirror = false;

cuerpo.addBox(0.0F, -11.0F, -4.0F, 12, 11, 4);

cuerpo.setInitialRotationPoint(-6.0F, -5.0F, 4.0F);

cuerpo.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.0F, 1.0F)).transpose());

cuerpo.setTextureSize(64, 64);

parts.put(cuerpo.boxName, cuerpo);

 

pierna1 = new MCAModelRenderer(this, "Pierna1", 0, 0);

pierna1.mirror = false;

pierna1.addBox(0.0F, -6.0F, -3.0F, 4, 6, 3);

pierna1.setInitialRotationPoint(1.0F, -15.0F, 4.0F);

pierna1.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.0F, 1.0F)).transpose());

pierna1.setTextureSize(64, 64);

parts.put(pierna1.boxName, pierna1);

 

pierna2 = new MCAModelRenderer(this, "Pierna2", 0, 0);

pierna2.mirror = false;

pierna2.addBox(0.0F, -6.0F, -3.0F, 4, 6, 3);

pierna2.setInitialRotationPoint(-5.0F, -15.0F, 4.0F);

pierna2.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(1.9423127E-33F, -3.1003275E-17F, -6.264863E-17F, 1.0F)).transpose());

pierna2.setTextureSize(64, 64);

parts.put(pierna2.boxName, pierna2);

 

zapatos1 = new MCAModelRenderer(this, "Zapatos1", 0, 0);

zapatos1.mirror = false;

zapatos1.addBox(0.0F, -2.0F, -6.0F, 6, 2, 6);

zapatos1.setInitialRotationPoint(0.0F, -20.0F, 6.0F);

zapatos1.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.0F, 1.0F)).transpose());

zapatos1.setTextureSize(64, 64);

parts.put(zapatos1.boxName, zapatos1);

 

zapatos2 = new MCAModelRenderer(this, "Zapatos2", 0, 0);

zapatos2.mirror = false;

zapatos2.addBox(0.0F, -2.0F, -6.0F, 6, 2, 6);

zapatos2.setInitialRotationPoint(-6.0F, -20.0F, 6.0F);

zapatos2.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.0F, 1.0F)).transpose());

zapatos2.setTextureSize(64, 64);

parts.put(zapatos2.boxName, zapatos2);

 

cabeza = new MCAModelRenderer(this, "cabeza", 0, 0);

cabeza.mirror = false;

cabeza.addBox(0.0F, -11.0F, -8.0F, 12, 11, 8);

cabeza.setInitialRotationPoint(-6.0F, 6.0F, 7.0F);

cabeza.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.0F, 1.0F)).transpose());

cabeza.setTextureSize(64, 64);

parts.put(cabeza.boxName, cabeza);

 

brazo1 = new MCAModelRenderer(this, "brazo1", 0, 0);

brazo1.mirror = false;

brazo1.addBox(0.0F, -11.0F, -3.0F, 2, 11, 3);

brazo1.setInitialRotationPoint(-8.0F, -5.0F, 4.0F);

brazo1.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.0F, 1.0F)).transpose());

brazo1.setTextureSize(64, 64);

parts.put(brazo1.boxName, brazo1);

 

brazo2 = new MCAModelRenderer(this, "brazo2", 0, 0);

brazo2.mirror = false;

brazo2.addBox(0.0F, -11.0F, -3.0F, 2, 11, 3);

brazo2.setInitialRotationPoint(6.0F, -5.0F, 4.0F);

brazo2.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.0F, 1.0F)).transpose());

brazo2.setTextureSize(64, 64);

parts.put(brazo2.boxName, brazo2);

 

}

 

@Override

public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)

{

EntityLoompaWhite entity = (EntityLoompaWhite)par1Entity;

 

AnimationHandler.performAnimationInModel(parts, entity);

 

//Render every non-child part

cuerpo.render(par7);

pierna1.render(par7);

pierna2.render(par7);

zapatos1.render(par7);

zapatos2.render(par7);

cabeza.render(par7);

brazo1.render(par7);

brazo2.render(par7);

}

@Override

public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) {}

 

public MCAModelRenderer getModelRendererFromName(String name)

{

return parts.get(name);

}

}

 

 

RenderModel

 

package yourModPackage.client.renders;

 

import net.minecraft.client.renderer.entity.Render;

import net.minecraft.client.renderer.entity.RenderLiving;

import net.minecraft.entity.Entity;

import net.minecraft.entity.EntityLivingBase;

import net.minecraft.util.ResourceLocation;

 

import org.lwjgl.opengl.GL11;

 

import yourModPackage.common.entities.mobs.EntityLoompaWhite;

 

public class RenderLoompaWhite extends RenderLiving {

 

private static final ResourceLocation LOOMPA_WHITE_TEXTURES = new ResourceLocation(Reference.MODID + ":textures/entity/loompa_white.png");

public static ModelLoompaWhite modelLoompaWhite = new ModelLoompaWhite();

public static float modelHeight = 2F;

 

public RenderLoompaWhite()

    {

        super(modelLoompaWhite, 1F);

    }

 

@Override

public void doRender(Entity _entity, double posX, double posY, double posZ, float var8, float var9) {

EntityLoompaWhite entity = (EntityLoompaWhite) _entity;

 

GL11.glPushMatrix();

GL11.glDisable(GL11.GL_CULL_FACE);

super.doRender(_entity, posX, posY, posZ, var8, var9);

GL11.glEnable(GL11.GL_CULL_FACE);

GL11.glPopMatrix();

}

 

@Override

protected void preRenderCallback(EntityLivingBase entityliving, float f)

{

GL11.glRotatef(180F, 0, 1F, 0F);

GL11.glRotatef(180F, 0, 0, 1F);

GL11.glTranslatef(0, modelHeight, 0);

}

 

@Override

protected ResourceLocation getEntityTexture(Entity var1) {

return LOOMPA_WHITE_TEXTURES;

}

}

 

 

In the extraction of the animation gives me the libraries, but it is necessary to enter them?

 

PD: I already tried to change the libraries for the ones of minecraft and some things I give error

 

Link to comment
Share on other sites

MCAnimator is shit. Don't use it.

And by "shit" I mean that it isn't thread safe.  I tried using it once and no matter what I did, the game would eventually crash with a ConcurrentModificationException.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

generally mc uses    setRotationAngles to control motion and setLivingAnimations to control body parts positioning when say is sitting or sprinting jumping etc

 

and sometimes the renderer has more fine tuned  connecting entity class with the model

 

most mobs have a repetitive motion for limbs set rotation angles

 

 

Disclaimer:  I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.

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.