mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
60 lines
2.2 KiB
Java
60 lines
2.2 KiB
Java
package com.hbm.render;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.client.renderer.entity.Render;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import com.hbm.entity.EntityBullet;
|
|
import com.hbm.entity.EntityRocket;
|
|
import com.hbm.lib.RefStrings;
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
public class RenderRocket extends Render {
|
|
|
|
private ModelBullet miniNuke;
|
|
|
|
public RenderRocket() {
|
|
miniNuke = new ModelBullet();
|
|
}
|
|
|
|
@Override
|
|
public void doRender(Entity rocket, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
|
|
float p_76986_9_) {
|
|
GL11.glPushMatrix();
|
|
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
|
|
GL11.glRotatef(rocket.prevRotationYaw + (rocket.rotationYaw - rocket.prevRotationYaw) * p_76986_9_ - 90.0F,
|
|
0.0F, 1.0F, 0.0F);
|
|
GL11.glRotatef(rocket.prevRotationPitch + (rocket.rotationPitch - rocket.prevRotationPitch) * p_76986_9_ + 180,
|
|
0.0F, 0.0F, 1.0F);
|
|
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
|
|
|
if (rocket instanceof EntityBullet && ((EntityBullet) rocket).getIsChopper()) {
|
|
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/emplacer.png"));
|
|
} else if (rocket instanceof EntityBullet && ((EntityBullet) rocket).getIsCritical()) {
|
|
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/tau.png"));
|
|
} else if (rocket instanceof EntityBullet) {
|
|
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/bullet.png"));
|
|
}
|
|
miniNuke.renderAll(0.0625F);
|
|
GL11.glPopMatrix();
|
|
}
|
|
|
|
@Override
|
|
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
|
if (p_110775_1_ instanceof EntityBullet && ((EntityBullet) p_110775_1_).getIsChopper()) {
|
|
return new ResourceLocation(RefStrings.MODID + ":textures/models/emplacer.png");
|
|
} else if (p_110775_1_ instanceof EntityBullet && ((EntityBullet) p_110775_1_).getIsCritical()) {
|
|
return new ResourceLocation(RefStrings.MODID + ":textures/models/tau.png");
|
|
} else if (p_110775_1_ instanceof EntityBullet) {
|
|
return new ResourceLocation(RefStrings.MODID + ":textures/models/bullet.png");
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
} |