Jump to content

[1.14.4] Custom Animated Java Models?


Korlimann

Recommended Posts

Hello everyone.

I'm currently trying to figure out how to use Java Classes for Models in my Mod. A friend of mine created a .java Model with Blockbench, but it appears the class generated is not for 1.14.4, but probably for 1.12, since most of the Classes used in this Class are relocated somewhere else, or renamed entirely.

 

Specifically, I'm searching for these classes:
 

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;

 

I was able to find ModelBox, but that was the only class, all the others seem to be renamed or relocated, and I'm not sure which one is which.

Furthermore, I'm guessing that these classes have changed in how they work between 1.12 and 1.14.

(It appears pastebin is down so I'm posting the class here)

import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;

public class windmillrotor extends ModelBase {
    private final ModelRenderer bone;

    public windmillrotor() {
        textureWidth = 16;
        textureHeight = 16;

        bone = new ModelRenderer(this);
        bone.setRotationPoint(0.0F, 24.0F, 0.0F);
        bone.cubeList.add(new ModelBox(bone, 0, 0, -3.0F, -5.0F, 0.0F, 6, 5, 2, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, -1.6F, -4.0F, -6.0F, 3, 3, 6, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, -25.6F, -3.0F, -5.0F, 24, 1, 1, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, -0.6F, -28.0F, -5.0F, 1, 24, 1, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, 1.4F, -2.8F, -5.0F, 24, 1, 1, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, -0.7F, -1.0F, -5.0F, 1, 24, 1, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, -25.6F, -10.0F, -4.0F, 20, 7, 0, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, 0.4F, -28.0F, -4.0F, 7, 20, 0, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, 5.4F, -1.8F, -4.0F, 20, 7, 0, 0.0F, false));
        bone.cubeList.add(new ModelBox(bone, 0, 0, -7.7F, 3.0F, -4.0F, 7, 20, 0, 0.0F, false));
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        bone.render(f5);
    }
    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

 

If any of you guys could tell me what needs to be changed, or have a link so I can read up on Models in 1.14 (I've looked through the forge docs, maybe I overlooked it but I couldn't see anything regarding .java models) or a link to a working example or tutorial, I'd greatly appreciate that.

 

Thanks!

Link to comment
Share on other sites

  • 2 months later...

If you're still wondering/needed what's needing to be changed: ModelRenderer has been swapped to RendererModel much like how ItemExample are now ExampleItem, and ModelBase is now EntityModel<your entity class>. For animations you can look at Entity Model classes, The basic way is that a value that determines how much to rotate the part, example; limbSwing & limbSwingAmount in the Entity class not model class, then call  apon the value in the model's renderRotationAngles, then update the value on the client side in the entity class tick/other method. 

Edited by Bleggy
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.