diff --git a/assets/hbm/textures/items/fuelcell_arsenic.png b/assets/hbm/textures/items/fuelcell_arsenic.png new file mode 100644 index 000000000..4a2c066f0 Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_arsenic.png differ diff --git a/assets/hbm/textures/items/fuelcell_base.png b/assets/hbm/textures/items/fuelcell_base.png new file mode 100644 index 000000000..b74dc7b35 Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_base.png differ diff --git a/assets/hbm/textures/items/fuelcell_euphemium.png b/assets/hbm/textures/items/fuelcell_euphemium.png new file mode 100644 index 000000000..0acd3351e Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_euphemium.png differ diff --git a/assets/hbm/textures/items/fuelcell_neptunium.png b/assets/hbm/textures/items/fuelcell_neptunium.png new file mode 100644 index 000000000..b4edaede1 Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_neptunium.png differ diff --git a/assets/hbm/textures/items/fuelcell_plutonium.png b/assets/hbm/textures/items/fuelcell_plutonium.png new file mode 100644 index 000000000..f05ccd94d Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_plutonium.png differ diff --git a/assets/hbm/textures/items/fuelcell_selenium.png b/assets/hbm/textures/items/fuelcell_selenium.png new file mode 100644 index 000000000..237092dbb Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_selenium.png differ diff --git a/assets/hbm/textures/items/fuelcell_u235.png b/assets/hbm/textures/items/fuelcell_u235.png new file mode 100644 index 000000000..86ba25294 Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_u235.png differ diff --git a/assets/hbm/textures/items/fuelcell_u238m2.png b/assets/hbm/textures/items/fuelcell_u238m2.png new file mode 100644 index 000000000..9ce019f88 Binary files /dev/null and b/assets/hbm/textures/items/fuelcell_u238m2.png differ diff --git a/assets/hbm/textures/items/motor_dnt.png b/assets/hbm/textures/items/motor_dnt.png new file mode 100644 index 000000000..73e4c1e5b Binary files /dev/null and b/assets/hbm/textures/items/motor_dnt.png differ diff --git a/com/hbm/blocks/generic/BlockNTMDirt.java b/com/hbm/blocks/generic/BlockNTMDirt.java index c268ff928..494aba22f 100644 --- a/com/hbm/blocks/generic/BlockNTMDirt.java +++ b/com/hbm/blocks/generic/BlockNTMDirt.java @@ -22,10 +22,10 @@ public class BlockNTMDirt extends BlockDirt { { p_149666_3_.add(new ItemStack(this, 1, 0)); } - - public String getItemStackDisplayName(ItemStack stack) + + public String getLocalizedName() { - return ("" + StatCollector.translateToLocal(Blocks.dirt.getUnlocalizedName())).trim(); + return ("" + StatCollector.translateToLocal(Blocks.dirt.getUnlocalizedName()) + ".name").trim(); } @Override diff --git a/com/hbm/entity/logic/EntityNukeExplosionMK4.java b/com/hbm/entity/logic/EntityNukeExplosionMK4.java index 9bc3cb8a9..919ba35e2 100644 --- a/com/hbm/entity/logic/EntityNukeExplosionMK4.java +++ b/com/hbm/entity/logic/EntityNukeExplosionMK4.java @@ -62,7 +62,7 @@ public class EntityNukeExplosionMK4 extends Entity { //if(!worldObj.isRemote) //MainRegistry.logger.info(explosion.getStoredSize() + " / " + count / length); //explosion.collectTip(speed * 10); - explosion.collectTipAusf3(speed * 10); + explosion.collectTipMk4_5(speed * 10); } else if(explosion.getStoredSize() > 0) { //if(!worldObj.isRemote) //MainRegistry.logger.info(explosion.getProgress() + " / " + count / length); diff --git a/com/hbm/explosion/ExplosionNukeRay.java b/com/hbm/explosion/ExplosionNukeRay.java index 684a36391..c0b2b27e4 100644 --- a/com/hbm/explosion/ExplosionNukeRay.java +++ b/com/hbm/explosion/ExplosionNukeRay.java @@ -25,7 +25,7 @@ public class ExplosionNukeRay { int speed; int processed; int length; - double startY; + int startY; int startCir; public boolean isAusf3Complete = false; @@ -38,7 +38,10 @@ public class ExplosionNukeRay { this.count = count; this.speed = speed; this.length = length; - this.startY = strength; + //Ausf3, must be double + //this.startY = strength; + //Mk 4.5, must be int32 + this.startY = 0; this.startCir = 0; } @@ -223,7 +226,7 @@ public class ExplosionNukeRay { } } - public void collectTipAusf3(int count) { + /*public void collectTipAusf3(int count) { int amountProcessed = 0; @@ -293,6 +296,89 @@ public class ExplosionNukeRay { } } + isAusf3Complete = true; + }*/ + + public void collectTipMk4_5(int count) { + + int amountProcessed = 0; + + double bow = Math.PI * this.strength; + double bowCount = Math.ceil(bow); + + //Axial + //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)); + + 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; + + //circumference = Math.ceil(circumference); + + //Radial + //StartCir starts at circumference + for(int r = startCir; r < circumference; r ++) { + + Vec3 vec = Vec3.createVectorHelper(sectionRad, y, 0); + vec = vec.normalize(); + /*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); + + float res = strength; + + FloatTriplet lastPos = null; + + for(int i = 0; i < length; i ++) { + + if(i > this.length) + break; + + float x0 = (float) (posX + (vec.xCoord * i)); + float y0 = (float) (posY + (vec.yCoord * i)); + float z0 = (float) (posZ + (vec.zCoord * i)); + + double fac = 100 - ((double) i) / ((double) length) * 100; + fac *= 0.07D; + + if(!world.getBlock((int)x0, (int)y0, (int)z0).getMaterial().isLiquid()) + res -= Math.pow(world.getBlock((int)x0, (int)y0, (int)z0).getExplosionResistance(null), 7.5D - fac); + else + res -= Math.pow(Blocks.air.getExplosionResistance(null), 7.5D - fac); + + if(res > 0 && world.getBlock((int)x0, (int)y0, (int)z0) != Blocks.air) { + lastPos = new FloatTriplet(x0, y0, z0); + } + + if(res <= 0 || i + 1 >= this.length) { + if(affectedBlocks.size() < Integer.MAX_VALUE - 100 && lastPos != null) { + affectedBlocks.add(new FloatTriplet(lastPos.xCoord, lastPos.yCoord, lastPos.zCoord)); + } + break; + } + } + + amountProcessed++; + + if(amountProcessed >= count) { + startY = v; + startCir = startCir + 1; + return; + } + } + } + isAusf3Complete = true; } diff --git a/com/hbm/items/special/ItemUnstable.java b/com/hbm/items/special/ItemUnstable.java index a87a9646a..4d9655d49 100644 --- a/com/hbm/items/special/ItemUnstable.java +++ b/com/hbm/items/special/ItemUnstable.java @@ -3,13 +3,21 @@ package com.hbm.items.special; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.lib.ModDamageSource; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; import net.minecraft.world.World; public class ItemUnstable extends Item { + + IIcon iconElements; + IIcon iconArsenic; + IIcon iconVault; int radius; int timer; @@ -17,9 +25,14 @@ public class ItemUnstable extends Item { public ItemUnstable(int radius, int timer) { this.radius = radius; this.timer = timer; + this.setHasSubtypes(true); } public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) { + + if(stack.getItemDamage() != 0) + return; + this.setTimer(stack, this.getTimer(stack) + 1); if(this.getTimer(stack) == timer && !world.isRemote) { @@ -43,4 +56,34 @@ public class ItemUnstable extends Item { return stack.stackTagCompound.getInteger("timer"); } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister p_94581_1_) + { + super.registerIcons(p_94581_1_); + + this.iconElements = p_94581_1_.registerIcon("hbm:hs-elements"); + this.iconArsenic = p_94581_1_.registerIcon("hbm:hs-arsenic"); + this.iconVault = p_94581_1_.registerIcon("hbm:hs-vault"); + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int damage, int layer) + { + switch(damage) { + case 1: return this.iconElements; + case 2: return this.iconArsenic; + case 3: return this.iconVault; + default: return this.itemIcon; + } + } + } diff --git a/com/hbm/items/tool/ItemMS.java b/com/hbm/items/tool/ItemMS.java index 9e88e6649..77495a356 100644 --- a/com/hbm/items/tool/ItemMS.java +++ b/com/hbm/items/tool/ItemMS.java @@ -1,12 +1,17 @@ package com.hbm.items.tool; +import java.util.ArrayList; import java.util.List; +import java.util.Random; +import com.hbm.blocks.ModBlocks; import com.hbm.items.ModItems; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.world.World; public class ItemMS extends Item { @@ -15,5 +20,39 @@ public class ItemMS extends Item { { list.add("Lost but not forgotten"); } + + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float a, float b, float c) + { + if(!world.isRemote) { + if(world.getBlock(x, y, z) == ModBlocks.ntm_dirt) { + + world.func_147480_a(x, y, z, false); + + Random rand = new Random(); + List list = new ArrayList(); + + list.add(new ItemStack(ModItems.ingot_u238m2, 1, 1)); + list.add(new ItemStack(ModItems.ingot_u238m2, 1, 2)); + list.add(new ItemStack(ModItems.ingot_u238m2, 1, 3)); + + for(ItemStack sta : list) { + float f = rand.nextFloat() * 0.8F + 0.1F; + float f1 = rand.nextFloat() * 0.8F + 0.1F; + float f2 = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, sta); + + float f3 = 0.05F; + entityitem.motionX = (float)rand.nextGaussian() * f3; + entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)rand.nextGaussian() * f3; + if(!world.isRemote) + world.spawnEntityInWorld(entityitem); + } + return true; + } + } + + return false; + } }