Skip to content

Instantly share code, notes, and snippets.

@triphion
Created October 7, 2017 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save triphion/36a928dbc1ba75c9b81589933d6ee4ba to your computer and use it in GitHub Desktop.
Save triphion/36a928dbc1ba75c9b81589933d6ee4ba to your computer and use it in GitHub Desktop.
package com.triphion.ancient.client.model;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelClottIce extends ModelBase
{
public ModelRenderer body;
private int textureWidth = 64;
private int textureHeight = 64;
public ModelClottIce() {
this.body = new ModelRenderer(this, 0, 0);
this.body.setRotationPoint(-4F, 16F, -4F);
this.body.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
this.body.setTextureSize(32, 16);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
GL11.glPushMatrix();
GL11.glTranslatef(this.body.offsetX, this.body.offsetY, this.body.offsetZ);
GL11.glTranslatef(this.body.rotationPointX * f5, this.body.rotationPointY * f5, this.body.rotationPointZ * f5);
GL11.glScaled(8.0D, 8.0D, 8.0D);
GL11.glTranslatef(-this.body.offsetX, -this.body.offsetY, -this.body.offsetZ);
GL11.glTranslatef(-this.body.rotationPointX * f5, -this.body.rotationPointY * f5, -this.body.rotationPointZ * f5);
this.body.render(f5);
GL11.glPopMatrix();
}
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
package com.triphion.ancient.client.entity;
import com.triphion.ancient.Reference;
import com.triphion.ancient.client.model.ModelClottIce;
import com.triphion.ancient.entity.EntityClottIce;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderClottIce extends RenderLiving<EntityClottIce>{
private static final ResourceLocation CLOTT_ICE = new ResourceLocation(Reference.MODID +":textures/entity/clottice/clottice.png");
public RenderClottIce(RenderManager rendermanagerIn) {
super(rendermanagerIn, new ModelClottIce(), 0.0F);
}
@Override
protected ResourceLocation getEntityTexture(EntityClottIce entity) {
return CLOTT_ICE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment