mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Mk4 improvements, faster blast
This commit is contained in:
parent
babe46761e
commit
89c7a3c0f7
@ -66,7 +66,7 @@ public class EntityNukeExplosionMK4 extends Entity {
|
|||||||
} else if(explosion.getStoredSize() > 0) {
|
} else if(explosion.getStoredSize() > 0) {
|
||||||
//if(!worldObj.isRemote)
|
//if(!worldObj.isRemote)
|
||||||
//MainRegistry.logger.info(explosion.getProgress() + " / " + count / length);
|
//MainRegistry.logger.info(explosion.getProgress() + " / " + count / length);
|
||||||
explosion.processTip(speed);
|
explosion.processTip(1024);
|
||||||
} else if(fallout) {
|
} else if(fallout) {
|
||||||
|
|
||||||
EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj, (int)(this.length * 1.8) * 10);
|
EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj, (int)(this.length * 1.8) * 10);
|
||||||
|
|||||||
@ -101,7 +101,13 @@ public class ExplosionNukeRay {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
public void processTip(int count) {
|
public void processTip(int count) {
|
||||||
for(int l = 0; l < count; l++) {
|
|
||||||
|
int processedBlocks = 0;
|
||||||
|
|
||||||
|
for(int l = 0; l < Integer.MAX_VALUE; l++) {
|
||||||
|
|
||||||
|
if(processedBlocks >= count)
|
||||||
|
return;
|
||||||
|
|
||||||
if(l > affectedBlocks.size() - 1)
|
if(l > affectedBlocks.size() - 1)
|
||||||
break;
|
break;
|
||||||
@ -109,9 +115,11 @@ public class ExplosionNukeRay {
|
|||||||
if(affectedBlocks.isEmpty())
|
if(affectedBlocks.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float x = affectedBlocks.get(0).xCoord;
|
int in = affectedBlocks.size() - 1;
|
||||||
float y = affectedBlocks.get(0).yCoord;
|
|
||||||
float z = affectedBlocks.get(0).zCoord;
|
float x = affectedBlocks.get(in).xCoord;
|
||||||
|
float y = affectedBlocks.get(in).yCoord;
|
||||||
|
float z = affectedBlocks.get(in).zCoord;
|
||||||
|
|
||||||
world.setBlock((int)x, (int)y, (int)z, Blocks.air);
|
world.setBlock((int)x, (int)y, (int)z, Blocks.air);
|
||||||
|
|
||||||
@ -125,11 +133,13 @@ public class ExplosionNukeRay {
|
|||||||
int y0 = (int)(posY + pY * i);
|
int y0 = (int)(posY + pY * i);
|
||||||
int z0 = (int)(posZ + pZ * i);
|
int z0 = (int)(posZ + pZ * i);
|
||||||
|
|
||||||
//if(world.getBlock(x0, y0, z0) != Blocks.air)
|
if(!world.isAirBlock(x0, y0, z0)) {
|
||||||
world.setBlock(x0, y0, z0, Blocks.air);
|
world.setBlock(x0, y0, z0, Blocks.air);
|
||||||
|
processedBlocks++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
affectedBlocks.remove(0);
|
affectedBlocks.remove(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
processed += count;
|
processed += count;
|
||||||
@ -310,16 +320,20 @@ public class ExplosionNukeRay {
|
|||||||
//StartY starts at this.length
|
//StartY starts at this.length
|
||||||
for(int v = startY; v <= bowCount; v++) {
|
for(int v = startY; v <= bowCount; v++) {
|
||||||
|
|
||||||
Vec3 heightVec = Vec3.createVectorHelper(0, strength, 0);
|
float part = (float) (Math.PI/bow);
|
||||||
heightVec.rotateAroundZ((float)(Math.PI/bow * -(float)v));
|
float rot = part * -v;
|
||||||
|
|
||||||
|
Vec3 heightVec = Vec3.createVectorHelper(0, -strength, 0);
|
||||||
|
heightVec.rotateAroundZ(rot);
|
||||||
|
|
||||||
double y = heightVec.yCoord;
|
double y = heightVec.yCoord;
|
||||||
|
|
||||||
System.out.println(v + " " + y);
|
|
||||||
|
|
||||||
double sectionRad = Math.sqrt(Math.pow(strength, 2) - Math.pow(y, 2));
|
double sectionRad = Math.sqrt(Math.pow(strength, 2) - Math.pow(y, 2));
|
||||||
double circumference = 2 * Math.PI * sectionRad;
|
double circumference = 2 * Math.PI * sectionRad;
|
||||||
|
|
||||||
|
//if(y < 2 && y > -2)
|
||||||
|
// circumference *= 1.25D;
|
||||||
|
|
||||||
//circumference = Math.ceil(circumference);
|
//circumference = Math.ceil(circumference);
|
||||||
|
|
||||||
//Radial
|
//Radial
|
||||||
@ -330,8 +344,8 @@ public class ExplosionNukeRay {
|
|||||||
vec = vec.normalize();
|
vec = vec.normalize();
|
||||||
/*if(y > 0)
|
/*if(y > 0)
|
||||||
vec.rotateAroundZ((float) (y / sectionRad) * 0.15F);*/
|
vec.rotateAroundZ((float) (y / sectionRad) * 0.15F);*/
|
||||||
if(y < 0)
|
/*if(y < 0)
|
||||||
vec.rotateAroundZ((float) (y / sectionRad) * 0.15F);
|
vec.rotateAroundZ((float) (y / sectionRad) * 0.15F);*/
|
||||||
vec.rotateAroundY((float) (360 / circumference * r));
|
vec.rotateAroundY((float) (360 / circumference * r));
|
||||||
|
|
||||||
int length = (int)Math.ceil(strength);
|
int length = (int)Math.ceil(strength);
|
||||||
|
|||||||
@ -2416,7 +2416,7 @@ public class ModItems {
|
|||||||
nothing = new Item().setUnlocalizedName("nothing").setTextureName(RefStrings.MODID + ":nothing");
|
nothing = new Item().setUnlocalizedName("nothing").setTextureName(RefStrings.MODID + ":nothing");
|
||||||
void_anim = new Item().setUnlocalizedName("void_anim").setTextureName(RefStrings.MODID + ":void_anim");
|
void_anim = new Item().setUnlocalizedName("void_anim").setTextureName(RefStrings.MODID + ":void_anim");
|
||||||
|
|
||||||
mysteryshovel = new ItemMS().setUnlocalizedName("mysteryshovel").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cursed_shovel");
|
mysteryshovel = new ItemMS().setUnlocalizedName("mysteryshovel").setFull3D().setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cursed_shovel");
|
||||||
memory = new ItemBattery(Long.MAX_VALUE / 100L, 100000, 100000).setUnlocalizedName("memory").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":mo8_anim");
|
memory = new ItemBattery(Long.MAX_VALUE / 100L, 100000, 100000).setUnlocalizedName("memory").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":mo8_anim");
|
||||||
|
|
||||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.mud_fluid, 1000), new ItemStack(ModItems.bucket_mud));
|
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.mud_fluid, 1000), new ItemStack(ModItems.bucket_mud));
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.hbm.items.special;
|
|||||||
|
|
||||||
import com.hbm.entity.logic.EntityNukeExplosionMK4;
|
import com.hbm.entity.logic.EntityNukeExplosionMK4;
|
||||||
import com.hbm.lib.ModDamageSource;
|
import com.hbm.lib.ModDamageSource;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@ -11,6 +12,7 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemUnstable extends Item {
|
public class ItemUnstable extends Item {
|
||||||
@ -86,4 +88,14 @@ public class ItemUnstable extends Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getItemStackDisplayName(ItemStack stack)
|
||||||
|
{
|
||||||
|
switch(stack.getItemDamage()) {
|
||||||
|
case 1: return "ELEMENTS";
|
||||||
|
case 2: return "ARSENIC";
|
||||||
|
case 3: return "VAULT";
|
||||||
|
default: return ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -349,8 +349,8 @@ public class HbmWorldGen implements IWorldGenerator {
|
|||||||
int z = j + rand.nextInt(16);
|
int z = j + rand.nextInt(16);
|
||||||
int y = world.getHeightValue(x, z);
|
int y = world.getHeightValue(x, z);
|
||||||
|
|
||||||
if(world.getBlock(x, y - 1, z).canPlaceTorchOnTop(world, x, y - 1, z))
|
if(world.getBlock(x, y, z).canPlaceTorchOnTop(world, x, y - 1, z))
|
||||||
world.setBlock(x, y, z, ModBlocks.broadcaster_pc, rand.nextInt(4) + 2, 2);
|
world.setBlock(x, y + 1, z, ModBlocks.broadcaster_pc, rand.nextInt(4) + 2, 2);
|
||||||
|
|
||||||
if(MainRegistry.enableDebugMode)
|
if(MainRegistry.enableDebugMode)
|
||||||
MainRegistry.logger.info("[Debug] Successfully spawned corrupted broadcaster at " + x + " " + y +" " + z);
|
MainRegistry.logger.info("[Debug] Successfully spawned corrupted broadcaster at " + x + " " + y +" " + z);
|
||||||
|
|||||||
@ -176,13 +176,13 @@ public class RenderSmallNukeMK3 extends Render {
|
|||||||
GL11.glColor4f(0.4F, 0.4F, 0.4F, 1F);
|
GL11.glColor4f(0.4F, 0.4F, 0.4F, 1F);
|
||||||
float f = (float)Math.min((age - 50) * 0.5, 20);
|
float f = (float)Math.min((age - 50) * 0.5, 20);
|
||||||
GL11.glScalef(f, 15, f);
|
GL11.glScalef(f, 15, f);
|
||||||
ringBigModel.renderAll();
|
//ringBigModel.renderAll();
|
||||||
GL11.glScalef(1.5F, 1, 1.5F);
|
GL11.glScalef(1.5F, 1, 1.5F);
|
||||||
GL11.glTranslatef(0, -0.15F, 0);
|
GL11.glTranslatef(0, -0.15F, 0);
|
||||||
ringBigModel.renderAll();
|
//ringBigModel.renderAll();
|
||||||
GL11.glScalef(1.5F, 1, 1.5F);
|
GL11.glScalef(1.5F, 1, 1.5F);
|
||||||
GL11.glTranslatef(0, -0.15F, 0);
|
GL11.glTranslatef(0, -0.15F, 0);
|
||||||
ringBigModel.renderAll();
|
//ringBigModel.renderAll();
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user