use of icbm.classic.content.explosive.ex.Explosion in project ICBM-Classic by BuiltBrokenModding.
the class RenderMissile method renderItem.
@Override
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
Explosives ex = Explosives.get(item.getItemDamage());
if (ex.handler instanceof Explosion) {
Explosion missile = (Explosion) ex.handler;
float yaw = 0;
float pitch = -90;
float scale = missile.missileModelPath.contains("missiles") ? 0.00625f : 0.7f;
switch(type) {
case INVENTORY:
scale = missile.missileModelPath.contains("missiles") ? 0.0035f : 0.5f;
if (missile.getTier() == 2 || !missile.hasBlockForm()) {
scale = scale / 1.5f;
GL11.glTranslatef(-0.7f, 0f, 0f);
} else if (missile.getTier() == 3) {
scale = scale / 1.7f;
GL11.glTranslatef(-0.65f, 0f, 0f);
} else if (missile.getTier() == 4) {
scale = scale / 1.4f;
GL11.glTranslatef(-0.5f, 0f, 0f);
} else {
GL11.glTranslatef(-0.5f, 0f, 0f);
}
break;
case EQUIPPED:
GL11.glTranslatef(1f, 0.3f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
GL11.glTranslatef(1.15f, -1f, 0.5f);
break;
case ENTITY:
GL11.glTranslatef(-0.6f, 0f, 0f);
break;
default:
break;
}
GL11.glRotatef(yaw, 0, 1f, 0f);
GL11.glRotatef(pitch, 0, 0f, 1f);
GL11.glScalef(scale, scale, scale);
renderMissile(missile);
}
}
use of icbm.classic.content.explosive.ex.Explosion in project ICBM-Classic by BuiltBrokenModding.
the class TileLauncherBaseClient method renderDynamic.
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(Pos pos, float frame, int pass) {
GL11.glPushMatrix();
GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 1.5F, (float) pos.z() + 0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
if (getDirection() != ForgeDirection.NORTH && getDirection() != ForgeDirection.SOUTH) {
GL11.glRotatef(90F, 0F, 180F, 1.0F);
}
// The missile launcher screen
if (getTier() == 0) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_0);
modelBase0.render(0.0625F);
modelRail0.render(0.0625F);
} else if (getTier() == 1) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_1);
modelBase1.render(0.0625F);
modelRail1.render(0.0625F);
GL11.glRotatef(180F, 0F, 180F, 1.0F);
modelRail1.render(0.0625F);
} else if (getTier() == 2) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_2);
modelBase2.render(0.0625F);
modelRail2.render(0.0625F);
GL11.glRotatef(180F, 0F, 180F, 1.0F);
modelRail2.render(0.0625F);
}
GL11.glPopMatrix();
if (cachedMissileStack != null) {
GL11.glPushMatrix();
GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 0.5F, (float) pos.z() + 0.5F);
//GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
Explosives e = Explosives.get(cachedMissileStack.getItemDamage());
Explosion missile = e == null ? (Explosion) Explosives.CONDENSED.handler : (Explosion) e.handler;
if (missile.missileModelPath.contains("missiles")) {
GL11.glScalef(0.00625f, 0.00625f, 0.00625f);
} else {
GL11.glScalef(0.05f, 0.05f, 0.05f);
}
RenderMissile.renderMissile(missile);
GL11.glPopMatrix();
}
}
use of icbm.classic.content.explosive.ex.Explosion in project ICBM-Classic by BuiltBrokenModding.
the class TileCruiseLauncher method getStatus.
/**
* Gets the display status of the missile launcher
*
* @return The string to be displayed
*/
@Override
public String getStatus() {
String color = "§4";
String status;
if (!this.checkExtract()) {
status = LanguageUtility.getLocal("gui.launcherCruise.statusNoPower");
} else if (this.getStackInSlot(0) == null) {
status = LanguageUtility.getLocal("gui.launcherCruise.statusEmpty");
} else if (this.getStackInSlot(0).getItem() != ICBMClassic.itemMissile) {
status = LanguageUtility.getLocal("gui.launcherCruise.invalidMissile");
} else {
final Explosion missile = (Explosion) Explosives.get(this.getStackInSlot(0).getItemDamage()).handler;
if (missile == null) {
status = LanguageUtility.getLocal("gui.launcherCruise.invalidMissile");
} else if (!missile.isCruise()) {
status = LanguageUtility.getLocal("gui.launcherCruise.notCruiseMissile");
} else if (missile.getTier() > 3) {
status = LanguageUtility.getLocal("gui.launcherCruise.invalidMissileTier");
} else if (this.getTarget() == null || getTarget().isZero()) {
status = LanguageUtility.getLocal("gui.launcherCruise.statusInvalid");
} else if (this.isTooClose(getTarget())) {
status = LanguageUtility.getLocal("gui.launcherCruise.targetToClose");
} else if (!canSpawnMissileWithNoCollision()) {
status = LanguageUtility.getLocal("gui.launcherCruise.noRoom");
} else {
color = "§2";
status = LanguageUtility.getLocal("gui.launcherCruise.statusReady");
}
}
return color + status;
}
use of icbm.classic.content.explosive.ex.Explosion in project ICBM-Classic by BuiltBrokenModding.
the class TileCruiseLauncherClient method renderDynamic.
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(Pos pos, float frame, int pass) {
float yaw = (float) currentAim.yaw();
float pitch = (float) currentAim.pitch();
GL11.glPushMatrix();
GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 1.5F, (float) pos.z() + 0.5F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
MODEL0.render(0.0625F);
GL11.glRotatef(-yaw, 0F, 1F, 0F);
GL11.glRotatef(-pitch, 1F, 0F, 0F);
MODEL1.render(0.0625F);
GL11.glPopMatrix();
if (cachedMissileStack != null) {
GL11.glPushMatrix();
GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 1, (float) pos.z() + 0.5f);
GL11.glRotatef(yaw, 0F, 1F, 0F);
GL11.glRotatef(pitch - 90, 1F, 0F, 0F);
Explosives e = Explosives.get(cachedMissileStack.getItemDamage());
Explosion missile = e == null ? (Explosion) Explosives.CONDENSED.handler : (Explosion) e.handler;
if (missile.missileModelPath.contains("missiles")) {
GL11.glScalef(0.00625f, 0.00625f, 0.00625f);
} else {
GL11.glScalef(0.05f, 0.05f, 0.05f);
}
RenderMissile.renderMissile(missile);
GL11.glPopMatrix();
}
}
use of icbm.classic.content.explosive.ex.Explosion in project ICBM-Classic by BuiltBrokenModding.
the class RenderMissile method doRender.
@Override
public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
EntityMissile entityMissile = (EntityMissile) entity;
Explosive e = entityMissile.getExplosiveType();
Explosion missile = e == null ? (Explosion) Explosives.CONDENSED.handler : (Explosion) e;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(entityMissile.prevRotationYaw + (entityMissile.rotationYaw - entityMissile.prevRotationYaw) * f1 - 90.0F, 0.0F, 1.0F, 0.0F);
float pitch = entityMissile.prevRotationPitch + (entityMissile.rotationPitch - entityMissile.prevRotationPitch) * f1 - 90;
GL11.glRotatef(pitch, 0.0F, 0.0F, 1.0F);
if (missile.missileModelPath.contains("missiles")) {
GL11.glScalef(0.00625f, 0.00625f, 0.00625f);
} else {
GL11.glScalef(0.07f, 0.07f, 0.07f);
}
renderMissile(missile);
GL11.glPopMatrix();
}
Aggregations