From babe46761ec04ede763e64a1c6c4317319361952 Mon Sep 17 00:00:00 2001 From: HbmMods Date: Mon, 21 May 2018 22:51:57 +0200 Subject: [PATCH] mk4.5, sorta --- .../hbm/textures/items/fuelcell_arsenic.png | Bin 0 -> 293 bytes assets/hbm/textures/items/fuelcell_base.png | Bin 0 -> 258 bytes .../hbm/textures/items/fuelcell_euphemium.png | Bin 0 -> 300 bytes .../hbm/textures/items/fuelcell_neptunium.png | Bin 0 -> 287 bytes .../hbm/textures/items/fuelcell_plutonium.png | Bin 0 -> 280 bytes .../hbm/textures/items/fuelcell_selenium.png | Bin 0 -> 294 bytes assets/hbm/textures/items/fuelcell_u235.png | Bin 0 -> 280 bytes assets/hbm/textures/items/fuelcell_u238m2.png | Bin 0 -> 293 bytes assets/hbm/textures/items/motor_dnt.png | Bin 0 -> 374 bytes com/hbm/blocks/generic/BlockNTMDirt.java | 6 +- .../entity/logic/EntityNukeExplosionMK4.java | 2 +- com/hbm/explosion/ExplosionNukeRay.java | 92 +++++++++++++++++- com/hbm/items/special/ItemUnstable.java | 43 ++++++++ com/hbm/items/tool/ItemMS.java | 39 ++++++++ 14 files changed, 175 insertions(+), 7 deletions(-) create mode 100644 assets/hbm/textures/items/fuelcell_arsenic.png create mode 100644 assets/hbm/textures/items/fuelcell_base.png create mode 100644 assets/hbm/textures/items/fuelcell_euphemium.png create mode 100644 assets/hbm/textures/items/fuelcell_neptunium.png create mode 100644 assets/hbm/textures/items/fuelcell_plutonium.png create mode 100644 assets/hbm/textures/items/fuelcell_selenium.png create mode 100644 assets/hbm/textures/items/fuelcell_u235.png create mode 100644 assets/hbm/textures/items/fuelcell_u238m2.png create mode 100644 assets/hbm/textures/items/motor_dnt.png diff --git a/assets/hbm/textures/items/fuelcell_arsenic.png b/assets/hbm/textures/items/fuelcell_arsenic.png new file mode 100644 index 0000000000000000000000000000000000000000..4a2c066f02c00f6a8ed9db144d9a915a26c9b66c GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#VfwYD6b;ZJh{H#}vRm{`V3JW$Id{)zR?cO5sjI6ASju{y{x>^1uG%H-) z8+GwgBlq;;^M5Vu|9rUab$JVC(*ns;Jw9oZRC+rSZkxFVKKO0N5Ga!QbK^_nhS$61 zPJeExN2vTin<3vzu+d z9k4`x!=1d_r$2gZxLwO%aph^%Upa%>=NT>L`!#>~$JTvxcTzrs{3>w)|K$$W|LeBC pVwDKDMDd4gmU-!PC{xWt~$(69A(Uc(nik literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuelcell_base.png b/assets/hbm/textures/items/fuelcell_base.png new file mode 100644 index 0000000000000000000000000000000000000000..b74dc7b3503228f0b23140ff25d6e66dcc53d65c GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#VfQ006mPK{GzUq-N+;65i7_?0H zG5Y!YdAgb8kIYr8iXx}&44>!fp>z6DCr6;j#cjHovzP)zTA#vLSa+y}k?G70N~>v!C^+3-N~dF4B&@__557ygTyw|w(DUw_TG9q0)LPgg&ebxsLQ E05VEwtpET3 literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuelcell_euphemium.png b/assets/hbm/textures/items/fuelcell_euphemium.png new file mode 100644 index 0000000000000000000000000000000000000000..0acd3351ef16512611b487a6801d49ec6563ede7 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#VfCb@h* z@7vE9bKUm(s#Q)d9+yMBKNm#@cs;b>^U`!-x&Qrqx$otSOj8Dj>!lIXT6%my5a&i0=>)N>FVdQ&MBb@0ASa7i2wiq literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuelcell_neptunium.png b/assets/hbm/textures/items/fuelcell_neptunium.png new file mode 100644 index 0000000000000000000000000000000000000000..b4edaede1c263e9bb991f8061151b5648798bbf6 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf39e`y(w-eDa#TfW$2#xJCPxZ+9HynZ)#d)?5nwrZclB#2 zLB;dMi_bp08sPP?QqD`$rA4Fb-R5n%z1!Fr9I|^KTl75s@g>J7tm4W}%ggn8TY+sHsCp|R3j$P_V9LEcZ0tv_l>IP2iyMFZJ*B?;cw}C j`D7V;XlUeT`gTe~DWM4fbv<+% literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuelcell_plutonium.png b/assets/hbm/textures/items/fuelcell_plutonium.png new file mode 100644 index 0000000000000000000000000000000000000000..f05ccd94d0f21d3dd4a7889c1f3f12e929442ca2 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#VfBs1U(~ubFZpqUCX?dHb!v*fb~(nM zzkjsn`Lp%ZraO~VZuZ%z-`=3nn+a literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuelcell_selenium.png b/assets/hbm/textures/items/fuelcell_selenium.png new file mode 100644 index 0000000000000000000000000000000000000000..237092dbb8fc68ad914085f3b3621216fb6ecea5 GIT binary patch literal 294 zcmV+>0oneEP)irAz`QY1TY8{%%#Sceo5f{^C(o0Q@T+=ke= zh@?oBW)RZkK`aE(KNIz9sm{z0RY;z#j-5AuDe?% zX-~M-dN*UcpFgq;16Ds%0Gg)ZcN6>{aHrGp4L}%PcEiWL1n@lXNvvlHUeq8US{yEi s(~;#e90V9gIgaDrGzUdd82umV49xvhkF;_F7ytkO07*qoM6N<$f^8>v3IG5A literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuelcell_u235.png b/assets/hbm/textures/items/fuelcell_u235.png new file mode 100644 index 0000000000000000000000000000000000000000..86ba25294dec816f97b15324b00aa1d54a4a4b73 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#VfVpX6-&2k)v!t&=Y9~CxMj8-i-f-=&*5Vw?2*$X c|JuJ~QVk0|$kb#t8|XC#Pgg&ebxsLQ05{`ufB*mh literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuelcell_u238m2.png b/assets/hbm/textures/items/fuelcell_u238m2.png new file mode 100644 index 0000000000000000000000000000000000000000..9ce019f885d3c09e61d81eefc96f5b7f1774a577 GIT binary patch literal 293 zcmV+=0owkFP)z@V z<5=^LO~nA8`5*uj24t41V$dbY7z(Q!j(JbO-K@bGN$)Q8> zW4L4qZVuUkDCbZUS`)+;2jA(qlp)L0=hqK9j8fg_sunTp zE?ptWvkWm901(G9!F|9}^QM9rbz2ljtJMPFV!sc-=q23G$GH Uv1>=PSO5S307*qoM6N<$f&@mK8UO$Q literal 0 HcmV?d00001 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; + } }