Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.11] Entity Mob Animation
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
ajose0538

[1.11] Entity Mob Animation

By ajose0538, December 26, 2016 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

ajose0538    0

ajose0538

ajose0538    0

  • Tree Puncher
  • ajose0538
  • Members
  • 0
  • 31 posts
Posted December 26, 2016

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

 

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2406

Draco18s

Draco18s    2406

  • Reality Controller
  • Draco18s
  • Members
  • 2406
  • 15936 posts
Posted December 26, 2016

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.

  • Quote

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.

Share this post


Link to post
Share on other sites

ajose0538    0

ajose0538

ajose0538    0

  • Tree Puncher
  • ajose0538
  • Members
  • 0
  • 31 posts
Posted December 26, 2016

Yes, I've noticed that it sucks, what do you recommend me?

  • Quote

Share this post


Link to post
Share on other sites

trollworkout    4

trollworkout

trollworkout    4

  • Diamond Finder
  • trollworkout
  • Members
  • 4
  • 300 posts
Posted December 27, 2016

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

 

 

  • Quote

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.

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      why is 3 in the middle of 7

      By diesieben07 · Posted 19 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • forgotendeath09
      why is 3 in the middle of 7

      By forgotendeath09 · Posted 39 minutes ago

      when you load up forge 1.12.2 the top is displayed as 0/7, once it gets to 3/7 the bar below is in the middle; this is very wrong please consider changing this it drives me crazy every time i launch a modded world.
    • F0RZera
      have an error when trying to connect to LAN server with mods

      By F0RZera · Posted 40 minutes ago

      Ok thanks
    • DeNub
      Cannot create a modded forge server for 1.16.4

      By DeNub · Posted 42 minutes ago

      Its working all well now. Thank you for the support and being patient with me.
    • BobbyLikesCake
      1.16.4 Modded not loading singleplayer worlds

      By BobbyLikesCake · Posted 1 hour ago

      Ok, Thanks I did modify quark slightly but I hope if I delete all of them I can just edit them once again
  • Topics

    • forgotendeath09
      1
      why is 3 in the middle of 7

      By forgotendeath09
      Started 39 minutes ago

    • F0RZera
      10
      have an error when trying to connect to LAN server with mods

      By F0RZera
      Started 6 hours ago

    • DeNub
      27
      Cannot create a modded forge server for 1.16.4

      By DeNub
      Started 12 hours ago

    • BobbyLikesCake
      13
      1.16.4 Modded not loading singleplayer worlds

      By BobbyLikesCake
      Started 4 hours ago

    • Dr.Nickenstein
      3
      Method to get the current durability?

      By Dr.Nickenstein
      Started 12 hours ago

  • Who's Online (See full list)

    • diesieben07
    • isaac25
    • P0SCH1T0
    • TheSharkGamer80
    • Ecpgamez
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.11] Entity Mob Animation
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community