From 898ca7fcad0523e2f8708eff1925753d3f763f23 Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:01:38 -0600 Subject: [PATCH 1/8] edited block hardnesses --- com/hbm/blocks/ModBlocks.java | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index 34e0981dc..7fc06c2c1 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -20,6 +20,7 @@ import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialLiquid; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -532,25 +533,24 @@ public class ModBlocks { gravel_obsidian = new BlockFalling(Material.iron).setBlockName("gravel_obsidian").setCreativeTab(MainRegistry.tabBlock).setStepSound(Block.soundTypeGravel).setHardness(5.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":gravel_obsidian"); asphalt = new BlockGeneric(Material.rock).setBlockName("asphalt").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(100.0F).setBlockTextureName(RefStrings.MODID + ":asphalt"); - reinforced_brick = new BlockGeneric(Material.rock).setBlockName("reinforced_brick").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_brick"); - reinforced_glass = new ReinforcedBlock(Material.glass).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(0).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_glass"); - reinforced_light = new ReinforcedBlock(Material.rock).setBlockName("reinforced_light").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setLightLevel(1.0F).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_light"); - reinforced_sand = new BlockGeneric(Material.rock).setBlockName("reinforced_sand").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_sand"); - reinforced_lamp_off = new ReinforcedLamp(Material.rock, false).setBlockName("reinforced_lamp_off").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_off"); - reinforced_lamp_on = new ReinforcedLamp(Material.rock, true).setBlockName("reinforced_lamp_on").setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_on"); + reinforced_brick = new BlockGeneric(Material.rock).setBlockName("reinforced_brick").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_brick"); + reinforced_glass = new ReinforcedBlock(Material.glass).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(0).setHardness(15.0F).setResistance(3000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_glass"); + reinforced_light = new ReinforcedBlock(Material.rock).setBlockName("reinforced_light").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setLightLevel(1.0F).setHardness(15.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_light"); + reinforced_sand = new BlockGeneric(Material.rock).setBlockName("reinforced_sand").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_sand"); + reinforced_lamp_off = new ReinforcedLamp(Material.rock, false).setBlockName("reinforced_lamp_off").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_off"); + reinforced_lamp_on = new ReinforcedLamp(Material.rock, true).setBlockName("reinforced_lamp_on").setHardness(15.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_on"); - brick_concrete = new BlockGeneric(Material.rock).setBlockName("brick_concrete").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete"); + brick_concrete = new BlockGeneric(Material.rock).setBlockName("brick_concrete").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete"); brick_obsidian = new BlockGeneric(Material.rock).setBlockName("brick_obsidian").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":brick_obsidian"); - brick_light = new BlockGeneric(Material.rock).setBlockName("brick_light").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":brick_light"); - + brick_light = new BlockGeneric(Material.rock).setBlockName("brick_light").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_light"); cmb_brick = new BlockGeneric(Material.rock).setBlockName("cmb_brick").setCreativeTab(MainRegistry.tabBlock).setHardness(25.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":cmb_brick"); cmb_brick_reinforced = new BlockGeneric(Material.rock).setBlockName("cmb_brick_reinforced").setCreativeTab(MainRegistry.tabBlock).setHardness(25.0F).setResistance(60000.0F).setBlockTextureName(RefStrings.MODID + ":cmb_brick_reinforced"); - block_meteor = new BlockOre(Material.rock).setBlockName("block_meteor").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor"); - block_meteor_cobble = new BlockOre(Material.rock).setBlockName("block_meteor_cobble").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_cobble"); - block_meteor_broken = new BlockOre(Material.rock).setBlockName("block_meteor_broken").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_broken"); - block_meteor_molten = new BlockOre(Material.rock).setBlockName("block_meteor_molten").setLightLevel(0.75F).setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_molten"); - block_meteor_treasure = new BlockOre(Material.rock).setBlockName("block_meteor_treasure").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_treasure"); + block_meteor = new BlockOre(Material.rock).setBlockName("block_meteor").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor"); + block_meteor_cobble = new BlockOre(Material.rock).setBlockName("block_meteor_cobble").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_cobble"); + block_meteor_broken = new BlockOre(Material.rock).setBlockName("block_meteor_broken").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_broken"); + block_meteor_molten = new BlockOre(Material.rock).setBlockName("block_meteor_molten").setLightLevel(0.75F).setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_molten"); + block_meteor_treasure = new BlockOre(Material.rock).setBlockName("block_meteor_treasure").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_meteor_treasure"); tape_recorder = new DecoTapeRecorder(Material.rock).setBlockName("tape_recorder").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_tape_recorder"); steel_poles = new DecoSteelPoles(Material.rock).setBlockName("steel_poles").setCreativeTab(MainRegistry.tabBlock).setHardness(15.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_steel_poles"); @@ -570,7 +570,7 @@ public class ModBlocks { waste_mycelium = new WasteEarth(Material.ground).setBlockName("waste_mycelium").setStepSound(Block.soundTypeGrass).setLightLevel(1F).setCreativeTab(MainRegistry.tabBlock).setHardness(0.5F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":waste_mycelium_side"); waste_trinitite = new BlockOre(Material.sand).setBlockName("waste_trinitite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.tabBlock).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite"); waste_trinitite_red = new BlockOre(Material.sand).setBlockName("waste_trinitite_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.tabBlock).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite_red"); - waste_log = new WasteLog(Material.wood).setBlockName("waste_log").setStepSound(Block.soundTypeWood).setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(0.5F); + waste_log = new WasteLog(Material.wood).setBlockName("waste_log").setStepSound(Block.soundTypeWood).setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(2.5F); waste_planks = new BlockOre(Material.wood).setBlockName("waste_planks").setStepSound(Block.soundTypeWood).setCreativeTab(MainRegistry.tabBlock).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_planks"); frozen_dirt = new BlockOre(Material.wood).setBlockName("frozen_dirt").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.tabBlock).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":frozen_dirt"); frozen_grass = new WasteEarth(Material.wood).setBlockName("frozen_grass").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.tabBlock).setHardness(0.5F).setResistance(2.5F); From 6424500d226c99bce05823e0cead9663d90f40cf Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:07:48 -0600 Subject: [PATCH 2/8] Added blast speed to config max blocks in explosion algorithm now customizeable --- com/hbm/main/MainRegistry.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index c9fff1c12..22f128e4f 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -366,6 +366,7 @@ public class MainRegistry public static int fatmanRadius = 35; public static int nukaRadius = 25; public static int aSchrabRadius = 20; + public static int blastSpeed = 1024; public static int radioStructure = 500; public static int antennaStructure = 250; public static int atomStructure = 500; @@ -1032,6 +1033,10 @@ public class MainRegistry Property propASchrab = config.get(Configuration.CATEGORY_GENERAL, "3.11_aSchrabRadius", 20); propASchrab.comment = "Radius of dropped anti schrabidium"; aSchrabRadius = propASchrab.getInt(); + //add blast speed as config + Property propBlastSpeed = config.get(Configuration.CATEGORY_GENERAL, "Blast Speed", 1024); + propBlastSpeed.comment = "Base speed of all detonations (Blocks / tick)"; + blastSpeed = propBlastSpeed.getInt(); Property propRadio = config.get(Configuration.CATEGORY_GENERAL, "4.00_radioSpawn", 500); propRadio.comment = "Spawn radio station on every nTH chunk"; From c379755dfe01d054bc553222f99887cf4b1346c5 Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:12:47 -0600 Subject: [PATCH 3/8] updated static bombs Replaced fixed blast speed with config value. Added isRemote() check to prevent duplicate entity creation --- com/hbm/blocks/bomb/NukeBoy.java | 6 +++--- com/hbm/blocks/bomb/NukeCustom.java | 4 ++-- com/hbm/blocks/bomb/NukeFleija.java | 4 ++-- com/hbm/blocks/bomb/NukeGadget.java | 4 ++-- com/hbm/blocks/bomb/NukeMan.java | 4 ++-- com/hbm/blocks/bomb/NukeMike.java | 4 ++-- com/hbm/blocks/bomb/NukePrototype.java | 4 ++-- com/hbm/blocks/bomb/NukeTsar.java | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/com/hbm/blocks/bomb/NukeBoy.java b/com/hbm/blocks/bomb/NukeBoy.java index a657c65e3..53f379664 100644 --- a/com/hbm/blocks/bomb/NukeBoy.java +++ b/com/hbm/blocks/bomb/NukeBoy.java @@ -115,7 +115,7 @@ public class NukeBoy extends BlockContainer implements IBomb { public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukeBoy entity = (TileEntityNukeBoy) p_149695_1_.getTileEntity(x, y, z); if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) { - if (entity.isReady()) { + if (entity.isReady() && p_149695_1_.isRemote) { this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1); entity.clearSlots(); p_149695_1_.setBlockToAir(x, y, z); @@ -151,7 +151,7 @@ public class NukeBoy extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = MainRegistry.boyRadius; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 10.0F; world.spawnEntityInWorld(entity); @@ -164,7 +164,7 @@ public class NukeBoy extends BlockContainer implements IBomb { entity2.posZ = z; world.spawnEntityInWorld(entity2); } else { - EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 1000); + EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 3000); entity2.posX = x; entity2.posY = y - 11; entity2.posZ = z; diff --git a/com/hbm/blocks/bomb/NukeCustom.java b/com/hbm/blocks/bomb/NukeCustom.java index 2f1dac836..1d1d8fe36 100644 --- a/com/hbm/blocks/bomb/NukeCustom.java +++ b/com/hbm/blocks/bomb/NukeCustom.java @@ -121,7 +121,7 @@ public class NukeCustom extends BlockContainer implements IBomb { @Override public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukeCustom entity = (TileEntityNukeCustom) p_149695_1_.getTileEntity(x, y, z); - if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) { + if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z) && p_149695_1_.isRemote) { if (entity.isReady()) { float[] f = entity.returnAllValues(); this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1); @@ -167,7 +167,7 @@ public class NukeCustom extends BlockContainer implements IBomb { entity.posY = y + 0.5; entity.posZ = z + 0.5; entity.destructionRange = (int)schrab; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 1.0F; entity.waste = false; diff --git a/com/hbm/blocks/bomb/NukeFleija.java b/com/hbm/blocks/bomb/NukeFleija.java index fc4a94d0a..bac4dbb59 100644 --- a/com/hbm/blocks/bomb/NukeFleija.java +++ b/com/hbm/blocks/bomb/NukeFleija.java @@ -123,7 +123,7 @@ public class NukeFleija extends BlockContainer implements IBomb { public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukeFleija entity = (TileEntityNukeFleija) p_149695_1_.getTileEntity(x, y, z); - if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) + if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) { if(entity.isReady()) { @@ -148,7 +148,7 @@ public class NukeFleija extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = r; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 1.0F; entity.waste = false; diff --git a/com/hbm/blocks/bomb/NukeGadget.java b/com/hbm/blocks/bomb/NukeGadget.java index ffe0e094c..8f1b86172 100644 --- a/com/hbm/blocks/bomb/NukeGadget.java +++ b/com/hbm/blocks/bomb/NukeGadget.java @@ -119,7 +119,7 @@ public class NukeGadget extends BlockContainer implements IBomb { @Override public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukeGadget entity = (TileEntityNukeGadget) p_149695_1_.getTileEntity(x, y, z); - if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) { + if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) { if (entity.isReady()) { this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1); entity.clearSlots(); @@ -164,7 +164,7 @@ public class NukeGadget extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = MainRegistry.gadgetRadius; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 10.0F; world.spawnEntityInWorld(entity); diff --git a/com/hbm/blocks/bomb/NukeMan.java b/com/hbm/blocks/bomb/NukeMan.java index eee26b256..e5ea2a374 100644 --- a/com/hbm/blocks/bomb/NukeMan.java +++ b/com/hbm/blocks/bomb/NukeMan.java @@ -125,7 +125,7 @@ public class NukeMan extends BlockContainer implements IBomb { public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukeMan entity = (TileEntityNukeMan) p_149695_1_.getTileEntity(x, y, z); - if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) + if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) { if(entity.isReady()) { @@ -178,7 +178,7 @@ public class NukeMan extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = MainRegistry.manRadius; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 10.0F; world.spawnEntityInWorld(entity); diff --git a/com/hbm/blocks/bomb/NukeMike.java b/com/hbm/blocks/bomb/NukeMike.java index 717414896..ea58f3a38 100644 --- a/com/hbm/blocks/bomb/NukeMike.java +++ b/com/hbm/blocks/bomb/NukeMike.java @@ -118,7 +118,7 @@ public class NukeMike extends BlockContainer implements IBomb { @Override public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukeMike entity = (TileEntityNukeMike) p_149695_1_.getTileEntity(x, y, z); - if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) { + if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) { if (entity.isReady() && !entity.isFilled()) { this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1); entity.clearSlots(); @@ -146,7 +146,7 @@ public class NukeMike extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = r; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 10.0F; world.spawnEntityInWorld(entity); diff --git a/com/hbm/blocks/bomb/NukePrototype.java b/com/hbm/blocks/bomb/NukePrototype.java index f2228e1b9..430b495e1 100644 --- a/com/hbm/blocks/bomb/NukePrototype.java +++ b/com/hbm/blocks/bomb/NukePrototype.java @@ -134,7 +134,7 @@ public class NukePrototype extends BlockContainer implements IBomb { public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukePrototype entity = (TileEntityNukePrototype) p_149695_1_.getTileEntity(x, y, z); - if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) + if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) { if(entity.isReady()) { @@ -159,7 +159,7 @@ public class NukePrototype extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = r; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 1.0F; entity.waste = false; diff --git a/com/hbm/blocks/bomb/NukeTsar.java b/com/hbm/blocks/bomb/NukeTsar.java index 9a461aebb..4c7fa884a 100644 --- a/com/hbm/blocks/bomb/NukeTsar.java +++ b/com/hbm/blocks/bomb/NukeTsar.java @@ -122,7 +122,7 @@ public class NukeTsar extends BlockContainer implements IBomb { public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_) { TileEntityNukeTsar entity = (TileEntityNukeTsar) p_149695_1_.getTileEntity(x, y, z); - if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)) + if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z)&& p_149695_1_.isRemote) { if(entity.isReady() && !entity.isFilled()) { @@ -155,7 +155,7 @@ public class NukeTsar extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = r; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 10.0F; world.spawnEntityInWorld(entity); From 4237435a09dec25eb086615343ffe2f181fe7aab Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:17:37 -0600 Subject: [PATCH 4/8] Redid Nuclear blast algorithm -localized block variable: reduces number of getBlock calls. -blast code checks blast resistance of block: adds mod compatibility -added crude shielding model: blast code returns int corresponding to how many blocks are shielded by a blast resistant block. Vertical behavior only --- com/hbm/explosion/ExplosionNukeAdvanced.java | 30 ++- com/hbm/explosion/ExplosionNukeGeneric.java | 227 ++++++++++--------- 2 files changed, 135 insertions(+), 122 deletions(-) diff --git a/com/hbm/explosion/ExplosionNukeAdvanced.java b/com/hbm/explosion/ExplosionNukeAdvanced.java index 399bd10bf..ef07620ee 100644 --- a/com/hbm/explosion/ExplosionNukeAdvanced.java +++ b/com/hbm/explosion/ExplosionNukeAdvanced.java @@ -65,8 +65,8 @@ public class ExplosionNukeAdvanced this.radius = rad; this.radius2 = this.radius * this.radius; - - this.explosionCoefficient = coefficient; + + this.explosionCoefficient = Math.min(Math.max((rad + coefficient * (y - 60))/(coefficient*rad), 1/coefficient),1.0f); //scale the coefficient depending on detonation height this.type = typ; this.nlimit = this.radius2 * 4; //How many total columns should be broken (radius ^ 2 is one quadrant, there are 4 quadrants) @@ -99,11 +99,13 @@ public class ExplosionNukeAdvanced if (dist > 0) //check if any blocks have to be broken here { dist = (int) Math.sqrt(dist); //calculate sphere height at this (x,z) coordinate - for (int y = dist; y > -dist / this.explosionCoefficient; y--) //go from top to bottom to favor light updates + for (int y = dist; y > -dist * this.explosionCoefficient; y--) //go from top to bottom to favor light updates { - //this.worldObj.setBlock(this.posX+x, this.posY+y, this.posZ+z, Blocks.air); //set block to air relative to epicenter - - ExplosionNukeGeneric.destruction(this.worldObj, this.posX + x, this.posY + y, this.posZ + z); + if(y<8){//only spare blocks that are mostly below epicenter + y-= ExplosionNukeGeneric.destruction(this.worldObj, this.posX + x, this.posY + y, this.posZ + z);//spare blocks below + }else{//don't spare blocks above epicenter + ExplosionNukeGeneric.destruction(this.worldObj, this.posX + x, this.posY + y, this.posZ + z); + } } } } @@ -114,10 +116,18 @@ public class ExplosionNukeAdvanced if (dist > 0) { dist = (int) Math.sqrt(dist); - for (int y = dist; y > -dist; y--) + //int dist0 = (int)Math.sqrt(this.radius2*0.15f - (x * x + z * z)); + for (int y = dist; y > -dist * this.explosionCoefficient; y--) { - - ExplosionNukeGeneric.vaporDest(this.worldObj, this.posX + x, this.posY + y, this.posZ + z); + y-=ExplosionNukeGeneric.vaporDest(this.worldObj, this.posX + x, this.posY + y, this.posZ + z); + /* + if(dist0>0){//skip blocks already in the destruction zone: we will + if(y>=dist0 || y<=-dist0*this.explosionCoefficient){ + y-=ExplosionNukeGeneric.vaporDest(this.worldObj, this.posX + x, this.posY + y, this.posZ + z); + } + }else{ + y-=ExplosionNukeGeneric.vaporDest(this.worldObj, this.posX + x, this.posY + y, this.posZ + z); + }*/ } } } @@ -128,7 +138,7 @@ public class ExplosionNukeAdvanced if (dist > 0) { dist = (int) Math.sqrt(dist); - for (int y = dist; y > -dist; y--) + for (int y = dist; y > -dist * this.explosionCoefficient; y--) { if(radius >= 95) ExplosionNukeGeneric.wasteDest(this.worldObj, this.posX + x, this.posY + y, this.posZ + z); diff --git a/com/hbm/explosion/ExplosionNukeGeneric.java b/com/hbm/explosion/ExplosionNukeGeneric.java index 7751dcbbe..3143b79cf 100644 --- a/com/hbm/explosion/ExplosionNukeGeneric.java +++ b/com/hbm/explosion/ExplosionNukeGeneric.java @@ -4,6 +4,11 @@ import java.util.HashSet; import java.util.List; import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.material.Material; import net.minecraft.enchantment.EnchantmentProtection; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -316,73 +321,70 @@ public class ExplosionNukeGeneric { } } - public static void destruction(World world, int x, int y, int z) { + public static int destruction(World world, int x, int y, int z) { int rand; if (!world.isRemote) { - if (world.getBlock(x, y, z) != Blocks.bedrock && world.getBlock(x, y, z) != ModBlocks.reinforced_brick - && world.getBlock(x, y, z) != ModBlocks.reinforced_glass - && world.getBlock(x, y, z) != ModBlocks.reinforced_light - && world.getBlock(x, y, z) != ModBlocks.reinforced_sand - && world.getBlock(x, y, z) != ModBlocks.reinforced_lamp_off - && world.getBlock(x, y, z) != ModBlocks.reinforced_lamp_on - && world.getBlock(x, y, z) != ModBlocks.cmb_brick - && world.getBlock(x, y, z) != ModBlocks.crystal_virus - && world.getBlock(x, y, z) != ModBlocks.crystal_hardened - && world.getBlock(x, y, z) != ModBlocks.crystal_pulsar - && world.getBlock(x, y, z) != ModBlocks.cmb_brick_reinforced - && !(world.getBlock(x, y, z) instanceof DecoBlockAlt)) { - if (world.getBlock(x, y, z) == ModBlocks.brick_concrete) { + Block b = world.getBlock(x,y,z); + if (b.getExplosionResistance(null)>=200f) { //500 is the resistance of liquids + //blocks to be spared + int protection = (int)(b.getExplosionResistance(null)/300f); + if (b == ModBlocks.brick_concrete) { rand = field_149933_a.nextInt(8); if (rand == 0) { world.setBlock(x, y, z, Blocks.gravel, 0, 3); + return 0; } - } else if (world.getBlock(x, y, z) == ModBlocks.brick_light) { - rand = field_149933_a.nextInt(2); + } else if (b == ModBlocks.brick_light) { + rand = field_149933_a.nextInt(3); if (rand == 0) { world.setBlock(x, y, z, ModBlocks.waste_planks, 0, 3); + return 0; + }else if (rand == 1){ + world.setBlock(x,y,z,ModBlocks.block_scrap,0,3); + return 0; } - } else if (world.getBlock(x, y, z) == ModBlocks.brick_obsidian) { + } else if (b == ModBlocks.brick_obsidian) { rand = field_149933_a.nextInt(20); if (rand == 0) { world.setBlock(x, y, z, Blocks.obsidian, 0, 3); } - } else if (world.getBlock(x, y, z) == Blocks.obsidian) { + } else if (b == Blocks.obsidian) { world.setBlock(x, y, z, ModBlocks.gravel_obsidian, 0, 3); - } else { - world.setBlock(x, y, z, Blocks.air, 0, 3); + return 0; + } else if(field_149933_a.nextInt(protection+3)==0){ + world.setBlock(x, y, z, ModBlocks.block_scrap,0,3); } + return protection; + }else{//otherwise, kill the block! + world.setBlock(x, y, z, Blocks.air,0, 2); } } + return 0; } - public static void vaporDest(World world, int x, int y, int z) { + public static int vaporDest(World world, int x, int y, int z) { if (!world.isRemote) { - if (world.getBlock(x, y, z) == Blocks.water || world.getBlock(x, y, z) == Blocks.flowing_water - || world.getBlock(x, y, z) == Blocks.tallgrass || world.getBlock(x, y, z) == Blocks.leaves - || world.getBlock(x, y, z) == Blocks.leaves2 || world.getBlock(x, y, z) == Blocks.double_plant - || world.getBlock(x, y, z) == Blocks.cactus || world.getBlock(x, y, z) == Blocks.snow_layer - || world.getBlock(x, y, z) == Blocks.reeds || world.getBlock(x, y, z) == Blocks.glass_pane - || world.getBlock(x, y, z) == Blocks.stained_glass_pane || world.getBlock(x, y, z) == Blocks.carrots - || world.getBlock(x, y, z) == Blocks.potatoes || world.getBlock(x, y, z) == Blocks.wheat - || world.getBlock(x, y, z) == Blocks.ladder || world.getBlock(x, y, z) == Blocks.torch - || world.getBlock(x, y, z) == Blocks.redstone_torch - || world.getBlock(x, y, z) == Blocks.unlit_redstone_torch - || world.getBlock(x, y, z) == Blocks.redstone_wire - || world.getBlock(x, y, z) == Blocks.unpowered_repeater - || world.getBlock(x, y, z) == Blocks.powered_repeater - || world.getBlock(x, y, z) == Blocks.wooden_pressure_plate - || world.getBlock(x, y, z) == Blocks.stone_pressure_plate - || world.getBlock(x, y, z) == Blocks.wooden_button || world.getBlock(x, y, z) == Blocks.stone_button - || world.getBlock(x, y, z) == Blocks.lever || world.getBlock(x, y, z) == Blocks.deadbush - || world.getBlock(x, y, z) == ModBlocks.red_cable) { - world.setBlock(x, y, z, Blocks.air); + Block b = world.getBlock(x,y,z); + if (b.getExplosionResistance(null)<0.5f //most light things + || b == Blocks.web || b == ModBlocks.red_cable + || b instanceof BlockLiquid) { + world.setBlock(x, y, z, Blocks.air,0, 2); + return 0; + } else if (b.getExplosionResistance(null)<=3.0f && !b.isOpaqueCube()){ + if(b != Blocks.chest && b != Blocks.farmland){ + //destroy all medium resistance blocks that aren't chests or farmland + world.setBlock(x, y, z, Blocks.air,0,2); + return 0; + } } - - if (world.getBlock(x, y, z).isFlammable(world, x, y, z, ForgeDirection.UP) + + if (b.isFlammable(world, x, y, z, ForgeDirection.UP) && world.getBlock(x, y + 1, z) == Blocks.air) { - world.setBlock(x, y + 1, z, Blocks.fire); + world.setBlock(x, y + 1, z, Blocks.fire,0,2); } + return (int)( b.getExplosionResistance(null)/300f); } + return 0; } public static void waste(World world, int x, int y, int z, int radius) { @@ -410,21 +412,20 @@ public class ExplosionNukeGeneric { public static void wasteDest(World world, int x, int y, int z) { if (!world.isRemote) { int rand; - - if (world.getBlock(x, y, z) == Blocks.glass || world.getBlock(x, y, z) == Blocks.stained_glass - || world.getBlock(x, y, z) == Blocks.wooden_door || world.getBlock(x, y, z) == Blocks.iron_door) { - world.setBlock(x, y, z, Blocks.air); + Block b = world.getBlock(x,y,z); + if (b == Blocks.wooden_door || b == Blocks.iron_door) { + world.setBlock(x, y, z, Blocks.air,0,2); } - else if (world.getBlock(x, y, z) == Blocks.grass) { + else if (b == Blocks.grass) { world.setBlock(x, y, z, ModBlocks.waste_earth); } - else if (world.getBlock(x, y, z) == Blocks.mycelium) { + else if (b == Blocks.mycelium) { world.setBlock(x, y, z, ModBlocks.waste_mycelium); } - else if (world.getBlock(x, y, z) == Blocks.sand) { + else if (b == Blocks.sand) { rand = field_149933_a.nextInt(20); if (rand == 1 && world.getBlockMetadata(x, y, z) == 0) { world.setBlock(x, y, z, ModBlocks.waste_trinitite); @@ -434,15 +435,15 @@ public class ExplosionNukeGeneric { } } - else if (world.getBlock(x, y, z) == Blocks.clay) { + else if (b == Blocks.clay) { world.setBlock(x, y, z, Blocks.hardened_clay); } - else if (world.getBlock(x, y, z) == Blocks.mossy_cobblestone) { + else if (b == Blocks.mossy_cobblestone) { world.setBlock(x, y, z, Blocks.coal_ore); } - else if (world.getBlock(x, y, z) == Blocks.coal_ore) { + else if (b == Blocks.coal_ore) { rand = field_149933_a.nextInt(10); if (rand == 1 || rand == 2 || rand == 3) { world.setBlock(x, y, z, Blocks.diamond_ore); @@ -452,43 +453,44 @@ public class ExplosionNukeGeneric { } } - else if (world.getBlock(x, y, z) == Blocks.log || world.getBlock(x, y, z) == Blocks.log2) { + else if (b == Blocks.log || b == Blocks.log2) { world.setBlock(x, y, z, ModBlocks.waste_log); } - else if (world.getBlock(x, y, z) == Blocks.planks) { + else if (b == Blocks.brown_mushroom_block) { + if (world.getBlockMetadata(x, y, z) == 10) { + world.setBlock(x, y, z, ModBlocks.waste_log); + } else { + world.setBlock(x, y, z, Blocks.air,0,2); + } + } + + else if (b == Blocks.red_mushroom_block) { + if (world.getBlockMetadata(x, y, z) == 10) { + world.setBlock(x, y, z, ModBlocks.waste_log); + } else { + world.setBlock(x, y, z, Blocks.air,0,2); + } + } + + else if (b.getMaterial() == Material.wood && b.isOpaqueCube() && b != ModBlocks.waste_log) { world.setBlock(x, y, z, ModBlocks.waste_planks); } - else if (world.getBlock(x, y, z) == ModBlocks.ore_uranium) { + else if (b == ModBlocks.ore_uranium) { rand = field_149933_a.nextInt(30); if (rand == 1) { world.setBlock(x, y, z, ModBlocks.ore_schrabidium); } } - else if (world.getBlock(x, y, z) == ModBlocks.ore_nether_uranium) { + else if (b == ModBlocks.ore_nether_uranium) { rand = field_149933_a.nextInt(30); if (rand == 1) { world.setBlock(x, y, z, ModBlocks.ore_nether_schrabidium); } } - else if (world.getBlock(x, y, z) == Blocks.brown_mushroom_block) { - if (world.getBlockMetadata(x, y, z) == 10) { - world.setBlock(x, y, z, ModBlocks.waste_log); - } else { - world.setBlock(x, y, z, Blocks.air); - } - } - - else if (world.getBlock(x, y, z) == Blocks.red_mushroom_block) { - if (world.getBlockMetadata(x, y, z) == 10) { - world.setBlock(x, y, z, ModBlocks.waste_log); - } else { - world.setBlock(x, y, z, Blocks.air); - } - } } } @@ -572,7 +574,7 @@ public class ExplosionNukeGeneric { if (world.getBlockMetadata(x, y, z) == 10) { world.setBlock(x, y, z, ModBlocks.waste_log); } else { - world.setBlock(x, y, z, Blocks.air); + world.setBlock(x, y, z, Blocks.air,0,2); } } @@ -580,7 +582,7 @@ public class ExplosionNukeGeneric { if (world.getBlockMetadata(x, y, z) == 10) { world.setBlock(x, y, z, ModBlocks.waste_log); } else { - world.setBlock(x, y, z, Blocks.air); + world.setBlock(x, y, z, Blocks.air,0,2); } } } @@ -588,53 +590,54 @@ public class ExplosionNukeGeneric { public static void emp(World world, int x, int y, int z) { if (!world.isRemote) { - + + Block b = world.getBlock(x,y,z); if (world.getTileEntity(x, y, z) != null && (world.getTileEntity(x, y, z) instanceof ISource || world.getTileEntity(x, y, z) instanceof IConsumer || world.getTileEntity(x, y, z) instanceof TileEntityDummy)) { - world.setBlock(x, y, z, ModBlocks.block_electrical_scrap); + world.setBlock(x, y, z, ModBlocks.block_electrical_scrap,0,2); } - else if (world.getBlock(x, y, z) == ModBlocks.red_wire_coated || - world.getBlock(x, y, z) == ModBlocks.factory_titanium_furnace || - world.getBlock(x, y, z) == ModBlocks.factory_titanium_conductor || - world.getBlock(x, y, z) == ModBlocks.factory_advanced_furnace || - world.getBlock(x, y, z) == ModBlocks.factory_advanced_conductor || - world.getBlock(x, y, z) == ModBlocks.reactor_conductor || - world.getBlock(x, y, z) == ModBlocks.fusion_conductor || - world.getBlock(x, y, z) == ModBlocks.fusion_center || - world.getBlock(x, y, z) == ModBlocks.fusion_motor || - world.getBlock(x, y, z) == ModBlocks.watz_conductor || - world.getBlock(x, y, z) == ModBlocks.fwatz_conductor || - world.getBlock(x, y, z) == ModBlocks.fwatz_hatch || - world.getBlock(x, y, z) == ModBlocks.fwatz_computer) { - world.setBlock(x, y, z, ModBlocks.block_electrical_scrap); + else if (b == ModBlocks.red_wire_coated || + b == ModBlocks.factory_titanium_furnace || + b == ModBlocks.factory_titanium_conductor || + b == ModBlocks.factory_advanced_furnace || + b == ModBlocks.factory_advanced_conductor || + b == ModBlocks.reactor_conductor || + b == ModBlocks.fusion_conductor || + b == ModBlocks.fusion_center || + b == ModBlocks.fusion_motor || + b == ModBlocks.watz_conductor || + b == ModBlocks.fwatz_conductor || + b == ModBlocks.fwatz_hatch || + b == ModBlocks.fwatz_computer) { + world.setBlock(x, y, z, ModBlocks.block_electrical_scrap,0,2); } - else if (world.getBlock(x, y, z) == ModBlocks.red_cable || - world.getBlock(x, y, z) == Blocks.redstone_wire || - world.getBlock(x, y, z) == Blocks.powered_repeater || - world.getBlock(x, y, z) == Blocks.unpowered_repeater || - world.getBlock(x, y, z) == Blocks.activator_rail || - world.getBlock(x, y, z) == Blocks.detector_rail || - world.getBlock(x, y, z) == Blocks.golden_rail || - world.getBlock(x, y, z) == Blocks.redstone_block || - world.getBlock(x, y, z) == Blocks.redstone_lamp || - world.getBlock(x, y, z) == Blocks.redstone_ore || - world.getBlock(x, y, z) == Blocks.redstone_torch || - world.getBlock(x, y, z) == Blocks.unlit_redstone_torch || - world.getBlock(x, y, z) == Blocks.powered_comparator || - world.getBlock(x, y, z) == Blocks.unpowered_comparator) { - world.setBlock(x, y, z, Blocks.air); + else if (b == ModBlocks.red_cable || + b == Blocks.redstone_wire || + b == Blocks.powered_repeater || + b == Blocks.unpowered_repeater || + b == Blocks.activator_rail || + b == Blocks.detector_rail || + b == Blocks.golden_rail || + b == Blocks.redstone_block || + b == Blocks.redstone_lamp || + b == Blocks.redstone_ore || + b == Blocks.redstone_torch || + b == Blocks.unlit_redstone_torch || + b == Blocks.powered_comparator || + b == Blocks.unpowered_comparator) { + world.setBlock(x, y, z, Blocks.air,0,2); } - else if (world.getBlock(x, y, z) == Blocks.dispenser || - world.getBlock(x, y, z) == Blocks.dropper || - world.getBlock(x, y, z) == Blocks.piston || - world.getBlock(x, y, z) == Blocks.piston_extension || - world.getBlock(x, y, z) == Blocks.piston_head || - world.getBlock(x, y, z) == Blocks.sticky_piston) { - world.setBlock(x, y, z, Blocks.gravel); + else if (b == Blocks.dispenser || + b == Blocks.dropper || + b == Blocks.piston || + b == Blocks.piston_extension || + b == Blocks.piston_head || + b == Blocks.sticky_piston) { + world.setBlock(x, y, z, Blocks.gravel,0,2); } } //world.setBlock(x, y, z, Blocks.air); From 95e89df4170529fd1c2baf7a7eabce4bf2133449 Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:19:53 -0600 Subject: [PATCH 5/8] Slowed down cloud speed Blast ring speed now kind of corresponds to block destruction speed... --- com/hbm/entity/effect/EntityNukeCloudSmall.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com/hbm/entity/effect/EntityNukeCloudSmall.java b/com/hbm/entity/effect/EntityNukeCloudSmall.java index 4f4bcf21b..44063af95 100644 --- a/com/hbm/entity/effect/EntityNukeCloudSmall.java +++ b/com/hbm/entity/effect/EntityNukeCloudSmall.java @@ -57,14 +57,14 @@ public class EntityNukeCloudSmall extends Entity { this.age = 0; this.setDead(); } - ring += 0.1F; + ring += 0.03F; if(age < 150) { height = -60F + ((age - 100) * 60 / 50); if(scale < 1.5) { - scale += 0.02; + scale += 0.006f; } } From be1b059c35f02791efda2c40ed5cb452b66843c9 Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:21:27 -0600 Subject: [PATCH 6/8] Speed increases over time To keep up with increasing diameter --- com/hbm/entity/logic/EntityNukeExplosionMK3.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com/hbm/entity/logic/EntityNukeExplosionMK3.java b/com/hbm/entity/logic/EntityNukeExplosionMK3.java index fc33af4fe..a2db9a1e6 100644 --- a/com/hbm/entity/logic/EntityNukeExplosionMK3.java +++ b/com/hbm/entity/logic/EntityNukeExplosionMK3.java @@ -4,6 +4,7 @@ import com.hbm.entity.effect.EntityFalloutRain; import com.hbm.explosion.ExplosionFleija; import com.hbm.explosion.ExplosionNukeAdvanced; import com.hbm.explosion.ExplosionNukeGeneric; +import com.hbm.main.MainRegistry; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; @@ -96,7 +97,7 @@ public class EntityNukeExplosionMK3 extends Entity { this.did = true; } - speed = 100; + speed += 1; //increase speed to keep up with expansion boolean flag = false; boolean flag2 = false; @@ -132,6 +133,7 @@ public class EntityNukeExplosionMK3 extends Entity { fallout.setScale((int)(this.destructionRange * 1.8)); this.worldObj.spawnEntityInWorld(fallout); + //this.worldObj.getWorldInfo().setRaining(true); did2 = true; } From 0ae9c55376b2243f08a1046b31506aded816d228 Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:22:25 -0600 Subject: [PATCH 7/8] Added blast speed to missiles Checks main config for blast speed --- com/hbm/entity/missile/EntityMissileMirv.java | 2 +- com/hbm/entity/missile/EntityMissileNuclear.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com/hbm/entity/missile/EntityMissileMirv.java b/com/hbm/entity/missile/EntityMissileMirv.java index 979597261..328110bf8 100644 --- a/com/hbm/entity/missile/EntityMissileMirv.java +++ b/com/hbm/entity/missile/EntityMissileMirv.java @@ -28,7 +28,7 @@ public class EntityMissileMirv extends EntityMissileBaseAdvanced { entity.posY = this.posY; entity.posZ = this.posZ; entity.destructionRange = MainRegistry.missileRadius; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 10.0F; this.worldObj.spawnEntityInWorld(entity); diff --git a/com/hbm/entity/missile/EntityMissileNuclear.java b/com/hbm/entity/missile/EntityMissileNuclear.java index b13d2e8d3..f6552e4f7 100644 --- a/com/hbm/entity/missile/EntityMissileNuclear.java +++ b/com/hbm/entity/missile/EntityMissileNuclear.java @@ -26,7 +26,7 @@ public class EntityMissileNuclear extends EntityMissileBaseAdvanced { entity.posY = this.posY; entity.posZ = this.posZ; entity.destructionRange = MainRegistry.missileRadius; - entity.speed = 25; + entity.speed = MainRegistry.blastSpeed; entity.coefficient = 10.0F; this.worldObj.spawnEntityInWorld(entity); From 780b679e88b65f82c25e5f61fabe5f234e540edf Mon Sep 17 00:00:00 2001 From: grangerave Date: Sat, 2 Dec 2017 20:23:19 -0600 Subject: [PATCH 8/8] added Blast speed to projectiles checks main config for blast speed --- com/hbm/entity/projectile/EntityMiniMIRV.java | 2 +- com/hbm/entity/projectile/EntityMiniNuke.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/com/hbm/entity/projectile/EntityMiniMIRV.java b/com/hbm/entity/projectile/EntityMiniMIRV.java index 80bd4f3ea..780c266a0 100644 --- a/com/hbm/entity/projectile/EntityMiniMIRV.java +++ b/com/hbm/entity/projectile/EntityMiniMIRV.java @@ -255,7 +255,7 @@ public class EntityMiniMIRV extends Entity implements IProjectile entity0.posY = this.posY; entity0.posZ = this.posZ; entity0.destructionRange = MainRegistry.fatmanRadius; - entity0.speed = 25; + entity0.speed = MainRegistry.blastSpeed; entity0.coefficient = 10.0F; this.worldObj.spawnEntityInWorld(entity0); diff --git a/com/hbm/entity/projectile/EntityMiniNuke.java b/com/hbm/entity/projectile/EntityMiniNuke.java index cae8cfc4a..85f036d61 100644 --- a/com/hbm/entity/projectile/EntityMiniNuke.java +++ b/com/hbm/entity/projectile/EntityMiniNuke.java @@ -242,11 +242,11 @@ public class EntityMiniNuke extends Entity implements IProjectile entity0.posY = this.posY; entity0.posZ = this.posZ; entity0.destructionRange = MainRegistry.fatmanRadius; - entity0.speed = 25; + entity0.speed = MainRegistry.blastSpeed; entity0.coefficient = 10.0F; this.worldObj.spawnEntityInWorld(entity0); - if(rand.nextInt(100) == 0) + if(rand.nextInt(100) >= 0) //edited { ExplosionParticleB.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); } else {