Mk4 improvements, faster blast

This commit is contained in:
HbmMods 2018-05-27 11:14:57 +02:00
parent babe46761e
commit 89c7a3c0f7
6 changed files with 45 additions and 19 deletions

View File

@ -66,7 +66,7 @@ public class EntityNukeExplosionMK4 extends Entity {
} else if(explosion.getStoredSize() > 0) {
//if(!worldObj.isRemote)
//MainRegistry.logger.info(explosion.getProgress() + " / " + count / length);
explosion.processTip(speed);
explosion.processTip(1024);
} else if(fallout) {
EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj, (int)(this.length * 1.8) * 10);

View File

@ -101,7 +101,13 @@ public class ExplosionNukeRay {
}*/
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)
break;
@ -109,9 +115,11 @@ public class ExplosionNukeRay {
if(affectedBlocks.isEmpty())
return;
float x = affectedBlocks.get(0).xCoord;
float y = affectedBlocks.get(0).yCoord;
float z = affectedBlocks.get(0).zCoord;
int in = affectedBlocks.size() - 1;
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);
@ -125,11 +133,13 @@ public class ExplosionNukeRay {
int y0 = (int)(posY + pY * 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);
processedBlocks++;
}
}
affectedBlocks.remove(0);
affectedBlocks.remove(in);
}
processed += count;
@ -310,16 +320,20 @@ public class ExplosionNukeRay {
//StartY starts at this.length
for(int v = startY; v <= bowCount; v++) {
Vec3 heightVec = Vec3.createVectorHelper(0, strength, 0);
heightVec.rotateAroundZ((float)(Math.PI/bow * -(float)v));
float part = (float) (Math.PI/bow);
float rot = part * -v;
Vec3 heightVec = Vec3.createVectorHelper(0, -strength, 0);
heightVec.rotateAroundZ(rot);
double y = heightVec.yCoord;
System.out.println(v + " " + y);
double sectionRad = Math.sqrt(Math.pow(strength, 2) - Math.pow(y, 2));
double circumference = 2 * Math.PI * sectionRad;
//if(y < 2 && y > -2)
// circumference *= 1.25D;
//circumference = Math.ceil(circumference);
//Radial
@ -330,8 +344,8 @@ public class ExplosionNukeRay {
vec = vec.normalize();
/*if(y > 0)
vec.rotateAroundZ((float) (y / sectionRad) * 0.15F);*/
if(y < 0)
vec.rotateAroundZ((float) (y / sectionRad) * 0.15F);
/*if(y < 0)
vec.rotateAroundZ((float) (y / sectionRad) * 0.15F);*/
vec.rotateAroundY((float) (360 / circumference * r));
int length = (int)Math.ceil(strength);

View File

@ -2416,7 +2416,7 @@ public class ModItems {
nothing = new Item().setUnlocalizedName("nothing").setTextureName(RefStrings.MODID + ":nothing");
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");
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.mud_fluid, 1000), new ItemStack(ModItems.bucket_mud));

View File

@ -2,6 +2,7 @@ package com.hbm.items.special;
import com.hbm.entity.logic.EntityNukeExplosionMK4;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -11,6 +12,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
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();
}
}
}

View File

@ -349,8 +349,8 @@ public class HbmWorldGen implements IWorldGenerator {
int z = j + rand.nextInt(16);
int y = world.getHeightValue(x, z);
if(world.getBlock(x, y - 1, z).canPlaceTorchOnTop(world, x, y - 1, z))
world.setBlock(x, y, z, ModBlocks.broadcaster_pc, rand.nextInt(4) + 2, 2);
if(world.getBlock(x, y, z).canPlaceTorchOnTop(world, x, y - 1, z))
world.setBlock(x, y + 1, z, ModBlocks.broadcaster_pc, rand.nextInt(4) + 2, 2);
if(MainRegistry.enableDebugMode)
MainRegistry.logger.info("[Debug] Successfully spawned corrupted broadcaster at " + x + " " + y +" " + z);

View File

@ -176,13 +176,13 @@ public class RenderSmallNukeMK3 extends Render {
GL11.glColor4f(0.4F, 0.4F, 0.4F, 1F);
float f = (float)Math.min((age - 50) * 0.5, 20);
GL11.glScalef(f, 15, f);
ringBigModel.renderAll();
//ringBigModel.renderAll();
GL11.glScalef(1.5F, 1, 1.5F);
GL11.glTranslatef(0, -0.15F, 0);
ringBigModel.renderAll();
//ringBigModel.renderAll();
GL11.glScalef(1.5F, 1, 1.5F);
GL11.glTranslatef(0, -0.15F, 0);
ringBigModel.renderAll();
//ringBigModel.renderAll();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();