Made changes to Aerwhale rendering.

This commit is contained in:
bconlon 2020-07-31 17:19:39 -07:00
parent e9f30c7ca7
commit 70d243b9bf

View file

@ -1,68 +1,37 @@
package com.legacy.aether.client.renders.entity;
import net.minecraft.client.model.ModelBase;
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 com.legacy.aether.Aether;
import com.legacy.aether.AetherConfig;
import com.legacy.aether.client.models.entities.AerwhaleModel;
import com.legacy.aether.client.models.entities.OldAerwhaleModel;
import com.legacy.aether.entities.passive.EntityAerwhale;
public class AerwhaleRenderer extends Render {
public class AerwhaleRenderer extends RenderLiving
{
private static final ResourceLocation AERWHALE_TEXTURE = new ResourceLocation("aether_legacy", "textures/entities/aerwhale/aerwhale.png");
private static final ResourceLocation OLD_AERWHALE_TEXTURE = new ResourceLocation("aether_legacy", "textures/entities/aerwhale/old_aerwhale.png");
private static final ResourceLocation AERWHALE_TEXTURE = Aether.locate("textures/entities/aerwhale/aerwhale.png");
private static final ResourceLocation OLD_AERWHALE_TEXTURE = Aether.locate("textures/entities/aerwhale/old_aerwhale.png");
private ModelBase model = new AerwhaleModel();
private ModelBase old_model = new OldAerwhaleModel();
public AerwhaleRenderer() {
super();
public AerwhaleRenderer()
{
super(AetherConfig.oldMobsEnabled() ? new OldAerwhaleModel() : new AerwhaleModel(), 0.5F);
}
@Override
public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) {
EntityAerwhale aerwhale = (EntityAerwhale) entity;
GL11.glPushMatrix();
if (aerwhale.hurtResistantTime > 11) {
GL11.glColor3f(1.0F, 0.5F, 0.5F);
} else {
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
if (AetherConfig.oldMobsEnabled()) {
this.renderManager.renderEngine.bindTexture(OLD_AERWHALE_TEXTURE);
} else {
this.renderManager.renderEngine.bindTexture(AERWHALE_TEXTURE);
}
GL11.glTranslated(x, y + 2.0D, z);
GL11.glRotatef(90.0F - (float) aerwhale.aerwhaleRotationYaw, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(180.0F - (float) aerwhale.aerwhaleRotationPitch, 1.0F, 0.0F, 0.0F);
protected void preRenderCallback(EntityLivingBase aerwhale, float partialTickTime)
{
GL11.glTranslated(0, 1.2D, 0);
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if (AetherConfig.oldMobsEnabled()) {
this.old_model.render(aerwhale, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
} else {
this.model.render(aerwhale, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
}
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return AERWHALE_TEXTURE;
protected ResourceLocation getEntityTexture(Entity aerwhale)
{
return AetherConfig.oldMobsEnabled() ? OLD_AERWHALE_TEXTURE : AERWHALE_TEXTURE;
}
}