mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
*blows up missile with mind*
This commit is contained in:
parent
7323fe31da
commit
b6f9953b3e
@ -87,21 +87,29 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.motionY -= decelY * velocity;
|
||||
if(hasPropulsion()) {
|
||||
this.motionY -= decelY * velocity;
|
||||
|
||||
Vec3 vector = Vec3.createVectorHelper(targetX - startX, 0, targetZ - startZ);
|
||||
vector = vector.normalize();
|
||||
vector.xCoord *= accelXZ;
|
||||
vector.zCoord *= accelXZ;
|
||||
|
||||
if(motionY > 0) {
|
||||
motionX += vector.xCoord * velocity;
|
||||
motionZ += vector.zCoord * velocity;
|
||||
}
|
||||
|
||||
if(motionY < 0) {
|
||||
motionX -= vector.xCoord * velocity;
|
||||
motionZ -= vector.zCoord * velocity;
|
||||
}
|
||||
} else {
|
||||
motionX *= 0.99;
|
||||
motionZ *= 0.99;
|
||||
|
||||
Vec3 vector = Vec3.createVectorHelper(targetX - startX, 0, targetZ - startZ);
|
||||
vector = vector.normalize();
|
||||
vector.xCoord *= accelXZ;
|
||||
vector.zCoord *= accelXZ;
|
||||
|
||||
if(motionY > 0) {
|
||||
motionX += vector.xCoord * velocity;
|
||||
motionZ += vector.zCoord * velocity;
|
||||
}
|
||||
|
||||
if(motionY < 0) {
|
||||
motionX -= vector.xCoord * velocity;
|
||||
motionZ -= vector.zCoord * velocity;
|
||||
if(motionY > -1.5)
|
||||
motionY -= 0.05;
|
||||
}
|
||||
|
||||
if(motionY < -velocity && this.isCluster) {
|
||||
@ -123,6 +131,10 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
|
||||
public boolean hasPropulsion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void spawnContrail() {
|
||||
Vec3 vec = Vec3.createVectorHelper(motionX, motionY, motionZ).normalize();
|
||||
MainRegistry.proxy.particleControl(posX - vec.xCoord, posY - vec.yCoord, posZ - vec.zCoord, 2);
|
||||
|
||||
@ -73,6 +73,21 @@ public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLo
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
|
||||
ExplosionLarge.spawnShrapnelShower(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 15, 0.075);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(this.hasPropulsion()) this.fuel -= this.consumption;
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPropulsion() {
|
||||
return this.fuel > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
|
||||
@ -1010,6 +1010,7 @@ public class ResourceManager {
|
||||
|
||||
//Missiles
|
||||
public static final IModelCustom missileV2 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/missileV2.obj"));
|
||||
public static final IModelCustom missileABM = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/missile_abm.obj")).asDisplayList();
|
||||
public static final IModelCustom missileStrong = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/missileGeneric.obj"));
|
||||
public static final IModelCustom missileHuge = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/missileHuge.obj"));
|
||||
public static final IModelCustom missileNuclear = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/missileNeon.obj"));
|
||||
@ -1152,7 +1153,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation missileV2_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_IN.png");
|
||||
public static final ResourceLocation missileV2_CL_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_CL.png");
|
||||
public static final ResourceLocation missileV2_BU_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_BU.png");
|
||||
public static final ResourceLocation missileAA_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileAA.png");
|
||||
public static final ResourceLocation missileAA_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missile_abm.png");
|
||||
public static final ResourceLocation missileStrong_HE_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_HE.png");
|
||||
public static final ResourceLocation missileStrong_EMP_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_EMP.png");
|
||||
public static final ResourceLocation missileStrong_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_IN.png");
|
||||
|
||||
@ -11,28 +11,35 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderMissileGeneric extends Render {
|
||||
|
||||
public RenderMissileGeneric() { }
|
||||
|
||||
public RenderMissileGeneric() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity p_76986_1_, 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(p_76986_1_.prevRotationYaw + (p_76986_1_.rotationYaw - p_76986_1_.prevRotationYaw) * p_76986_9_ - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
if(p_76986_1_ instanceof EntityMissileGeneric)
|
||||
bindTexture(ResourceManager.missileV2_HE_tex);
|
||||
if(p_76986_1_ instanceof EntityMissileIncendiary)
|
||||
bindTexture(ResourceManager.missileV2_IN_tex);
|
||||
if(p_76986_1_ instanceof EntityMissileCluster)
|
||||
bindTexture(ResourceManager.missileV2_CL_tex);
|
||||
if(p_76986_1_ instanceof EntityMissileBunkerBuster)
|
||||
bindTexture(ResourceManager.missileV2_BU_tex);
|
||||
if(p_76986_1_ instanceof EntityMissileAntiBallistic)
|
||||
bindTexture(ResourceManager.missileAA_tex);
|
||||
ResourceManager.missileV2.renderAll();
|
||||
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
|
||||
GL11.glRotatef(p_76986_1_.prevRotationYaw + (p_76986_1_.rotationYaw - p_76986_1_.prevRotationYaw) * p_76986_9_ - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
if(p_76986_1_ instanceof EntityMissileGeneric)
|
||||
bindTexture(ResourceManager.missileV2_HE_tex);
|
||||
if(p_76986_1_ instanceof EntityMissileIncendiary)
|
||||
bindTexture(ResourceManager.missileV2_IN_tex);
|
||||
if(p_76986_1_ instanceof EntityMissileCluster)
|
||||
bindTexture(ResourceManager.missileV2_CL_tex);
|
||||
if(p_76986_1_ instanceof EntityMissileBunkerBuster)
|
||||
bindTexture(ResourceManager.missileV2_BU_tex);
|
||||
|
||||
if(p_76986_1_ instanceof EntityMissileAntiBallistic) {
|
||||
bindTexture(ResourceManager.missileAA_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.missileABM.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
} else {
|
||||
ResourceManager.missileV2.renderAll();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@ -165,7 +165,9 @@ public class RenderLaunchPadTier1 extends TileEntitySpecialRenderer {
|
||||
{
|
||||
GL11.glScalef(1.0F, 1.0F, 1.0F);
|
||||
bindTexture(ResourceManager.missileAA_tex);
|
||||
ResourceManager.missileV2.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.missileABM.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
if(state == 22)
|
||||
{
|
||||
|
||||
2124
src/main/resources/assets/hbm/models/missile_abm.obj
Normal file
2124
src/main/resources/assets/hbm/models/missile_abm.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/main/resources/assets/hbm/textures/models/missile_abm.png
Normal file
BIN
src/main/resources/assets/hbm/textures/models/missile_abm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Loading…
x
Reference in New Issue
Block a user