Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I have a model and when something is true it is supposed to get bigger. I have done this before by creating both sizes and hiding the one that is not needed, but I was wondering if there was a way to just update the model size instead of creating different ones.

Can you please show your render code? I might able to help you but i have to see what you have made so far.

  • Author

Here is the model class if that helps:

ย 

package com.blocklings.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;

import com.blocklings.entity.EntityBlockling;

public class ModelBlockling extends ModelBase {

ModelRenderer BlocklingBody1;
ModelRenderer BlocklingArmLeft1;
ModelRenderer BlocklingArmRight1;

public ModelBlockling() {

	textureWidth = 256;
	textureHeight = 128;

	BlocklingBody1 = new ModelRenderer(this, 0, 0);
	BlocklingBody1.addBox(-4F, -4F, -4F, 8, 8, ;
	BlocklingBody1.setRotationPoint(0F, 20F, 0F);
	BlocklingBody1.setTextureSize(256, 128);
	BlocklingBody1.mirror = true;
	setRotation(BlocklingBody1, 0F, 0F, 0F);
	BlocklingArmLeft1 = new ModelRenderer(this, 175, 0);
	BlocklingArmLeft1.addBox(-2F, 0F, -1F, 2, 5, 2);
	BlocklingArmLeft1.setRotationPoint(-3F, 18F, 0F);
	BlocklingArmLeft1.setTextureSize(256, 128);
	BlocklingArmLeft1.mirror = true;
	setRotation(BlocklingArmLeft1, 0F, 0F, 0.3490659F);
	BlocklingArmRight1 = new ModelRenderer(this, 100, 0);
	BlocklingArmRight1.addBox(0F, 0F, -1F, 2, 5, 2);
	BlocklingArmRight1.setRotationPoint(3F, 18F, 0F);
	BlocklingArmRight1.setTextureSize(256, 128);
	BlocklingArmRight1.mirror = true;
	setRotation(BlocklingArmRight1, 0F, 0F, -0.3490659F);

}

public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {

	super.render(entity, f, f1, f2, f3, f4, f5);
	setRotationAngles(f, f1, f2, f3, f4, f5, entity);
	BlocklingBody1.render(f5);
	BlocklingArmLeft1.render(f5);
	BlocklingArmRight1.render(f5);

}

private void setRotation(ModelRenderer model, float x, float y, float z) {

	model.rotateAngleX = x;
	model.rotateAngleY = y;
	model.rotateAngleZ = z;

}

public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {

	super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

}

public void setLivingAnimations(EntityLivingBase entityLivingBase, float par2, float par3, float par4) {
ย  ย   
	EntityBlockling entityBlockling = (EntityBlockling)entityLivingBase;

	int level = entityBlockling.getLevel();

	if(level == 1) {

ย  ย  		this.BlocklingArmLeft1.rotateAngleX = (-0.2F + 1.0F * this.func_78172_a(par2, 13.0F)) * par3;
ย  	ย  ย  this.BlocklingArmRight1.rotateAngleX = (-0.2F - 1.0F * this.func_78172_a(par2, 13.0F)) * par3;

	} else {

		this.BlocklingArmLeft1.rotateAngleX = (-2000F + 1.0F * this.func_78172_a(par2, 13.0F)) * par3;
ย  	ย  ย  this.BlocklingArmRight1.rotateAngleX = (-2000F - 1.0F * this.func_78172_a(par2, 13.0F)) * par3;

	}
ย  	ย  ย  
}

private float func_78172_a(float par1, float par2) {

ย  ย  ย  ย  return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F);
ย  ย  ย  ย  
ย  ย  }

}

Well im using:

float scale = 1.0F; //Default size!

GL11.glScalef(scale, scale, scale);

You can try to use that but remember you have to scale them up before .render();

Yes, the GL11 scaling will work fine for this.ย  Note though that it will not increase the collision box for the entity so I usually also adjust that.ย  Lastly, the scaling for the entity happens on the client side and often the server needs to know (i.e. for pathfinding) that the size (and collision box) have changed, so you probably need some sort of packet to sync client and server.ย  I usually have a scaleFactor float field in my entities and then use that (and sync that).

Check out my tutorials here:ย http://jabelarminecraft.blogspot.com/

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.