diff --git a/src/main/java/api/hbm/entity/IRadarDetectable.java b/src/main/java/api/hbm/entity/IRadarDetectable.java index 295be47a6..293b2030b 100644 --- a/src/main/java/api/hbm/entity/IRadarDetectable.java +++ b/src/main/java/api/hbm/entity/IRadarDetectable.java @@ -3,18 +3,24 @@ package api.hbm.entity; public interface IRadarDetectable { public static enum RadarTargetType { - MISSILE_TIER0, //tier 0 missile (micro missile assemblies) - MISSILE_TIER1, //tier 1 missiles - MISSILE_TIER2, //tier 2 missiles - MISSILE_TIER3, //tier 3 missiles - MISSILE_TIER4, //tier 4 missiles (nuclear, thermo, doomsday) - MISSILE_10, //size 10 custom missiles - MISSILE_10_15, //size 10/15 custom missiles - MISSILE_15, //size 15 custom missiles - MISSILE_15_20, //size 15/20 custom missiles - MISSILE_20, //size 20 custom missiles - MISSILE_AB, //anti ballistic missile - PLAYER, //airborne players + MISSILE_TIER0("Micro Missile"), //tier 0 missile (micro missile assemblies) + MISSILE_TIER1("Tier 1 Missile"), //tier 1 missiles + MISSILE_TIER2("Tier 2 Missile"), //tier 2 missiles + MISSILE_TIER3("Tier 3 Missile"), //tier 3 missiles + MISSILE_TIER4("Tier 4 Missile"), //tier 4 missiles (nuclear, thermo, doomsday) + MISSILE_10("Size 10 Custom Missile"), //size 10 custom missiles + MISSILE_10_15("Size 10/15 Custom Missile"), //size 10/15 custom missiles + MISSILE_15("Size 15 Custom Missile"), //size 15 custom missiles + MISSILE_15_20("Size 15/20 Custom Missile"), //size 15/20 custom missiles + MISSILE_20("Size 20 Custom Missile"), //size 20 custom missiles + MISSILE_AB("Anti-Ballistic Missile"), //anti ballistic missile + PLAYER("Player"); //airborne players + + public String name; + + private RadarTargetType(String name) { + this.name = name; + } } public RadarTargetType getTargetType(); diff --git a/src/main/java/com/hbm/blocks/bomb/BlockCrashedBomb.java b/src/main/java/com/hbm/blocks/bomb/BlockCrashedBomb.java index da1be6bb0..f00a61355 100644 --- a/src/main/java/com/hbm/blocks/bomb/BlockCrashedBomb.java +++ b/src/main/java/com/hbm/blocks/bomb/BlockCrashedBomb.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityBalefire; import com.hbm.explosion.ExplosionParticleB; import com.hbm.interfaces.IBomb; @@ -103,7 +104,7 @@ public class BlockCrashedBomb extends BlockContainer implements IBomb { bf.posX = x; bf.posY = y; bf.posZ = z; - bf.destructionRange = (int) (MainRegistry.fatmanRadius * 1.25); + bf.destructionRange = (int) (BombConfig.fatmanRadius * 1.25); world.spawnEntityInWorld(bf); ExplosionParticleB.spawnMush(world, x, y, z); } diff --git a/src/main/java/com/hbm/blocks/bomb/CheaterVirus.java b/src/main/java/com/hbm/blocks/bomb/CheaterVirus.java index 56bbb6626..c81a16827 100644 --- a/src/main/java/com/hbm/blocks/bomb/CheaterVirus.java +++ b/src/main/java/com/hbm/blocks/bomb/CheaterVirus.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.explosion.ExplosionChaos; import com.hbm.main.MainRegistry; @@ -36,7 +37,7 @@ public class CheaterVirus extends Block { @Override public void updateTick(World world, int x, int y, int z, Random rand) { - if(MainRegistry.enableVirus){ + if(GeneralConfig.enableVirus){ if(world.getBlock(x + 1, y, z) != ModBlocks.cheater_virus && world.getBlock(x + 1, y, z) != Blocks.air && world.getBlock(x + 1, y, z) != ModBlocks.cheater_virus) { world.setBlock(x + 1, y, z, ModBlocks.cheater_virus); } diff --git a/src/main/java/com/hbm/blocks/bomb/CheaterVirusSeed.java b/src/main/java/com/hbm/blocks/bomb/CheaterVirusSeed.java index 7025e9fe2..1fe495783 100644 --- a/src/main/java/com/hbm/blocks/bomb/CheaterVirusSeed.java +++ b/src/main/java/com/hbm/blocks/bomb/CheaterVirusSeed.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import net.minecraft.block.Block; @@ -23,7 +24,7 @@ public class CheaterVirusSeed extends Block { super.breakBlock(world, x, y, z, block, i); - if(!MainRegistry.enableVirus) + if(!GeneralConfig.enableVirus) return; if((world.getBlock(x + 1, y, z) == Blocks.air || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus_seed) && @@ -42,7 +43,7 @@ public class CheaterVirusSeed extends Block { @Override public void updateTick(World world, int x, int y, int z, Random rand) { - if(!MainRegistry.enableVirus) + if(!GeneralConfig.enableVirus) return; if((world.getBlock(x + 1, y, z) == Blocks.air || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus_seed) && diff --git a/src/main/java/com/hbm/blocks/bomb/CrystalVirus.java b/src/main/java/com/hbm/blocks/bomb/CrystalVirus.java index bd12ed61f..63a889c16 100644 --- a/src/main/java/com/hbm/blocks/bomb/CrystalVirus.java +++ b/src/main/java/com/hbm/blocks/bomb/CrystalVirus.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import net.minecraft.block.Block; @@ -20,7 +21,7 @@ public class CrystalVirus extends Block { @Override public void updateTick(World world, int x, int y, int z, Random rand) { - if(MainRegistry.enableVirus) { + if(GeneralConfig.enableVirus) { if(world.getBlock(x + 1, y, z) != ModBlocks.crystal_virus && world.getBlock(x + 1, y, z) != Blocks.air && world.getBlock(x + 1, y, z) != ModBlocks.crystal_hardened && world.getBlock(x + 1, y, z) != ModBlocks.crystal_pulsar) { world.setBlock(x + 1, y, z, ModBlocks.crystal_virus); } diff --git a/src/main/java/com/hbm/blocks/bomb/DetCord.java b/src/main/java/com/hbm/blocks/bomb/DetCord.java index 2c885f7f4..01c94b313 100644 --- a/src/main/java/com/hbm/blocks/bomb/DetCord.java +++ b/src/main/java/com/hbm/blocks/bomb/DetCord.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionLarge; @@ -82,9 +83,9 @@ public class DetCord extends Block implements IBomb { ExplosionLarge.explode(world, x, y, z, 15, true, false, false); } if(this == ModBlocks.det_nuke) { - world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, MainRegistry.missileRadius, x + 0.5, y + 0.5, z + 0.5)); + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5)); - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, MainRegistry.missileRadius * 0.005F); + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.missileRadius * 0.005F); entity2.posX = x; entity2.posY = y; entity2.posZ = z; diff --git a/src/main/java/com/hbm/blocks/bomb/Landmine.java b/src/main/java/com/hbm/blocks/bomb/Landmine.java index b64c739ff..0a420fd25 100644 --- a/src/main/java/com/hbm/blocks/bomb/Landmine.java +++ b/src/main/java/com/hbm/blocks/bomb/Landmine.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionParticle; @@ -175,7 +176,7 @@ public class Landmine extends BlockContainer implements IBomb { } if (this == ModBlocks.mine_fat) { - world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, MainRegistry.fatmanRadius, x + 0.5, y + 0.5, z + 0.5)); + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.fatmanRadius, x + 0.5, y + 0.5, z + 0.5)); if(MainRegistry.polaroidID == 11) { ExplosionParticleB.spawnMush(world, x + 0.5, y - 3, z + 0.5); diff --git a/src/main/java/com/hbm/blocks/bomb/LaunchPad.java b/src/main/java/com/hbm/blocks/bomb/LaunchPad.java index 17b5c4f85..dbfd69040 100644 --- a/src/main/java/com/hbm/blocks/bomb/LaunchPad.java +++ b/src/main/java/com/hbm/blocks/bomb/LaunchPad.java @@ -5,6 +5,7 @@ import java.util.Random; import org.apache.logging.log4j.Level; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.entity.missile.EntityCarrier; import com.hbm.entity.missile.EntityMissileAntiBallistic; import com.hbm.entity.missile.EntityMissileBHole; @@ -225,7 +226,7 @@ public class LaunchPad extends BlockContainer implements IBomb { xCoord += 1; } - if(MainRegistry.enableExtendedLogging) + if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[MISSILE] Tried to launch missile at " + x + " / " + y + " / " + z + " to " + xCoord + " / " + zCoord + "!"); if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_generic && entity.power >= 75000) diff --git a/src/main/java/com/hbm/blocks/bomb/NukeBoy.java b/src/main/java/com/hbm/blocks/bomb/NukeBoy.java index e2aff8edc..13fd176d8 100644 --- a/src/main/java/com/hbm/blocks/bomb/NukeBoy.java +++ b/src/main/java/com/hbm/blocks/bomb/NukeBoy.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudNoShroom; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; @@ -30,7 +31,6 @@ public class NukeBoy extends BlockContainer implements IBomb { private static boolean keepInventory = false; private final static Random field_149933_a = new Random(); - private boolean isExploding = false; public NukeBoy(Material p_i45386_1_) { super(p_i45386_1_); @@ -126,39 +126,12 @@ public class NukeBoy extends BlockContainer implements IBomb { public boolean igniteTestBomb(World world, int x, int y, int z) { if (!world.isRemote) { - tetn.clearSlots(); - // world.spawnParticle("hugeexplosion", x, y, z, 0, 0, 0); //spawns - // a huge explosion particle - world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); // x,y,z,sound,volume,pitch - /* - * ExplosionNukeGeneric.detonateTestBomb(world, x, y, z, 120); - * ExplosionNukeGeneric.vapor(world, x, y, z, 200); - * ExplosionNukeGeneric.waste(world, x, y, z, 150); - * ExplosionNukeGeneric.dealDamage(world, x, y, z, 150); - */ - - /* - * EntityNukeExplosion entity = new EntityNukeExplosion(world); - * entity.posX = x; entity.posY = y; entity.posZ = z; - * entity.destructionRange = 120; entity.vaporRange = 200; - * entity.wasteRange = 150; entity.damageRange = 150; - * - * world.spawnEntityInWorld(entity); - */ - world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, MainRegistry.boyRadius, x + 0.5, y + 0.5, z + 0.5)); - - // ExplosionNukeAdvanced.mush(world, x, y, z); - - if (MainRegistry.enableNukeClouds) { - world.spawnEntityInWorld(EntityNukeCloudSmall.statFac(world, x, y, z, MainRegistry.boyRadius)); - } else { - EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 3000); - entity2.posX = x; - entity2.posY = y - 11; - entity2.posZ = z; - world.spawnEntityInWorld(entity2); - } + tetn.clearSlots(); + world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); + + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.boyRadius, x + 0.5, y + 0.5, z + 0.5)); + world.spawnEntityInWorld(EntityNukeCloudSmall.statFac(world, x, y, z, BombConfig.boyRadius)); } return false; } diff --git a/src/main/java/com/hbm/blocks/bomb/NukeCustom.java b/src/main/java/com/hbm/blocks/bomb/NukeCustom.java index 68f3dca4c..b0ec7d80e 100644 --- a/src/main/java/com/hbm/blocks/bomb/NukeCustom.java +++ b/src/main/java/com/hbm/blocks/bomb/NukeCustom.java @@ -3,6 +3,7 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityCloudFleija; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.grenade.EntityGrenadeZOMG; @@ -155,7 +156,7 @@ public class NukeCustom extends BlockContainer implements IBomb { EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(worldObj); entity.setPosition(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); entity.destructionRange = (int) schrab; - entity.speed = MainRegistry.blastSpeed; + entity.speed = BombConfig.blastSpeed; entity.coefficient = 1.0F; entity.waste = false; worldObj.spawnEntityInWorld(entity); diff --git a/src/main/java/com/hbm/blocks/bomb/NukeFleija.java b/src/main/java/com/hbm/blocks/bomb/NukeFleija.java index 5cda2dccb..7311d4d3d 100644 --- a/src/main/java/com/hbm/blocks/bomb/NukeFleija.java +++ b/src/main/java/com/hbm/blocks/bomb/NukeFleija.java @@ -5,6 +5,7 @@ import java.util.Map; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityCloudFleija; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.interfaces.IBomb; @@ -31,7 +32,6 @@ public class NukeFleija extends BlockContainer implements IBomb { private final Random field_149933_a = new Random(); private static boolean keepInventory = false; - private Map field_77288_k = new HashMap(); public NukeFleija(Material p_i45386_1_) { super(p_i45386_1_); @@ -129,7 +129,7 @@ public class NukeFleija extends BlockContainer implements IBomb { this.onBlockDestroyedByPlayer(p_149695_1_, x, y, z, 1); entity.clearSlots(); p_149695_1_.setBlockToAir(x, y, z); - igniteTestBomb(p_149695_1_, x, y, z, MainRegistry.fleijaRadius); + igniteTestBomb(p_149695_1_, x, y, z, BombConfig.fleijaRadius); } } } @@ -146,7 +146,7 @@ public class NukeFleija extends BlockContainer implements IBomb { entity.posY = y; entity.posZ = z; entity.destructionRange = r; - entity.speed = MainRegistry.blastSpeed; + entity.speed = BombConfig.blastSpeed; entity.coefficient = 1.0F; entity.waste = false; @@ -209,7 +209,7 @@ public class NukeFleija extends BlockContainer implements IBomb { this.onBlockDestroyedByPlayer(world, x, y, z, 1); entity.clearSlots(); world.setBlockToAir(x, y, z); - igniteTestBomb(world, x, y, z, MainRegistry.fleijaRadius); + igniteTestBomb(world, x, y, z, BombConfig.fleijaRadius); } } } diff --git a/src/main/java/com/hbm/blocks/bomb/NukeGadget.java b/src/main/java/com/hbm/blocks/bomb/NukeGadget.java index 56d8804b1..8a4ddbda8 100644 --- a/src/main/java/com/hbm/blocks/bomb/NukeGadget.java +++ b/src/main/java/com/hbm/blocks/bomb/NukeGadget.java @@ -1,11 +1,9 @@ package com.hbm.blocks.bomb; -import java.util.HashMap; -import java.util.Map; import java.util.Random; import com.hbm.blocks.ModBlocks; -import com.hbm.entity.effect.EntityNukeCloudNoShroom; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.interfaces.IBomb; @@ -32,8 +30,6 @@ public class NukeGadget extends BlockContainer implements IBomb { private final Random field_149933_a = new Random(); private static boolean keepInventory = false; - private Map field_77288_k = new HashMap(); - private boolean isExploding = false; public NukeGadget(Material p_i45386_1_) { super(p_i45386_1_); @@ -130,159 +126,22 @@ public class NukeGadget extends BlockContainer implements IBomb { public boolean igniteTestBomb(World world, int x, int y, int z) { if (!world.isRemote) { - /* - * dealDamage(world,x,y,z, 30); detonateTestBomb(world,x,y,z, 30); - * vapor(world,x,y,z, 30); dealDamage(world,x,y,z, 60); - * detonateTestBomb(world,x,y,z, 60); vapor(world,x,y,z, 60); - * dealDamage(world,x,y,z, 90); detonateTestBomb(world,x,y,z, 90); - * vapor(world,x,y,z, 90); dealDamage(world,x,y,z, 120); - * detonateTestBomb(world,x,y,z, 120); vapor(world,x,y,z, 120); - */ + tetn.clearSlots(); - // world.spawnParticle("hugeexplosion", x, y, z, 0, 0, 0); //spawns - // a huge explosion particle - world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); // x,y,z,sound,volume,pitch - /* - * ExplosionNukeGeneric.detonateTestBomb(world, x, y, z, 150); - * ExplosionNukeGeneric.vapor(world, x, y, z, 170); - * ExplosionNukeGeneric.waste(world, x, y, z, 225); - * ExplosionNukeGeneric.dealDamage(world, x, y, z, 170); - */ + world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); - /* - * EntityNukeExplosion entity = new EntityNukeExplosion(world); - * entity.posX = x; entity.posY = y; entity.posZ = z; - * entity.destructionRange = 150; entity.vaporRange = 200; - * entity.wasteRange = 225; entity.damageRange = 170; - * - * world.spawnEntityInWorld(entity); - */ - - world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, MainRegistry.gadgetRadius, x + 0.5, y + 0.5, z + 0.5)); - - // ExplosionNukeAdvanced.mush(world, x, y, z); - - if (MainRegistry.enableNukeClouds) { - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, MainRegistry.gadgetRadius * 0.005F); + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.gadgetRadius, x + 0.5, y + 0.5, z + 0.5)); + + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.gadgetRadius * 0.005F); entity2.posX = x; entity2.posY = y; entity2.posZ = z; world.spawnEntityInWorld(entity2); - } else { - EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 1000); - entity2.posX = x; - entity2.posY = y - 15; - entity2.posZ = z; - world.spawnEntityInWorld(entity2); - } } return false; } - /* - * public void detonateTestBomb(World world, int x, int y, int z, int - * bombStartStrength) { //Rodol's awesome destruction code int r = - * bombStartStrength; //radius of explosion (change this to bigger numbers - * for more epicness) int r2 = r*r; //radius^2, for faster distance checks. - * (No sqrt needed for pythagoras) int r22 = r2/2; //half of r^2, - * calculations outside the loop only get called once. Always pull out as - * many things from the loop as possible. for (int xx = -r; xx < r; xx++) { - * int X = xx+x; //x coordinate we are working on int XX = xx*xx; //more - * stuff for a faster distance check for (int yy = -r; yy < r; yy++) { int Y - * = yy+y; //y coord int YY = XX+yy*yy; for (int zz = -r; zz < r; zz++) { - * int Z = zz+z; //z coord int ZZ = YY+zz*zz; //final= x*x+y*y+z*z. remind - * you of anything? if (ZZ= y) destruction(world, X, Y, Z); //destroy - * the block if its within the radius ...and if it's not bedrock :D } //you - * can change the if statement to if (ZZ= y) destruction(world, X, Y, Z); //destroy the block if its within the radius ...and if it's not bedrock :D - } //you can change the if statement to if (ZZ 0 && getScale() > 150) { + if(RadiationConfig.rain > 0 && getScale() > 150) { worldObj.getWorldInfo().setRaining(true); worldObj.getWorldInfo().setThundering(true); - worldObj.getWorldInfo().setRainTime(MainRegistry.rain); - worldObj.getWorldInfo().setThunderTime(MainRegistry.rain); - AuxSavedData.setThunder(worldObj, MainRegistry.rain); + worldObj.getWorldInfo().setRainTime(RadiationConfig.rain); + worldObj.getWorldInfo().setThunderTime(RadiationConfig.rain); + AuxSavedData.setThunder(worldObj, RadiationConfig.rain); } } } diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeASchrab.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeASchrab.java index 4e15b044a..7a171ca0c 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeASchrab.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeASchrab.java @@ -1,14 +1,13 @@ package com.hbm.entity.grenade; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityCloudFleija; import com.hbm.entity.logic.EntityNukeExplosionMK3; -import com.hbm.main.MainRegistry; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; public class EntityGrenadeASchrab extends EntityGrenadeBase { - private static final String __OBFID = "CL_00001722"; public EntityGrenadeASchrab(World p_i1773_1_) { super(p_i1773_1_); @@ -33,14 +32,14 @@ public class EntityGrenadeASchrab extends EntityGrenadeBase { entity.posX = this.posX; entity.posY = this.posY; entity.posZ = this.posZ; - entity.destructionRange = MainRegistry.aSchrabRadius; + entity.destructionRange = BombConfig.aSchrabRadius; entity.speed = 25; entity.coefficient = 1.0F; entity.waste = false; this.worldObj.spawnEntityInWorld(entity); - EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, MainRegistry.aSchrabRadius); + EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius); cloud.posX = this.posX; cloud.posY = this.posY; cloud.posZ = this.posZ; diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeBase.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeBase.java index bc5ee9d62..0935cb8aa 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeBase.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeBase.java @@ -2,6 +2,7 @@ package com.hbm.entity.grenade; import org.apache.logging.log4j.Level; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import net.minecraft.entity.EntityLivingBase; @@ -11,9 +12,7 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -public abstract class EntityGrenadeBase extends EntityThrowable -{ - private static final String __OBFID = "CL_00001722"; +public abstract class EntityGrenadeBase extends EntityThrowable { public EntityGrenadeBase(World p_i1773_1_) { @@ -41,7 +40,7 @@ public abstract class EntityGrenadeBase extends EntityThrowable } if(!worldObj.isRemote) { - if(MainRegistry.enableExtendedLogging) { + if(GeneralConfig.enableExtendedLogging) { String s = "null"; diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeBouncyBase.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeBouncyBase.java index e314b6658..14658856d 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeBouncyBase.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeBouncyBase.java @@ -2,6 +2,7 @@ package com.hbm.entity.grenade; import org.apache.logging.log4j.Level; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import cpw.mods.fml.relauncher.Side; @@ -214,7 +215,7 @@ public abstract class EntityGrenadeBouncyBase extends Entity implements IProject if(thrower != null && thrower instanceof EntityPlayer) s = ((EntityPlayer)thrower).getDisplayName(); - if(MainRegistry.enableExtendedLogging) + if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[GREN] Set off grenade at " + ((int)posX) + " / " + ((int)posY) + " / " + ((int)posZ) + " by " + s + "!"); } } diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeMk2.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeMk2.java index df7692cd0..11b43d077 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeMk2.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeMk2.java @@ -9,26 +9,23 @@ import net.minecraft.world.World; public class EntityGrenadeMk2 extends EntityGrenadeBouncyBase { - private static final String __OBFID = "CL_00001722"; public EntityGrenadeMk2(World p_i1773_1_) { super(p_i1773_1_); } - public EntityGrenadeMk2(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeMk2(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeMk2(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeMk2(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } @Override public void explode() { - if (!this.worldObj.isRemote) { + if(!this.worldObj.isRemote) { this.setDead(); ExplosionLarge.explode(worldObj, posX, posY, posZ, 7.5F, true, false, false); } diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuclear.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuclear.java index c7ba6683e..76088b0a7 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuclear.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuclear.java @@ -1,57 +1,43 @@ package com.hbm.entity.grenade; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionParticle; import com.hbm.explosion.ExplosionParticleB; import com.hbm.items.ModItems; import com.hbm.items.weapon.ItemGrenade; -import com.hbm.main.MainRegistry; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadeNuclear extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; +public class EntityGrenadeNuclear extends EntityGrenadeBouncyBase { - public EntityGrenadeNuclear(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadeNuclear(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadeNuclear(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeNuclear(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeNuclear(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeNuclear(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - this.setDead(); - /*EntityNukeExplosionMK3 entity0 = new EntityNukeExplosionMK3(this.worldObj); - entity0.posX = this.posX; - entity0.posY = this.posY; - entity0.posZ = this.posZ; - entity0.destructionRange = MainRegistry.nukaRadius; - entity0.speed = 25; - entity0.coefficient = 10.0F;*/ - - this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.nukaRadius, posX, posY, posZ)); - if(rand.nextInt(100) == 0) - { - ExplosionParticleB.spawnMush(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ); - } else { - ExplosionParticle.spawnMush(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ); - } - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + + this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.nukaRadius, posX, posY, posZ)); + if(rand.nextInt(100) == 0) { + ExplosionParticleB.spawnMush(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ); + } else { + ExplosionParticle.spawnMush(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ); + } + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuke.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuke.java index 6d673ad64..cb727736e 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuke.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeNuke.java @@ -3,34 +3,28 @@ package com.hbm.entity.grenade; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadeNuke extends EntityGrenadeBase -{ - private static final String __OBFID = "CL_00001722"; - public int count = 2; +public class EntityGrenadeNuke extends EntityGrenadeBase { + public int count = 2; - public EntityGrenadeNuke(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadeNuke(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadeNuke(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeNuke(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeNuke(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeNuke(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - //this.setDead(); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 30F, true); - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + // this.setDead(); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 30F, true); + } + } } diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadePlasma.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadePlasma.java index ecf073b85..80e1f99df 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadePlasma.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadePlasma.java @@ -7,35 +7,29 @@ import com.hbm.items.weapon.ItemGrenade; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadePlasma extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; +public class EntityGrenadePlasma extends EntityGrenadeBouncyBase { - public EntityGrenadePlasma(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadePlasma(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadePlasma(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadePlasma(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadePlasma(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadePlasma(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - this.setDead(); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); - ExplosionChaos.plasma(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 7 ); - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); + ExplosionChaos.plasma(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, 7); + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadePoison.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadePoison.java index 90591edd6..868ff4205 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadePoison.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadePoison.java @@ -7,36 +7,29 @@ import com.hbm.items.weapon.ItemGrenade; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadePoison extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; +public class EntityGrenadePoison extends EntityGrenadeBouncyBase { - public EntityGrenadePoison(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadePoison(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadePoison(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadePoison(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadePoison(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadePoison(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - + @Override + public void explode() { - if (!this.worldObj.isRemote) - { - this.setDead(); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); - ExplosionNukeGeneric.wasteNoSchrab(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 10); - } - } + if(!this.worldObj.isRemote) { + this.setDead(); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); + ExplosionNukeGeneric.wasteNoSchrab(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, 10); + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeSchrabidium.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeSchrabidium.java index d25cd173e..4796fc4c0 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeSchrabidium.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeSchrabidium.java @@ -7,35 +7,29 @@ import com.hbm.items.weapon.ItemGrenade; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadeSchrabidium extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; +public class EntityGrenadeSchrabidium extends EntityGrenadeBouncyBase { - public EntityGrenadeSchrabidium(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadeSchrabidium(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadeSchrabidium(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeSchrabidium(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeSchrabidium(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeSchrabidium(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - this.setDead(); - ExplosionChaos.schrab(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 50, 50); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true); - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + ExplosionChaos.schrab(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, 50, 50); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true); + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeShrapnel.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeShrapnel.java index 5155be9f2..4252daaab 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeShrapnel.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeShrapnel.java @@ -8,38 +8,32 @@ import com.hbm.explosion.ExplosionLarge; import com.hbm.items.ModItems; import com.hbm.items.weapon.ItemGrenade; -public class EntityGrenadeShrapnel extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; - public Entity shooter; +public class EntityGrenadeShrapnel extends EntityGrenadeBouncyBase { + public Entity shooter; - public EntityGrenadeShrapnel(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadeShrapnel(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadeShrapnel(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeShrapnel(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeShrapnel(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeShrapnel(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - this.setDead(); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); - for(int i = 0; i < 5; i++) { - ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 5); - } - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); + for(int i = 0; i < 5; i++) { + ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 5); + } + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeStrong.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeStrong.java index e57cd946f..f0d8c2a28 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeStrong.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeStrong.java @@ -7,34 +7,28 @@ import com.hbm.items.weapon.ItemGrenade; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadeStrong extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; +public class EntityGrenadeStrong extends EntityGrenadeBouncyBase { - public EntityGrenadeStrong(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadeStrong(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadeStrong(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeStrong(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeStrong(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeStrong(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - this.setDead(); - ExplosionLarge.explode(worldObj, posX, posY, posZ, 5.0F, true, false, false); - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + ExplosionLarge.explode(worldObj, posX, posY, posZ, 5.0F, true, false, false); + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeTau.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeTau.java index 147ce4282..a77fa4bbf 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeTau.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeTau.java @@ -7,35 +7,29 @@ import com.hbm.items.weapon.ItemGrenade; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadeTau extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; +public class EntityGrenadeTau extends EntityGrenadeBouncyBase { - public EntityGrenadeTau(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadeTau(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadeTau(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeTau(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeTau(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeTau(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - this.setDead(); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); - ExplosionChaos.tauMeSinPi(this.worldObj, this.posX, this.posY, this.posZ, 100, this.getThrower(), this); - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true); + ExplosionChaos.tauMeSinPi(this.worldObj, this.posX, this.posY, this.posZ, 100, this.getThrower(), this); + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeZOMG.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeZOMG.java index ed163b629..1ae084126 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeZOMG.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeZOMG.java @@ -7,34 +7,28 @@ import com.hbm.items.weapon.ItemGrenade; import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; -public class EntityGrenadeZOMG extends EntityGrenadeBouncyBase -{ - private static final String __OBFID = "CL_00001722"; +public class EntityGrenadeZOMG extends EntityGrenadeBouncyBase { - public EntityGrenadeZOMG(World p_i1773_1_) - { - super(p_i1773_1_); - } + public EntityGrenadeZOMG(World p_i1773_1_) { + super(p_i1773_1_); + } - public EntityGrenadeZOMG(World p_i1774_1_, EntityLivingBase p_i1774_2_) - { - super(p_i1774_1_, p_i1774_2_); - } + public EntityGrenadeZOMG(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } - public EntityGrenadeZOMG(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) - { - super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); - } + public EntityGrenadeZOMG(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } - @Override - public void explode() { - - if (!this.worldObj.isRemote) - { - this.setDead(); - ExplosionChaos.zomgMeSinPi(this.worldObj, this.posX, this.posY, this.posZ, 20, this.getThrower(), this); - } - } + @Override + public void explode() { + + if(!this.worldObj.isRemote) { + this.setDead(); + ExplosionChaos.zomgMeSinPi(this.worldObj, this.posX, this.posY, this.posZ, 20, this.getThrower(), this); + } + } @Override protected int getMaxTimer() { diff --git a/src/main/java/com/hbm/entity/logic/EntityBalefire.java b/src/main/java/com/hbm/entity/logic/EntityBalefire.java index be64dc969..d37579a82 100644 --- a/src/main/java/com/hbm/entity/logic/EntityBalefire.java +++ b/src/main/java/com/hbm/entity/logic/EntityBalefire.java @@ -2,6 +2,7 @@ package com.hbm.entity.logic; import org.apache.logging.log4j.Level; +import com.hbm.config.GeneralConfig; import com.hbm.explosion.ExplosionBalefire; import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.main.MainRegistry; @@ -55,7 +56,7 @@ public class EntityBalefire extends Entity { if(!this.did) { - if(MainRegistry.enableExtendedLogging && !worldObj.isRemote) + if(GeneralConfig.enableExtendedLogging && !worldObj.isRemote) MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized BF explosion at " + posX + " / " + posY + " / " + posZ + " with strength " + destructionRange + "!"); exp = new ExplosionBalefire((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, this.destructionRange); diff --git a/src/main/java/com/hbm/entity/logic/EntityBomber.java b/src/main/java/com/hbm/entity/logic/EntityBomber.java index 8d8bb9fdf..1a02f2fc6 100644 --- a/src/main/java/com/hbm/entity/logic/EntityBomber.java +++ b/src/main/java/com/hbm/entity/logic/EntityBomber.java @@ -3,6 +3,7 @@ package com.hbm.entity.logic; import java.util.ArrayList; import java.util.List; +import com.hbm.config.GeneralConfig; import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.entity.projectile.EntityBombletZeta; import com.hbm.entity.projectile.EntityBoxcar; @@ -209,8 +210,8 @@ public class EntityBomber extends Entity implements IChunkLoader { Vec3 vector = Vec3.createVectorHelper(world.rand.nextDouble() - 0.5, 0, world.rand.nextDouble() - 0.5); vector = vector.normalize(); - vector.xCoord *= MainRegistry.enableBomberShortMode ? 1 : 2; - vector.zCoord *= MainRegistry.enableBomberShortMode ? 1 : 2; + vector.xCoord *= GeneralConfig.enableBomberShortMode ? 1 : 2; + vector.zCoord *= GeneralConfig.enableBomberShortMode ? 1 : 2; this.setLocationAndAngles(x - vector.xCoord * 100, y + 50, z - vector.zCoord * 100, 0.0F, 0.0F); this.loadNeighboringChunks((int)(x / 16), (int)(z / 16)); @@ -512,5 +513,4 @@ public class EntityBomber extends Entity implements IChunkLoader { } } } - } diff --git a/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK3.java b/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK3.java index 699a90417..ad208a71e 100644 --- a/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK3.java +++ b/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK3.java @@ -2,6 +2,8 @@ package com.hbm.entity.logic; import org.apache.logging.log4j.Level; +import com.hbm.config.BombConfig; +import com.hbm.config.GeneralConfig; import com.hbm.entity.effect.EntityFalloutRain; import com.hbm.explosion.ExplosionFleija; import com.hbm.explosion.ExplosionHurtUtil; @@ -48,7 +50,7 @@ public class EntityNukeExplosionMK3 extends Entity { long time = nbt.getLong("milliTime"); - if(MainRegistry.limitExplosionLifespan > 0 && System.currentTimeMillis() - time > MainRegistry.limitExplosionLifespan * 1000) + if(BombConfig.limitExplosionLifespan > 0 && System.currentTimeMillis() - time > BombConfig.limitExplosionLifespan * 1000) this.setDead(); if(this.waste) @@ -112,7 +114,7 @@ public class EntityNukeExplosionMK3 extends Entity { if(!this.did) { - if(MainRegistry.enableExtendedLogging && !worldObj.isRemote) + if(GeneralConfig.enableExtendedLogging && !worldObj.isRemote) MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized mk3 explosion at " + posX + " / " + posY + " / " + posZ + " with strength " + destructionRange + "!"); if(this.waste) diff --git a/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK4.java b/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK4.java index b484c682d..441076ca6 100644 --- a/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK4.java +++ b/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK4.java @@ -2,6 +2,8 @@ package com.hbm.entity.logic; import org.apache.logging.log4j.Level; +import com.hbm.config.BombConfig; +import com.hbm.config.GeneralConfig; import com.hbm.entity.effect.EntityFalloutRain; import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionNukeRay; @@ -84,7 +86,7 @@ public class EntityNukeExplosionMK4 extends Entity { } else if(explosion.getStoredSize() > 0) { //if(!worldObj.isRemote) //MainRegistry.logger.info(explosion.getProgress() + " / " + count / length); - explosion.processTip(MainRegistry.mk4); + explosion.processTip(BombConfig.mk4); } else if(fallout) { //MainRegistry.logger.info("STOP: " + System.currentTimeMillis()); @@ -93,7 +95,7 @@ public class EntityNukeExplosionMK4 extends Entity { fallout.posX = this.posX; fallout.posY = this.posY; fallout.posZ = this.posZ; - fallout.setScale((int)(this.length * 1.8 + falloutAdd) * MainRegistry.falloutRange / 100); + fallout.setScale((int)(this.length * 1.8 + falloutAdd) * BombConfig.falloutRange / 100); this.worldObj.spawnEntityInWorld(fallout); @@ -126,7 +128,7 @@ public class EntityNukeExplosionMK4 extends Entity { public static EntityNukeExplosionMK4 statFac(World world, int r, double x, double y, double z) { - if(MainRegistry.enableExtendedLogging && !world.isRemote) + if(GeneralConfig.enableExtendedLogging && !world.isRemote) MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized explosion at " + x + " / " + y + " / " + z + " with strength " + r + "!"); if(r == 0) @@ -145,7 +147,7 @@ public class EntityNukeExplosionMK4 extends Entity { public static EntityNukeExplosionMK4 statFacExperimental(World world, int r, double x, double y, double z) { - if(MainRegistry.enableExtendedLogging && !world.isRemote) + if(GeneralConfig.enableExtendedLogging && !world.isRemote) MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized eX explosion at " + x + " / " + y + " / " + z + " with strength " + r + "!"); r *= 2; @@ -161,7 +163,7 @@ public class EntityNukeExplosionMK4 extends Entity { public static EntityNukeExplosionMK4 statFacNoRad(World world, int r, double x, double y, double z) { - if(MainRegistry.enableExtendedLogging && !world.isRemote) + if(GeneralConfig.enableExtendedLogging && !world.isRemote) MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized nR explosion at " + x + " / " + y + " / " + z + " with strength " + r + "!"); r *= 2; diff --git a/src/main/java/com/hbm/entity/logic/EntityTomBlast.java b/src/main/java/com/hbm/entity/logic/EntityTomBlast.java index 990b84d42..1f4e31b87 100644 --- a/src/main/java/com/hbm/entity/logic/EntityTomBlast.java +++ b/src/main/java/com/hbm/entity/logic/EntityTomBlast.java @@ -2,6 +2,7 @@ package com.hbm.entity.logic; import org.apache.logging.log4j.Level; +import com.hbm.config.GeneralConfig; import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionTom; import com.hbm.main.MainRegistry; @@ -11,7 +12,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; public class EntityTomBlast extends Entity { - + public int age = 0; public int destructionRange = 0; public ExplosionTom exp; @@ -24,12 +25,12 @@ public class EntityTomBlast extends Entity { destructionRange = nbt.getInteger("destructionRange"); speed = nbt.getInteger("speed"); did = nbt.getBoolean("did"); - - exp = new ExplosionTom((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, this.destructionRange); + + exp = new ExplosionTom((int) this.posX, (int) this.posY, (int) this.posZ, this.worldObj, this.destructionRange); exp.readFromNbt(nbt, "exp_"); - - this.did = true; - + + this.did = true; + } @Override @@ -38,54 +39,53 @@ public class EntityTomBlast extends Entity { nbt.setInteger("destructionRange", destructionRange); nbt.setInteger("speed", speed); nbt.setBoolean("did", did); - + if(exp != null) exp.saveToNbt(nbt, "exp_"); - + } public EntityTomBlast(World p_i1582_1_) { super(p_i1582_1_); } - @Override + @Override public void onUpdate() { - super.onUpdate(); - - if(!this.did) - { - if(MainRegistry.enableExtendedLogging && !worldObj.isRemote) - MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized TOM explosion at " + posX + " / " + posY + " / " + posZ + " with strength " + destructionRange + "!"); - - exp = new ExplosionTom((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, this.destructionRange); - - this.did = true; - } - - speed += 1; //increase speed to keep up with expansion - - boolean flag = false; - for(int i = 0; i < this.speed; i++) - { - flag = exp.update(); - - if(flag) { - this.setDead(); - } - } - - if(rand.nextInt(5) == 0) - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); - - if(!flag) - { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); - ExplosionNukeGeneric.dealDamage(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, this.destructionRange * 2); - } - - age++; - } + super.onUpdate(); + + if(!this.did) { + + if(GeneralConfig.enableExtendedLogging && !worldObj.isRemote) + MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized TOM explosion at " + posX + " / " + posY + " / " + posZ + " with strength " + destructionRange + "!"); + + exp = new ExplosionTom((int) this.posX, (int) this.posY, (int) this.posZ, this.worldObj, this.destructionRange); + + this.did = true; + } + + speed += 1; // increase speed to keep up with expansion + + boolean flag = false; + for(int i = 0; i < this.speed; i++) { + flag = exp.update(); + + if(flag) { + this.setDead(); + } + } + + if(rand.nextInt(5) == 0) + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); + + if(!flag) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); + ExplosionNukeGeneric.dealDamage(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, this.destructionRange * 2); + } + + age++; + } @Override - protected void entityInit() { } + protected void entityInit() { + } } diff --git a/src/main/java/com/hbm/entity/missile/EntityMIRV.java b/src/main/java/com/hbm/entity/missile/EntityMIRV.java index 55f98c9d8..15d285022 100644 --- a/src/main/java/com/hbm/entity/missile/EntityMIRV.java +++ b/src/main/java/com/hbm/entity/missile/EntityMIRV.java @@ -1,9 +1,9 @@ package com.hbm.entity.missile; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.entity.particle.EntitySmokeFX; -import com.hbm.main.MainRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -19,74 +19,67 @@ public class EntityMIRV extends EntityThrowable { super(p_i1582_1_); this.ignoreFrustumCheck = true; } - + @Override public void onUpdate() { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; - + this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; - + this.motionY -= 0.03; - - this.rotation(); - - if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air) - { - if(!this.worldObj.isRemote) - { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.mirvRadius, posX, posY, posZ)); - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(this.worldObj, 1000, MainRegistry.mirvRadius * 0.005F); - entity2.posX = this.posX; - entity2.posY = this.posY; - entity2.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(entity2); - } - this.setDead(); - } - - this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0)); + this.rotation(); + + if(this.worldObj.getBlock((int) this.posX, (int) this.posY, (int) this.posZ) != Blocks.air) { + if(!this.worldObj.isRemote) { + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.mirvRadius, posX, posY, posZ)); + + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(this.worldObj, 1000, BombConfig.mirvRadius * 0.005F); + entity2.posX = this.posX; + entity2.posY = this.posY; + entity2.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(entity2); + } + this.setDead(); + } + + this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0)); } - + protected void rotation() { - float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } + for(this.rotationPitch = (float) (Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } + while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } + while(this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } + while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } } @Override protected void onImpact(MovingObjectPosition p_70184_1_) { - + } - - @Override + + @Override @SideOnly(Side.CLIENT) - public boolean isInRangeToRenderDist(double distance) - { - return distance < 500000; - } + public boolean isInRangeToRenderDist(double distance) { + return distance < 500000; + } } diff --git a/src/main/java/com/hbm/entity/missile/EntityMissileCustom.java b/src/main/java/com/hbm/entity/missile/EntityMissileCustom.java index 95ba49710..12cdf38b2 100644 --- a/src/main/java/com/hbm/entity/missile/EntityMissileCustom.java +++ b/src/main/java/com/hbm/entity/missile/EntityMissileCustom.java @@ -14,8 +14,11 @@ import com.hbm.explosion.ExplosionLarge; import com.hbm.handler.MissileStruct; import com.hbm.items.weapon.ItemMissile; import com.hbm.items.weapon.ItemMissile.FuelType; +import com.hbm.items.weapon.ItemMissile.PartSize; import com.hbm.items.weapon.ItemMissile.WarheadType; import com.hbm.main.MainRegistry; + +import api.hbm.entity.IRadarDetectable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; @@ -31,7 +34,7 @@ import net.minecraftforge.common.ForgeChunkManager; import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.ForgeChunkManager.Type; -public class EntityMissileCustom extends Entity implements IChunkLoader { +public class EntityMissileCustom extends Entity implements IChunkLoader, IRadarDetectable { int startX; int startZ; @@ -426,4 +429,26 @@ public class EntityMissileCustom extends Entity implements IChunkLoader { } } } + + @Override + public RadarTargetType getTargetType() { + + ItemMissile part = (ItemMissile) Item.getItemById(this.dataWatcher.getWatchableObjectInt(10)); + + PartSize top = part.top; + PartSize bottom = part.bottom; + + if(top == PartSize.SIZE_10 && bottom == PartSize.SIZE_10) + return RadarTargetType.MISSILE_10; + if(top == PartSize.SIZE_10 && bottom == PartSize.SIZE_15) + return RadarTargetType.MISSILE_10_15; + if(top == PartSize.SIZE_15 && bottom == PartSize.SIZE_15) + return RadarTargetType.MISSILE_15; + if(top == PartSize.SIZE_15 && bottom == PartSize.SIZE_20) + return RadarTargetType.MISSILE_15_20; + if(top == PartSize.SIZE_20 && bottom == PartSize.SIZE_20) + return RadarTargetType.MISSILE_20; + + return RadarTargetType.PLAYER; + } } diff --git a/src/main/java/com/hbm/entity/missile/EntityMissileMicro.java b/src/main/java/com/hbm/entity/missile/EntityMissileMicro.java index 01ab31d1e..d2ac437bb 100644 --- a/src/main/java/com/hbm/entity/missile/EntityMissileMicro.java +++ b/src/main/java/com/hbm/entity/missile/EntityMissileMicro.java @@ -3,13 +3,13 @@ package com.hbm.entity.missile; import java.util.ArrayList; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionParticle; import com.hbm.explosion.ExplosionParticleB; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; -import api.hbm.entity.IRadarDetectable.RadarTargetType; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -25,33 +25,22 @@ public class EntityMissileMicro extends EntityMissileBaseAdvanced { @Override public void onImpact() { - if (!this.worldObj.isRemote) - { - /*EntityNukeExplosionMK3 entity0 = new EntityNukeExplosionMK3(this.worldObj); - entity0.posX = this.posX; - entity0.posY = this.posY; - entity0.posZ = this.posZ; - entity0.destructionRange = MainRegistry.fatmanRadius; - entity0.speed = MainRegistry.blastSpeed; - entity0.coefficient = 10.0F;*/ - - this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.fatmanRadius, posX, posY, posZ)); - - if(MainRegistry.polaroidID == 11) - if(rand.nextInt(100) >= 0) - { - ExplosionParticleB.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } else { - ExplosionParticle.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } - else - if(rand.nextInt(100) == 0) - { - ExplosionParticleB.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } else { - ExplosionParticle.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } - } + if(!this.worldObj.isRemote) { + + this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.fatmanRadius, posX, posY, posZ)); + + if(MainRegistry.polaroidID == 11) + if(rand.nextInt(100) >= 0) { + ExplosionParticleB.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } else { + ExplosionParticle.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } + else if(rand.nextInt(100) == 0) { + ExplosionParticleB.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } else { + ExplosionParticle.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } + } } @Override @@ -63,7 +52,7 @@ public class EntityMissileMicro extends EntityMissileBaseAdvanced { list.add(new ItemStack(ModItems.hull_small_aluminium, 2)); list.add(new ItemStack(ModItems.ducttape, 1)); list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1)); - + return list; } diff --git a/src/main/java/com/hbm/entity/missile/EntityMissileMirv.java b/src/main/java/com/hbm/entity/missile/EntityMissileMirv.java index 7aac58b7d..9fe8ce685 100644 --- a/src/main/java/com/hbm/entity/missile/EntityMissileMirv.java +++ b/src/main/java/com/hbm/entity/missile/EntityMissileMirv.java @@ -3,12 +3,11 @@ package com.hbm.entity.missile; import java.util.ArrayList; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.items.ModItems; -import com.hbm.main.MainRegistry; -import api.hbm.entity.IRadarDetectable.RadarTargetType; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -25,9 +24,9 @@ public class EntityMissileMirv extends EntityMissileBaseAdvanced { @Override public void onImpact() { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.missileRadius * 2, posX, posY, posZ)); + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.missileRadius * 2, posX, posY, posZ)); - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(this.worldObj, 1000, MainRegistry.missileRadius * 2 * 0.005F); + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(this.worldObj, 1000, BombConfig.missileRadius * 2 * 0.005F); entity2.posX = this.posX; entity2.posY = this.posY - 9; entity2.posZ = this.posZ; diff --git a/src/main/java/com/hbm/entity/missile/EntityMissileNuclear.java b/src/main/java/com/hbm/entity/missile/EntityMissileNuclear.java index 37c6e67bb..cd492d646 100644 --- a/src/main/java/com/hbm/entity/missile/EntityMissileNuclear.java +++ b/src/main/java/com/hbm/entity/missile/EntityMissileNuclear.java @@ -3,12 +3,11 @@ package com.hbm.entity.missile; import java.util.ArrayList; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.items.ModItems; -import com.hbm.main.MainRegistry; -import api.hbm.entity.IRadarDetectable.RadarTargetType; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -24,21 +23,14 @@ public class EntityMissileNuclear extends EntityMissileBaseAdvanced { @Override public void onImpact() { - /*EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(this.worldObj); - entity.posX = this.posX; - entity.posY = this.posY; - entity.posZ = this.posZ; - entity.destructionRange = MainRegistry.missileRadius; - entity.speed = MainRegistry.blastSpeed; - entity.coefficient = 10.0F;*/ - - this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.missileRadius, posX, posY, posZ)); - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(this.worldObj, 1000, MainRegistry.missileRadius * 0.005F); - entity2.posX = this.posX; - entity2.posY = this.posY/* - 9*/; - entity2.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(entity2); + this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.missileRadius, posX, posY, posZ)); + + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(this.worldObj, 1000, BombConfig.missileRadius * 0.005F); + entity2.posX = this.posX; + entity2.posY = this.posY; + entity2.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(entity2); } @Override @@ -50,7 +42,7 @@ public class EntityMissileNuclear extends EntityMissileBaseAdvanced { list.add(new ItemStack(ModItems.plate_aluminium, 12)); list.add(new ItemStack(ModItems.thruster_large, 1)); list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1)); - + return list; } diff --git a/src/main/java/com/hbm/entity/missile/EntityMissileSchrabidium.java b/src/main/java/com/hbm/entity/missile/EntityMissileSchrabidium.java index 3d32c7f7d..ea70c1adc 100644 --- a/src/main/java/com/hbm/entity/missile/EntityMissileSchrabidium.java +++ b/src/main/java/com/hbm/entity/missile/EntityMissileSchrabidium.java @@ -3,12 +3,11 @@ package com.hbm.entity.missile; import java.util.ArrayList; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityCloudFleija; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.items.ModItems; -import com.hbm.main.MainRegistry; -import api.hbm.entity.IRadarDetectable.RadarTargetType; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -24,25 +23,24 @@ public class EntityMissileSchrabidium extends EntityMissileBaseAdvanced { @Override public void onImpact() { - if (!this.worldObj.isRemote) - { + if(!this.worldObj.isRemote) { EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(this.worldObj); entity.posX = this.posX; entity.posY = this.posY; entity.posZ = this.posZ; - entity.destructionRange = MainRegistry.aSchrabRadius; + entity.destructionRange = BombConfig.aSchrabRadius; entity.speed = 25; entity.coefficient = 1.0F; entity.waste = false; this.worldObj.spawnEntityInWorld(entity); - EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, MainRegistry.aSchrabRadius); + EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius); cloud.posX = this.posX; cloud.posY = this.posY; cloud.posZ = this.posZ; this.worldObj.spawnEntityInWorld(cloud); - } + } } @Override @@ -54,7 +52,7 @@ public class EntityMissileSchrabidium extends EntityMissileBaseAdvanced { list.add(new ItemStack(ModItems.hull_small_aluminium, 2)); list.add(new ItemStack(ModItems.ducttape, 1)); list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1)); - + return list; } diff --git a/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java b/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java index 780ce3c7d..3a5aad368 100644 --- a/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java +++ b/src/main/java/com/hbm/entity/mob/EntityHunterChopper.java @@ -22,12 +22,12 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisplayData { + public int courseChangeCooldown; public double waypointX; public double waypointY; public double waypointZ; private Entity targetedEntity; - private int aggroCooldown; public int prevAttackCounter; public int attackCounter; public int mineDropCounter; @@ -151,10 +151,6 @@ public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisp // this.worldObj.getClosestVulnerablePlayerToEntity(this, // 100.0D); this.targetedEntity = Library.getClosestEntityForChopper(worldObj, this.posX, this.posY, this.posZ, 250); - - if (this.targetedEntity != null) { - this.aggroCooldown = 20; - } } double d4 = 64.0D; diff --git a/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java b/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java index 108d2f1f7..3b8a4a699 100644 --- a/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java +++ b/src/main/java/com/hbm/entity/mob/EntityTaintedCreeper.java @@ -1,8 +1,8 @@ package com.hbm.entity.mob; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.entity.mob.ai.EntityAITaintedCreeperSwell; -import com.hbm.main.MainRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -29,352 +29,257 @@ import net.minecraft.util.DamageSource; import net.minecraft.world.World; public class EntityTaintedCreeper extends EntityMob { - /** - * Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go - * weird) - */ - private int lastActiveTime; - /** The amount of time since the creeper was close enough to the player to ignite */ - private int timeSinceIgnited; - private int fuseTime = 30; - /** Explosion radius for this creeper. */ - private int explosionRadius = 20; - private static final String __OBFID = "CL_00001684"; - public EntityTaintedCreeper(World p_i1733_1_) - { - super(p_i1733_1_); - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAITaintedCreeperSwell(this)); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false)); - this.tasks.addTask(4, new EntityAIWander(this, 0.8D)); - this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - this.tasks.addTask(6, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); - this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); - this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityOcelot.class, 0, true)); - } + private int lastActiveTime; + private int timeSinceIgnited; + private int fuseTime = 30; + private int explosionRadius = 20; - @Override - protected void applyEntityAttributes() - { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); - } + public EntityTaintedCreeper(World p_i1733_1_) { + super(p_i1733_1_); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAITaintedCreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false)); + this.tasks.addTask(4, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityOcelot.class, 0, true)); + } - /** - * Returns true if the newer Entity AI code should be run - */ - @Override - public boolean isAIEnabled() - { - return true; - } + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); + } - /** - * The number of iterations PathFinder.getSafePoint will execute before giving up. - */ - @Override - public int getMaxSafePointTries() - { - return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F); - } + @Override + public boolean isAIEnabled() { + return true; + } - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float p_70069_1_) - { - super.fall(p_70069_1_); - this.timeSinceIgnited = (int)(this.timeSinceIgnited + p_70069_1_ * 1.5F); + @Override + public int getMaxSafePointTries() { + return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F); + } - if (this.timeSinceIgnited > this.fuseTime - 5) - { - this.timeSinceIgnited = this.fuseTime - 5; - } - } + @Override + protected void fall(float p_70069_1_) { + super.fall(p_70069_1_); + this.timeSinceIgnited = (int) (this.timeSinceIgnited + p_70069_1_ * 1.5F); - @Override - protected void entityInit() - { - super.entityInit(); - this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1)); - this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); - this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); - } + if(this.timeSinceIgnited > this.fuseTime - 5) { + this.timeSinceIgnited = this.fuseTime - 5; + } + } - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound p_70014_1_) - { - super.writeEntityToNBT(p_70014_1_); + @Override + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) -1)); + this.dataWatcher.addObject(17, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(18, Byte.valueOf((byte) 0)); + } - if (this.dataWatcher.getWatchableObjectByte(17) == 1) - { - p_70014_1_.setBoolean("powered", true); - } + @Override + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); - p_70014_1_.setShort("Fuse", (short)this.fuseTime); - p_70014_1_.setByte("ExplosionRadius", (byte)this.explosionRadius); - p_70014_1_.setBoolean("ignited", this.func_146078_ca()); - } + if(this.dataWatcher.getWatchableObjectByte(17) == 1) { + p_70014_1_.setBoolean("powered", true); + } - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound p_70037_1_) - { - super.readEntityFromNBT(p_70037_1_); - this.dataWatcher.updateObject(17, Byte.valueOf((byte)(p_70037_1_.getBoolean("powered") ? 1 : 0))); + p_70014_1_.setShort("Fuse", (short) this.fuseTime); + p_70014_1_.setByte("ExplosionRadius", (byte) this.explosionRadius); + p_70014_1_.setBoolean("ignited", this.func_146078_ca()); + } - if (p_70037_1_.hasKey("Fuse", 99)) - { - this.fuseTime = p_70037_1_.getShort("Fuse"); - } + @Override + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.dataWatcher.updateObject(17, Byte.valueOf((byte) (p_70037_1_.getBoolean("powered") ? 1 : 0))); - if (p_70037_1_.hasKey("ExplosionRadius", 99)) - { - this.explosionRadius = p_70037_1_.getByte("ExplosionRadius"); - } + if(p_70037_1_.hasKey("Fuse", 99)) { + this.fuseTime = p_70037_1_.getShort("Fuse"); + } - if (p_70037_1_.getBoolean("ignited")) - { - this.func_146079_cb(); - } - } + if(p_70037_1_.hasKey("ExplosionRadius", 99)) { + this.explosionRadius = p_70037_1_.getByte("ExplosionRadius"); + } - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() - { - if (this.isEntityAlive()) - { - this.lastActiveTime = this.timeSinceIgnited; + if(p_70037_1_.getBoolean("ignited")) { + this.func_146079_cb(); + } + } - if (this.func_146078_ca()) - { - this.setCreeperState(1); - } + @Override + public void onUpdate() { + if(this.isEntityAlive()) { + this.lastActiveTime = this.timeSinceIgnited; - int i = this.getCreeperState(); + if(this.func_146078_ca()) { + this.setCreeperState(1); + } - if (i > 0 && this.timeSinceIgnited == 0) - { - this.playSound("creeper.primed", 1.0F * 30 / 75, 0.5F); - } + int i = this.getCreeperState(); - this.timeSinceIgnited += i; + if(i > 0 && this.timeSinceIgnited == 0) { + this.playSound("creeper.primed", 1.0F * 30 / 75, 0.5F); + } - if (this.timeSinceIgnited < 0) - { - this.timeSinceIgnited = 0; - } + this.timeSinceIgnited += i; - if (this.timeSinceIgnited >= this.fuseTime) - { - this.timeSinceIgnited = this.fuseTime; - this.func_146077_cc(); - } - } + if(this.timeSinceIgnited < 0) { + this.timeSinceIgnited = 0; + } - super.onUpdate(); - - if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) - { - this.heal(1.0F); - } - } + if(this.timeSinceIgnited >= this.fuseTime) { + this.timeSinceIgnited = this.fuseTime; + this.func_146077_cc(); + } + } - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() - { - return "mob.creeper.say"; - } + super.onUpdate(); - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() - { - return "mob.creeper.death"; - } + if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) { + this.heal(1.0F); + } + } - /** - * Called when the mob's health reaches 0. - */ - @Override - public void onDeath(DamageSource p_70645_1_) - { - super.onDeath(p_70645_1_); - } + @Override + protected String getHurtSound() { + return "mob.creeper.say"; + } - @Override - public boolean attackEntityAsMob(Entity p_70652_1_) - { - return true; - } + @Override + protected String getDeathSound() { + return "mob.creeper.death"; + } - /** - * Returns true if the creeper is powered by a lightning bolt. - */ - public boolean getPowered() - { - return this.dataWatcher.getWatchableObjectByte(17) == 1; - } + @Override + public void onDeath(DamageSource p_70645_1_) { + super.onDeath(p_70645_1_); + } - /** - * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited. - */ - @SideOnly(Side.CLIENT) - public float getCreeperFlashIntensity(float p_70831_1_) - { - return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2); - } + @Override + public boolean attackEntityAsMob(Entity p_70652_1_) { + return true; + } - @Override - protected Item getDropItem() - { - return Item.getItemFromBlock(Blocks.tnt); - } + public boolean getPowered() { + return this.dataWatcher.getWatchableObjectByte(17) == 1; + } - /** - * Returns the current state of creeper, -1 is idle, 1 is 'in fuse' - */ - public int getCreeperState() - { - return this.dataWatcher.getWatchableObjectByte(16); - } + @SideOnly(Side.CLIENT) + public float getCreeperFlashIntensity(float p_70831_1_) { + return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2); + } - /** - * Sets the state of creeper, -1 to idle and 1 to be 'in fuse' - */ - public void setCreeperState(int p_70829_1_) - { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)p_70829_1_)); - } + @Override + protected Item getDropItem() { + return Item.getItemFromBlock(Blocks.tnt); + } - /** - * Called when a lightning bolt hits the entity. - */ - @Override - public void onStruckByLightning(EntityLightningBolt p_70077_1_) - { - super.onStruckByLightning(p_70077_1_); - this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); - } + public int getCreeperState() { + return this.dataWatcher.getWatchableObjectByte(16); + } - /** - * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. - */ - @Override - protected boolean interact(EntityPlayer p_70085_1_) - { - ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + public void setCreeperState(int p_70829_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) p_70829_1_)); + } - if (itemstack != null && itemstack.getItem() == Items.flint_and_steel) - { - this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); - p_70085_1_.swingItem(); + @Override + public void onStruckByLightning(EntityLightningBolt p_70077_1_) { + super.onStruckByLightning(p_70077_1_); + this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); + } - if (!this.worldObj.isRemote) - { - this.func_146079_cb(); - itemstack.damageItem(1, p_70085_1_); - return true; - } - } + @Override + protected boolean interact(EntityPlayer p_70085_1_) { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); - return super.interact(p_70085_1_); - } + if(itemstack != null && itemstack.getItem() == Items.flint_and_steel) { + this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + p_70085_1_.swingItem(); - private void func_146077_cc() - { - if (!this.worldObj.isRemote) - { - this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); + if(!this.worldObj.isRemote) { + this.func_146079_cb(); + itemstack.damageItem(1, p_70085_1_); + return true; + } + } - if (this.getPowered()) - { - this.explosionRadius *= 3; - } - - worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false); - - if(this.getPowered()) - { - - for(int i = 0; i < 255; i++) { - int a = rand.nextInt(15) + (int)posX - 7; - int b = rand.nextInt(15) + (int)posY - 7; - int c = rand.nextInt(15) + (int)posZ - 7; - if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) { - - if(!MainRegistry.enableHardcoreTaint) - worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2); - else - worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2); - } - } - - } else { - - for(int i = 0; i < 85; i++) { - int a = rand.nextInt(7) + (int)posX - 3; - int b = rand.nextInt(7) + (int)posY - 3; - int c = rand.nextInt(7) + (int)posZ - 3; - if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) { - - if(!MainRegistry.enableHardcoreTaint) - - worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2); - else - worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 2); - } - } - } + return super.interact(p_70085_1_); + } - this.setDead(); - } - } - - public static boolean hasPosNeightbour(World world, int x, int y, int z) { - Block b0 = world.getBlock(x + 1, y, z); - Block b1 = world.getBlock(x, y + 1, z); - Block b2 = world.getBlock(x, y, z + 1); - Block b3 = world.getBlock(x - 1, y, z); - Block b4 = world.getBlock(x, y - 1, z); - Block b5 = world.getBlock(x, y, z - 1); - boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) || - (b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) || - (b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) || - (b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) || - (b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) || - (b5.renderAsNormalBlock() && b5.getMaterial().isOpaque()); - return b; - } + private void func_146077_cc() { + if(!this.worldObj.isRemote) { + this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); - public boolean func_146078_ca() - { - return this.dataWatcher.getWatchableObjectByte(18) != 0; - } + if(this.getPowered()) { + this.explosionRadius *= 3; + } - public void func_146079_cb() - { - this.dataWatcher.updateObject(18, Byte.valueOf((byte)1)); - } - - public void setPowered(int power) { - this.dataWatcher.updateObject(17, power); - } + worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false); + + if(this.getPowered()) { + + for(int i = 0; i < 255; i++) { + int a = rand.nextInt(15) + (int) posX - 7; + int b = rand.nextInt(15) + (int) posY - 7; + int c = rand.nextInt(15) + (int) posZ - 7; + if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) { + + if(!GeneralConfig.enableHardcoreTaint) + worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2); + else + worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2); + } + } + + } else { + + for(int i = 0; i < 85; i++) { + int a = rand.nextInt(7) + (int) posX - 3; + int b = rand.nextInt(7) + (int) posY - 3; + int c = rand.nextInt(7) + (int) posZ - 3; + if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) { + + if(!GeneralConfig.enableHardcoreTaint) + + worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2); + else + worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 2); + } + } + } + + this.setDead(); + } + } + + public static boolean hasPosNeightbour(World world, int x, int y, int z) { + Block b0 = world.getBlock(x + 1, y, z); + Block b1 = world.getBlock(x, y + 1, z); + Block b2 = world.getBlock(x, y, z + 1); + Block b3 = world.getBlock(x - 1, y, z); + Block b4 = world.getBlock(x, y - 1, z); + Block b5 = world.getBlock(x, y, z - 1); + boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) || (b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) || (b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) || (b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) || (b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) || (b5.renderAsNormalBlock() && b5.getMaterial().isOpaque()); + return b; + } + + public boolean func_146078_ca() { + return this.dataWatcher.getWatchableObjectByte(18) != 0; + } + + public void func_146079_cb() { + this.dataWatcher.updateObject(18, Byte.valueOf((byte) 1)); + } + + public void setPowered(int power) { + this.dataWatcher.updateObject(17, power); + } } diff --git a/src/main/java/com/hbm/entity/projectile/EntityBaleflare.java b/src/main/java/com/hbm/entity/projectile/EntityBaleflare.java index 574827ac3..6c63afa3c 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityBaleflare.java +++ b/src/main/java/com/hbm/entity/projectile/EntityBaleflare.java @@ -2,6 +2,7 @@ package com.hbm.entity.projectile; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityBalefire; import com.hbm.entity.particle.EntitySSmokeFX; import com.hbm.explosion.ExplosionParticleB; @@ -46,7 +47,6 @@ public class EntityBaleflare extends Entity implements IProjectile { private double damage = 2.0D; /** The amount of knockback an arrow applies when it hits a mob. */ private int knockbackStrength; - private static final String __OBFID = "CL_00001715"; public EntityBaleflare(World p_i1753_1_) { @@ -247,7 +247,7 @@ public class EntityBaleflare extends Entity implements IProjectile { bf.posX = this.posX; bf.posY = this.posY; bf.posZ = this.posZ; - bf.destructionRange = MainRegistry.fatmanRadius; + bf.destructionRange = BombConfig.fatmanRadius; worldObj.spawnEntityInWorld(bf); ExplosionParticleB.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); diff --git a/src/main/java/com/hbm/entity/projectile/EntityBombletZeta.java b/src/main/java/com/hbm/entity/projectile/EntityBombletZeta.java index 1c6dec375..05293c5c9 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityBombletZeta.java +++ b/src/main/java/com/hbm/entity/projectile/EntityBombletZeta.java @@ -1,5 +1,6 @@ package com.hbm.entity.projectile; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.ExplosionLarge; @@ -69,7 +70,7 @@ public class EntityBombletZeta extends EntityThrowable { ExplosionChaos.spawnChlorine(worldObj, this.posX + 0.5F - motionX, this.posY + 0.5F - motionY, this.posZ + 0.5F - motionZ, 75, 2, 0); } if(type == 4) { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int) (MainRegistry.fatmanRadius * 1.5), posX, posY, posZ)); + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int) (BombConfig.fatmanRadius * 1.5), posX, posY, posZ)); if(rand.nextInt(100) == 0) { diff --git a/src/main/java/com/hbm/entity/projectile/EntityMeteor.java b/src/main/java/com/hbm/entity/projectile/EntityMeteor.java index aa7da0fff..0262492f8 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityMeteor.java +++ b/src/main/java/com/hbm/entity/projectile/EntityMeteor.java @@ -1,5 +1,6 @@ package com.hbm.entity.projectile; +import com.hbm.config.GeneralConfig; import com.hbm.explosion.ExplosionLarge; import com.hbm.main.MainRegistry; import com.hbm.world.feature.Meteorite; @@ -47,7 +48,7 @@ public class EntityMeteor extends EntityThrowable { { worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), true); - if(MainRegistry.enableMeteorTails) { + if(GeneralConfig.enableMeteorTails) { ExplosionLarge.spawnParticles(worldObj, posX, posY + 5, posZ, 75); ExplosionLarge.spawnParticles(worldObj, posX + 5, posY, posZ, 75); ExplosionLarge.spawnParticles(worldObj, posX - 5, posY, posZ, 75); @@ -61,7 +62,7 @@ public class EntityMeteor extends EntityThrowable { this.setDead(); } - if(MainRegistry.enableMeteorTails && worldObj.isRemote) { + if(GeneralConfig.enableMeteorTails && worldObj.isRemote) { NBTTagCompound data = new NBTTagCompound(); data.setString("type", "exhaust"); diff --git a/src/main/java/com/hbm/entity/projectile/EntityMiniMIRV.java b/src/main/java/com/hbm/entity/projectile/EntityMiniMIRV.java index 52d9f5f72..e091cbcd4 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityMiniMIRV.java +++ b/src/main/java/com/hbm/entity/projectile/EntityMiniMIRV.java @@ -2,11 +2,11 @@ package com.hbm.entity.projectile; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionChaos; import com.hbm.explosion.ExplosionParticle; import com.hbm.explosion.ExplosionParticleB; -import com.hbm.main.MainRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -28,584 +28,509 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class EntityMiniMIRV extends Entity implements IProjectile -{ - private int field_145791_d = -1; - private int field_145792_e = -1; - private int field_145789_f = -1; - public double gravity = 0.0D; - public double startVel = -20.0D; - private Block field_145790_g; - private int inData; - private boolean inGround; - /** 1 if the player can pick up the arrow */ - public int canBePickedUp; - /** Seems to be some sort of timer for animating an arrow. */ - public int arrowShake; - /** The owner of this arrow. */ - public Entity shootingEntity; - private int ticksInGround; - private int ticksInAir; - private double damage = 2.0D; - /** The amount of knockback an arrow applies when it hits a mob. */ - private int knockbackStrength; - private static final String __OBFID = "CL_00001715"; - +public class EntityMiniMIRV extends Entity implements IProjectile { + + private int field_145791_d = -1; + private int field_145792_e = -1; + private int field_145789_f = -1; + public double gravity = 0.0D; + public double startVel = -20.0D; + private Block field_145790_g; + private int inData; + private boolean inGround; + /** 1 if the player can pick up the arrow */ + public int canBePickedUp; + /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake; + /** The owner of this arrow. */ + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + /** The amount of knockback an arrow applies when it hits a mob. */ + private int knockbackStrength; - public EntityMiniMIRV(World p_i1753_1_) - { - super(p_i1753_1_); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - } + public EntityMiniMIRV(World p_i1753_1_) { + super(p_i1753_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } - public EntityMiniMIRV(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) - { - super(p_i1754_1_); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); - this.yOffset = 0.0F; - } + public EntityMiniMIRV(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) { + super(p_i1754_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); + this.yOffset = 0.0F; + } - public EntityMiniMIRV(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) - { - super(p_i1755_1_); - this.renderDistanceWeight = 10.0D; - this.shootingEntity = p_i1755_2_; + public EntityMiniMIRV(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) { + super(p_i1755_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1755_2_; - if (p_i1755_2_ instanceof EntityPlayer) - { - this.canBePickedUp = 1; - } + if(p_i1755_2_ instanceof EntityPlayer) { + this.canBePickedUp = 1; + } - this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D; - double d0 = p_i1755_3_.posX - p_i1755_2_.posX; - double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY; - double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; - double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D; + double d0 = p_i1755_3_.posX - p_i1755_2_.posX; + double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY; + double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; + double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); - if (d3 >= 1.0E-7D) - { - float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; - float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); - double d4 = d0 / d3; - double d5 = d2 / d3; - this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); - this.yOffset = 0.0F; - float f4 = (float)d3 * 0.2F; - this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_); - } - } + if(d3 >= 1.0E-7D) { + float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float) d3 * 0.2F; + this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_); + } + } - public EntityMiniMIRV(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) - { - super(p_i1756_1_); - this.renderDistanceWeight = 10.0D; - this.shootingEntity = p_i1756_2_; + public EntityMiniMIRV(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) { + super(p_i1756_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1756_2_; - if (p_i1756_2_ instanceof EntityPlayer) - { - this.canBePickedUp = 1; - } + if(p_i1756_2_ instanceof EntityPlayer) { + this.canBePickedUp = 1; + } - this.setSize(0.5F, 0.5F); - this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); - this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - this.posY -= 0.10000000149011612D; - this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); - this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); - this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); - this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); - } + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); + } - public EntityMiniMIRV(World world, int x, int y, int z, double mx, double my, double mz, double grav) { - super(world); - this.posX = x + 0.5F; - this.posY = y + 0.5F; - this.posZ = z + 0.5F; - - this.motionX = mx; - this.motionY = my; - this.motionZ = mz; - - this.gravity = grav; - } + public EntityMiniMIRV(World world, int x, int y, int z, double mx, double my, double mz, double grav) { + super(world); + this.posX = x + 0.5F; + this.posY = y + 0.5F; + this.posZ = z + 0.5F; - @Override - protected void entityInit() - { - this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); - } + this.motionX = mx; + this.motionY = my; + this.motionZ = mz; - /** - * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. - */ - @Override - public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) - { - float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); - p_70186_1_ /= f2; - p_70186_3_ /= f2; - p_70186_5_ /= f2; - p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; - p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; - p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; - p_70186_1_ *= p_70186_7_; - p_70186_3_ *= p_70186_7_; - p_70186_5_ *= p_70186_7_; - this.motionX = p_70186_1_; - this.motionY = p_70186_3_; - this.motionZ = p_70186_5_; - float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); - this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI); - this.ticksInGround = 0; - } + this.gravity = grav; + } - /** - * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, - * posY, posZ, yaw, pitch - */ - @Override + @Override + protected void entityInit() { + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z + * direction. + */ + @Override + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) { + float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= f2; + p_70186_3_ /= f2; + p_70186_5_ /= f2; + p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_; + p_70186_1_ *= p_70186_7_; + p_70186_3_ *= p_70186_7_; + p_70186_5_ *= p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the position and rotation. Only difference from the other one is no + * bounding on the rotation. Args: posX, posY, posZ, yaw, pitch + */ + @Override @SideOnly(Side.CLIENT) - public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) - { - this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); - this.setRotation(p_70056_7_, p_70056_8_); - } + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); + this.setRotation(p_70056_7_, p_70056_8_); + } - /** - * Sets the velocity to the args. Args: x, y, z - */ - @Override + /** + * Sets the velocity to the args. Args: x, y, z + */ + @Override @SideOnly(Side.CLIENT) - public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) - { - this.motionX = p_70016_1_; - this.motionY = p_70016_3_; - this.motionZ = p_70016_5_; + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; - if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) - { - float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); - this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch; - this.prevRotationYaw = this.rotationYaw; - this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - this.ticksInGround = 0; - } - } + if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(p_70016_3_, f) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } - /** - * Called to update the entity's position/logic. - */ - //@Override - @Override - public void onUpdate() - { - super.onUpdate(); + /** + * Called to update the entity's position/logic. + */ + // @Override + @Override + public void onUpdate() { + super.onUpdate(); - if(this.ticksExisted == 10) { - startVel = this.motionY; - } - - if(this.motionY <= startVel - 1) { - if(!this.worldObj.isRemote) - ExplosionChaos.miniMirv(this.worldObj, this.posX, this.posY, this.posZ); - this.motionY = this.startVel; - this.setDead(); - } - - if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) - { - float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, f) * 180.0D / Math.PI); - } + if(this.ticksExisted == 10) { + startVel = this.motionY; + } - Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + if(this.motionY <= startVel - 1) { + if(!this.worldObj.isRemote) + ExplosionChaos.miniMirv(this.worldObj, this.posX, this.posY, this.posZ); + this.motionY = this.startVel; + this.setDead(); + } - if (block.getMaterial() != Material.air) - { - block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); - AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / Math.PI); + } - if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) - { - this.inGround = true; - } - } + Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); - if (this.arrowShake > 0) - { - --this.arrowShake; - } + if(block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); - if (this.inGround) - { - if (!this.worldObj.isRemote) - { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.fatmanRadius, posX, posY, posZ)); - - if(rand.nextInt(100) == 0) - { - ExplosionParticleB.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } else { - ExplosionParticle.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } - } - this.setDead(); - } - else - { - ++this.ticksInAir; - Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); - vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if(axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { + this.inGround = true; + } + } - if (movingobjectposition != null) - { - vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); - } + if(this.arrowShake > 0) { + --this.arrowShake; + } - Entity entity = null; - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); - double d0 = 0.0D; - int i; - float f1; + if(this.inGround) { + if(!this.worldObj.isRemote) { + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.fatmanRadius, posX, posY, posZ)); - for (i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); + if(rand.nextInt(100) == 0) { + ExplosionParticleB.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } else { + ExplosionParticle.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } + } + this.setDead(); + } else { + ++this.ticksInAir; + Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); + vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) - { - f1 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + if(movingobjectposition != null) { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } - if (movingobjectposition1 != null) - { - double d1 = vec31.distanceTo(movingobjectposition1.hitVec); + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + int i; + float f1; - if (d1 < d0 || d0 == 0.0D) - { - entity = entity1; - d0 = d1; - } - } - } - } + for(i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity) list.get(i); - if (entity != null) - { - movingobjectposition = new MovingObjectPosition(entity); - } + if(entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); - if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) - { - EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + if(movingobjectposition1 != null) { + double d1 = vec31.distanceTo(movingobjectposition1.hitVec); - if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) - { - movingobjectposition = null; - } - } + if(d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } - float f2; - float f4; + if(entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } - if (movingobjectposition != null) - { - if (movingobjectposition.entityHit != null) - { - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); - int k = MathHelper.ceiling_double_int(f2 * this.damage); + if(movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit; - if (this.getIsCritical()) - { - k += this.rand.nextInt(k / 2 + 2); - } + if(entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) { + movingobjectposition = null; + } + } - DamageSource damagesource = null; + float f2; + float f4; - if (this.shootingEntity == null) - { - damagesource = DamageSource.causeIndirectMagicDamage(this, this); - } - else - { - damagesource = DamageSource.causeIndirectMagicDamage(this, this); - } + if(movingobjectposition != null) { + if(movingobjectposition.entityHit != null) { + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int k = MathHelper.ceiling_double_int(f2 * this.damage); - if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) - { - movingobjectposition.entityHit.setFire(5); - } + if(this.getIsCritical()) { + k += this.rand.nextInt(k / 2 + 2); + } - if (movingobjectposition.entityHit.attackEntityFrom(damagesource, k)) - { - if (movingobjectposition.entityHit instanceof EntityLivingBase) - { - EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit; + DamageSource damagesource = null; - if (this.knockbackStrength > 0) - { - f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + if(this.shootingEntity == null) { + damagesource = DamageSource.causeIndirectMagicDamage(this, this); + } else { + damagesource = DamageSource.causeIndirectMagicDamage(this, this); + } - if (f4 > 0.0F) - { - movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4); - } - } + if(this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) { + movingobjectposition.entityHit.setFire(5); + } - if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase) - { - EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity); - EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase); - } + if(movingobjectposition.entityHit.attackEntityFrom(damagesource, k)) { + if(movingobjectposition.entityHit instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) movingobjectposition.entityHit; - if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) - { - ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); - } - } + if(this.knockbackStrength > 0) { + f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - if (!(movingobjectposition.entityHit instanceof EntityEnderman)) - { - if (!this.worldObj.isRemote) - { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.fatmanRadius, posX, posY, posZ)); - - if(rand.nextInt(100) == 0) - { - ExplosionParticleB.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } else { - ExplosionParticle.spawnMush(this.worldObj, (int)this.posX, (int)this.posY - 3, (int)this.posZ); - } - } - this.setDead(); - } - } - else - { - this.motionX *= -0.10000000149011612D; - this.motionY *= -0.10000000149011612D; - this.motionZ *= -0.10000000149011612D; - this.rotationYaw += 180.0F; - this.prevRotationYaw += 180.0F; - this.ticksInAir = 0; - } - } - else - { - this.field_145791_d = movingobjectposition.blockX; - this.field_145792_e = movingobjectposition.blockY; - this.field_145789_f = movingobjectposition.blockZ; - this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); - this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); - this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX)); - this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY)); - this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ)); - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); - this.posX -= this.motionX / f2 * 0.05000000074505806D; - this.posY -= this.motionY / f2 * 0.05000000074505806D; - this.posZ -= this.motionZ / f2 * 0.05000000074505806D; - this.inGround = true; - this.arrowShake = 7; - this.setIsCritical(false); + if(f4 > 0.0F) { + movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4); + } + } - if (this.field_145790_g.getMaterial() != Material.air) - { - this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this); - } - } - } + if(this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase) { + EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity); + EnchantmentHelper.func_151385_b((EntityLivingBase) this.shootingEntity, entitylivingbase); + } - this.posX += this.motionX; - this.posY += this.motionY; - this.posZ += this.motionZ; - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + if(this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { + ((EntityPlayerMP) this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + } + } - for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } + if(!(movingobjectposition.entityHit instanceof EntityEnderman)) { + if(!this.worldObj.isRemote) { + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.fatmanRadius, posX, posY, posZ)); - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } + if(rand.nextInt(100) == 0) { + ExplosionParticleB.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } else { + ExplosionParticle.spawnMush(this.worldObj, (int) this.posX, (int) this.posY - 3, (int) this.posZ); + } + } + this.setDead(); + } + } else { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } else { + this.field_145791_d = movingobjectposition.blockX; + this.field_145792_e = movingobjectposition.blockY; + this.field_145789_f = movingobjectposition.blockZ; + this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.motionX = ((float) (movingobjectposition.hitVec.xCoord - this.posX)); + this.motionY = ((float) (movingobjectposition.hitVec.yCoord - this.posY)); + this.motionZ = ((float) (movingobjectposition.hitVec.zCoord - this.posZ)); + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / f2 * 0.05000000074505806D; + this.posY -= this.motionY / f2 * 0.05000000074505806D; + this.posZ -= this.motionZ / f2 * 0.05000000074505806D; + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } + if(this.field_145790_g.getMaterial() != Material.air) { + this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this); + } + } + } - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f3 = 0.99F; - f1 = 0.05F; + for(this.rotationPitch = (float) (Math.atan2(this.motionY, f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } - if (this.isInWater()) - { - for (int l = 0; l < 4; ++l) - { - f4 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ); - } + while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } - f3 = 0.8F; - } + while(this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } - if (this.isWet()) - { - this.extinguish(); - } + while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } - this.motionX *= f3; - this.motionY *= f3; - this.motionZ *= f3; - this.motionY -= 0.15D; - this.setPosition(this.posX, this.posY, this.posZ); - this.func_145775_I(); - } - } + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f3 = 0.99F; + f1 = 0.05F; - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound p_70014_1_) - { - p_70014_1_.setShort("xTile", (short)this.field_145791_d); - p_70014_1_.setShort("yTile", (short)this.field_145792_e); - p_70014_1_.setShort("zTile", (short)this.field_145789_f); - p_70014_1_.setShort("life", (short)this.ticksInGround); - p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g)); - p_70014_1_.setByte("inData", (byte)this.inData); - p_70014_1_.setByte("shake", (byte)this.arrowShake); - p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - p_70014_1_.setByte("pickup", (byte)this.canBePickedUp); - p_70014_1_.setDouble("damage", this.damage); - p_70014_1_.setDouble("startVel", this.startVel); - } + if(this.isInWater()) { + for(int l = 0; l < 4; ++l) { + f4 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ); + } - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound p_70037_1_) - { - this.field_145791_d = p_70037_1_.getShort("xTile"); - this.field_145792_e = p_70037_1_.getShort("yTile"); - this.field_145789_f = p_70037_1_.getShort("zTile"); - this.ticksInGround = p_70037_1_.getShort("life"); - this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); - this.inData = p_70037_1_.getByte("inData") & 255; - this.arrowShake = p_70037_1_.getByte("shake") & 255; - this.inGround = p_70037_1_.getByte("inGround") == 1; + f3 = 0.8F; + } - if (p_70037_1_.hasKey("damage", 99)) - { - this.damage = p_70037_1_.getDouble("damage"); - } + if(this.isWet()) { + this.extinguish(); + } - if (p_70037_1_.hasKey("startVel", 99)) - { - this.startVel = p_70037_1_.getDouble("startVel"); - } + this.motionX *= f3; + this.motionY *= f3; + this.motionZ *= f3; + this.motionY -= 0.15D; + this.setPosition(this.posX, this.posY, this.posZ); + this.func_145775_I(); + } + } - if (p_70037_1_.hasKey("pickup", 99)) - { - this.canBePickedUp = p_70037_1_.getByte("pickup"); - } - else if (p_70037_1_.hasKey("player", 99)) - { - this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0; - } - } + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("xTile", (short) this.field_145791_d); + p_70014_1_.setShort("yTile", (short) this.field_145792_e); + p_70014_1_.setShort("zTile", (short) this.field_145789_f); + p_70014_1_.setShort("life", (short) this.ticksInGround); + p_70014_1_.setByte("inTile", (byte) Block.getIdFromBlock(this.field_145790_g)); + p_70014_1_.setByte("inData", (byte) this.inData); + p_70014_1_.setByte("shake", (byte) this.arrowShake); + p_70014_1_.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + p_70014_1_.setByte("pickup", (byte) this.canBePickedUp); + p_70014_1_.setDouble("damage", this.damage); + p_70014_1_.setDouble("startVel", this.startVel); + } - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() - { - return false; - } + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.field_145791_d = p_70037_1_.getShort("xTile"); + this.field_145792_e = p_70037_1_.getShort("yTile"); + this.field_145789_f = p_70037_1_.getShort("zTile"); + this.ticksInGround = p_70037_1_.getShort("life"); + this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.inData = p_70037_1_.getByte("inData") & 255; + this.arrowShake = p_70037_1_.getByte("shake") & 255; + this.inGround = p_70037_1_.getByte("inGround") == 1; - @Override + if(p_70037_1_.hasKey("damage", 99)) { + this.damage = p_70037_1_.getDouble("damage"); + } + + if(p_70037_1_.hasKey("startVel", 99)) { + this.startVel = p_70037_1_.getDouble("startVel"); + } + + if(p_70037_1_.hasKey("pickup", 99)) { + this.canBePickedUp = p_70037_1_.getByte("pickup"); + } else if(p_70037_1_.hasKey("player", 99)) { + this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0; + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they + * walk on. used for spiders and wolves to prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() { + return false; + } + + @Override @SideOnly(Side.CLIENT) - public float getShadowSize() - { - return 0.0F; - } + public float getShadowSize() { + return 0.0F; + } - public void setDamage(double p_70239_1_) - { - this.damage = p_70239_1_; - } + public void setDamage(double p_70239_1_) { + this.damage = p_70239_1_; + } - public double getDamage() - { - return this.damage; - } + public double getDamage() { + return this.damage; + } - /** - * Sets the amount of knockback the arrow applies when it hits a mob. - */ - public void setKnockbackStrength(int p_70240_1_) - { - this.knockbackStrength = p_70240_1_; - } + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int p_70240_1_) { + this.knockbackStrength = p_70240_1_; + } - /** - * If returns false, the item will not inflict any damage against entities. - */ - @Override - public boolean canAttackWithItem() - { - return false; - } + /** + * If returns false, the item will not inflict any damage against entities. + */ + @Override + public boolean canAttackWithItem() { + return false; + } - /** - * Whether the arrow has a stream of critical hit particles flying behind it. - */ - public void setIsCritical(boolean p_70243_1_) - { - byte b0 = this.dataWatcher.getWatchableObjectByte(16); + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public void setIsCritical(boolean p_70243_1_) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); - if (p_70243_1_) - { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); - } - else - { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); - } - } + if(p_70243_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -2))); + } + } - /** - * Whether the arrow has a stream of critical hit particles flying behind it. - */ - public boolean getIsCritical() - { - byte b0 = this.dataWatcher.getWatchableObjectByte(16); - return (b0 & 1) != 0; - } + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public boolean getIsCritical() { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + return (b0 & 1) != 0; + } } diff --git a/src/main/java/com/hbm/entity/projectile/EntityMiniNuke.java b/src/main/java/com/hbm/entity/projectile/EntityMiniNuke.java index 6f1663a19..cf1926289 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityMiniNuke.java +++ b/src/main/java/com/hbm/entity/projectile/EntityMiniNuke.java @@ -2,6 +2,7 @@ package com.hbm.entity.projectile; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionParticle; import com.hbm.explosion.ExplosionParticleB; @@ -47,7 +48,6 @@ public class EntityMiniNuke extends Entity implements IProjectile private double damage = 2.0D; /** The amount of knockback an arrow applies when it hits a mob. */ private int knockbackStrength; - private static final String __OBFID = "CL_00001715"; public EntityMiniNuke(World p_i1753_1_) @@ -237,7 +237,7 @@ public class EntityMiniNuke extends Entity implements IProjectile { if (!this.worldObj.isRemote) { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.fatmanRadius, posX, posY, posZ)); + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.fatmanRadius, posX, posY, posZ)); //Perma-baleflare mode if the polaroid's glitched if(MainRegistry.polaroidID == 11) @@ -378,7 +378,7 @@ public class EntityMiniNuke extends Entity implements IProjectile { if (!this.worldObj.isRemote) { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.fatmanRadius, posX, posY, posZ)); + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.fatmanRadius, posX, posY, posZ)); if(rand.nextInt(100) == 0) { diff --git a/src/main/java/com/hbm/entity/projectile/EntityModBeam.java b/src/main/java/com/hbm/entity/projectile/EntityModBeam.java index 2bcddb3eb..c3f6ecdbe 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityModBeam.java +++ b/src/main/java/com/hbm/entity/projectile/EntityModBeam.java @@ -2,6 +2,7 @@ package com.hbm.entity.projectile; import java.util.List; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityBlackHole; import com.hbm.entity.effect.EntityCloudFleijaRainbow; import com.hbm.entity.effect.EntityNukeCloudSmall; @@ -11,7 +12,6 @@ import com.hbm.entity.grenade.EntityGrenadeZOMG; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionLarge; -import com.hbm.main.MainRegistry; import com.hbm.potion.HbmPotion; import cpw.mods.fml.relauncher.Side; @@ -30,471 +30,405 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class EntityModBeam extends Entity implements IProjectile -{ - private int field_145791_d = -1; - private int field_145792_e = -1; - private int field_145789_f = -1; - public double gravity = 0.0D; - private Block field_145790_g; - private int inData; - private boolean inGround; - /** 1 if the player can pick up the arrow */ - public int canBePickedUp; - /** Seems to be some sort of timer for animating an arrow. */ - public int arrowShake; - /** The owner of this arrow. */ - public Entity shootingEntity; - private int ticksInGround; - private int ticksInAir; - private double damage = 2.0D; - /** The amount of knockback an arrow applies when it hits a mob. */ - private int knockbackStrength; - private static final String __OBFID = "CL_00001715"; - public int mode = 0; - - - public EntityModBeam(World p_i1753_1_) - { - super(p_i1753_1_); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - } - - public EntityModBeam(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) - { - super(p_i1754_1_); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); - this.yOffset = 0.0F; - } - - public EntityModBeam(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) - { - super(p_i1755_1_); - this.renderDistanceWeight = 10.0D; - this.shootingEntity = p_i1755_2_; - - if (p_i1755_2_ instanceof EntityPlayer) - { - this.canBePickedUp = 1; - } - - this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D; - double d0 = p_i1755_3_.posX - p_i1755_2_.posX; - double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY; - double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; - double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); - - if (d3 >= 1.0E-7D) - { - float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; - float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); - double d4 = d0 / d3; - double d5 = d2 / d3; - this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); - this.yOffset = 0.0F; - float f4 = (float)d3 * 0.2F; - this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_); - } - } +public class EntityModBeam extends Entity implements IProjectile { + private int field_145791_d = -1; + private int field_145792_e = -1; + private int field_145789_f = -1; + public double gravity = 0.0D; + private Block field_145790_g; + private int inData; + private boolean inGround; + public int canBePickedUp; + public int arrowShake; + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + public int mode = 0; + + public EntityModBeam(World p_i1753_1_) { + super(p_i1753_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityModBeam(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) { + super(p_i1754_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); + this.yOffset = 0.0F; + } + + public EntityModBeam(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) { + super(p_i1755_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1755_2_; + + if(p_i1755_2_ instanceof EntityPlayer) { + this.canBePickedUp = 1; + } + + this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D; + double d0 = p_i1755_3_.posX - p_i1755_2_.posX; + double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY; + double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; + double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if(d3 >= 1.0E-7D) { + float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float) d3 * 0.2F; + this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_); + } + } + public EntityModBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) { super(p_i1756_1_); this.renderDistanceWeight = 10.0D; this.shootingEntity = p_i1756_2_; this.setSize(0.5F, 0.5F); - this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ, - grenade.rotationYaw, grenade.rotationPitch); + this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ, grenade.rotationYaw, grenade.rotationPitch); this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; this.posY -= 0.10000000149011612D; this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; this.setPosition(this.posX, this.posY, this.posZ); this.yOffset = 0.0F; - this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) - * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); - this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) - * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); } - public EntityModBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) - { - super(p_i1756_1_); - this.renderDistanceWeight = 10.0D; - this.shootingEntity = p_i1756_2_; + public EntityModBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) { + super(p_i1756_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1756_2_; - this.setSize(0.5F, 0.5F); - this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); - this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - this.posY -= 0.10000000149011612D; - this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); - this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); - this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); - this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); - } + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); + } - public EntityModBeam(World world, int x, int y, int z, double mx, double my, double mz, double grav) { - super(world); - this.posX = x + 0.5F; - this.posY = y + 0.5F; - this.posZ = z + 0.5F; - - this.motionX = mx; - this.motionY = my; - this.motionZ = mz; - - this.gravity = grav; - } + public EntityModBeam(World world, int x, int y, int z, double mx, double my, double mz, double grav) { + super(world); + this.posX = x + 0.5F; + this.posY = y + 0.5F; + this.posZ = z + 0.5F; - @Override - protected void entityInit() - { - this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); - } + this.motionX = mx; + this.motionY = my; + this.motionZ = mz; - /** - * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. - */ - @Override - public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) - { - float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); - p_70186_1_ /= f2; - p_70186_3_ /= f2; - p_70186_5_ /= f2; - p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; - p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; - p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; - p_70186_1_ *= p_70186_7_; - p_70186_3_ *= p_70186_7_; - p_70186_5_ *= p_70186_7_; - this.motionX = p_70186_1_; - this.motionY = p_70186_3_; - this.motionZ = p_70186_5_; - float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); - this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI); - this.ticksInGround = 0; - } + this.gravity = grav; + } - /** - * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, - * posY, posZ, yaw, pitch - */ - @Override + @Override + protected void entityInit() { + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z + * direction. + */ + @Override + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) { + float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= f2; + p_70186_3_ /= f2; + p_70186_5_ /= f2; + p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; + p_70186_1_ *= p_70186_7_; + p_70186_3_ *= p_70186_7_; + p_70186_5_ *= p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the position and rotation. Only difference from the other one is no + * bounding on the rotation. Args: posX, posY, posZ, yaw, pitch + */ + @Override @SideOnly(Side.CLIENT) - public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) - { - this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); - this.setRotation(p_70056_7_, p_70056_8_); - } + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); + this.setRotation(p_70056_7_, p_70056_8_); + } - /** - * Sets the velocity to the args. Args: x, y, z - */ - @Override + /** + * Sets the velocity to the args. Args: x, y, z + */ + @Override @SideOnly(Side.CLIENT) - public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) - { - this.motionX = p_70016_1_; - this.motionY = p_70016_3_; - this.motionZ = p_70016_5_; + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; - if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) - { - float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); - this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch; - this.prevRotationYaw = this.rotationYaw; - this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - this.ticksInGround = 0; - } - } + if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(p_70016_3_, f) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } - /** - * Called to update the entity's position/logic. - */ - //@Override - @Override - public void onUpdate() - { - super.onUpdate(); - - if(this.ticksExisted > 100) - this.setDead(); + /** + * Called to update the entity's position/logic. + */ + // @Override + @Override + public void onUpdate() { + super.onUpdate(); - if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) - { - MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - //this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); - } + if(this.ticksExisted > 100) + this.setDead(); - Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + // this.prevRotationPitch = this.rotationPitch = + // (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); + } - if (block.getMaterial() != Material.air) - { - block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); - this.setDead(); - explode(); - } + Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); - if (this.arrowShake > 0) - { - --this.arrowShake; - } - else - { - ++this.ticksInAir; - Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); - vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if(block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.setDead(); + explode(); + } - if (movingobjectposition != null) - { - vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); - } + if(this.arrowShake > 0) { + --this.arrowShake; + } else { + ++this.ticksInAir; + Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); + vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Entity entity = null; - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); - double d0 = 0.0D; - int i; - float f1; + if(movingobjectposition != null) { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } - for (i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + int i; + float f1; - if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) - { - f1 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + for(i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity) list.get(i); - if (movingobjectposition1 != null) - { - double d1 = vec31.distanceTo(movingobjectposition1.hitVec); + if(entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); - if (d1 < d0 || d0 == 0.0D) - { - entity = entity1; - d0 = d1; - } - } - } - } + if(movingobjectposition1 != null) { + double d1 = vec31.distanceTo(movingobjectposition1.hitVec); - if (entity != null) - { - movingobjectposition = new MovingObjectPosition(entity); - } + if(d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } - if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) - { - EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; - - if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) - { - movingobjectposition = null; - } - } + if(entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } - float f2; - if (movingobjectposition != null) - { - if (movingobjectposition.entityHit != null && movingobjectposition.entityHit != this.shootingEntity) - { - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); - int k = MathHelper.ceiling_double_int(f2 * this.damage); + if(movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit; - if (this.getIsCritical()) - { - k += this.rand.nextInt(k / 2 + 2); - } - - if(movingobjectposition.entityHit instanceof EntityLivingBase) { - ((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(HbmPotion.bang.id, 60, 0)); - } else { - explode(); - } - - this.setDead(); - } - else - { - this.field_145791_d = movingobjectposition.blockX; - this.field_145792_e = movingobjectposition.blockY; - this.field_145789_f = movingobjectposition.blockZ; - this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); - this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); - } - } + if(entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) { + movingobjectposition = null; + } + } - this.posX += this.motionX; - this.posY += this.motionY; - this.posZ += this.motionZ; - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + float f2; + if(movingobjectposition != null) { + if(movingobjectposition.entityHit != null && movingobjectposition.entityHit != this.shootingEntity) { + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int k = MathHelper.ceiling_double_int(f2 * this.damage); - f1 = 0.05F; + if(this.getIsCritical()) { + k += this.rand.nextInt(k / 2 + 2); + } - if (this.isInWater()) - { - this.setDead(); - explode(); - } + if(movingobjectposition.entityHit instanceof EntityLivingBase) { + ((EntityLivingBase) movingobjectposition.entityHit).addPotionEffect(new PotionEffect(HbmPotion.bang.id, 60, 0)); + } else { + explode(); + } - if (this.isWet()) - { - this.extinguish(); - } - - this.setPosition(this.posX, this.posY, this.posZ); - this.func_145775_I(); - } - } + this.setDead(); + } else { + this.field_145791_d = movingobjectposition.blockX; + this.field_145792_e = movingobjectposition.blockY; + this.field_145789_f = movingobjectposition.blockZ; + this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + } + } - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound p_70014_1_) - { - p_70014_1_.setShort("xTile", (short)this.field_145791_d); - p_70014_1_.setShort("yTile", (short)this.field_145792_e); - p_70014_1_.setShort("zTile", (short)this.field_145789_f); - p_70014_1_.setShort("life", (short)this.ticksInGround); - p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g)); - p_70014_1_.setByte("inData", (byte)this.inData); - p_70014_1_.setByte("shake", (byte)this.arrowShake); - p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - p_70014_1_.setByte("pickup", (byte)this.canBePickedUp); - p_70014_1_.setDouble("damage", this.damage); - p_70014_1_.setInteger("mode", this.mode); - } + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound p_70037_1_) - { - this.field_145791_d = p_70037_1_.getShort("xTile"); - this.field_145792_e = p_70037_1_.getShort("yTile"); - this.field_145789_f = p_70037_1_.getShort("zTile"); - this.ticksInGround = p_70037_1_.getShort("life"); - this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); - this.inData = p_70037_1_.getByte("inData") & 255; - this.arrowShake = p_70037_1_.getByte("shake") & 255; - this.inGround = p_70037_1_.getByte("inGround") == 1; - this.mode = p_70037_1_.getInteger("mode"); + f1 = 0.05F; - if (p_70037_1_.hasKey("damage", 99)) - { - this.damage = p_70037_1_.getDouble("damage"); - } + if(this.isInWater()) { + this.setDead(); + explode(); + } - if (p_70037_1_.hasKey("pickup", 99)) - { - this.canBePickedUp = p_70037_1_.getByte("pickup"); - } - else if (p_70037_1_.hasKey("player", 99)) - { - this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0; - } - } + if(this.isWet()) { + this.extinguish(); + } - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() - { - return false; - } + this.setPosition(this.posX, this.posY, this.posZ); + this.func_145775_I(); + } + } - @Override + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("xTile", (short) this.field_145791_d); + p_70014_1_.setShort("yTile", (short) this.field_145792_e); + p_70014_1_.setShort("zTile", (short) this.field_145789_f); + p_70014_1_.setShort("life", (short) this.ticksInGround); + p_70014_1_.setByte("inTile", (byte) Block.getIdFromBlock(this.field_145790_g)); + p_70014_1_.setByte("inData", (byte) this.inData); + p_70014_1_.setByte("shake", (byte) this.arrowShake); + p_70014_1_.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + p_70014_1_.setByte("pickup", (byte) this.canBePickedUp); + p_70014_1_.setDouble("damage", this.damage); + p_70014_1_.setInteger("mode", this.mode); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.field_145791_d = p_70037_1_.getShort("xTile"); + this.field_145792_e = p_70037_1_.getShort("yTile"); + this.field_145789_f = p_70037_1_.getShort("zTile"); + this.ticksInGround = p_70037_1_.getShort("life"); + this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.inData = p_70037_1_.getByte("inData") & 255; + this.arrowShake = p_70037_1_.getByte("shake") & 255; + this.inGround = p_70037_1_.getByte("inGround") == 1; + this.mode = p_70037_1_.getInteger("mode"); + + if(p_70037_1_.hasKey("damage", 99)) { + this.damage = p_70037_1_.getDouble("damage"); + } + + if(p_70037_1_.hasKey("pickup", 99)) { + this.canBePickedUp = p_70037_1_.getByte("pickup"); + } else if(p_70037_1_.hasKey("player", 99)) { + this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0; + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they + * walk on. used for spiders and wolves to prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() { + return false; + } + + @Override @SideOnly(Side.CLIENT) - public float getShadowSize() - { - return 0.0F; - } + public float getShadowSize() { + return 0.0F; + } - public void setDamage(double p_70239_1_) - { - this.damage = p_70239_1_; - } + public void setDamage(double p_70239_1_) { + this.damage = p_70239_1_; + } - public double getDamage() - { - return this.damage; - } - - /** - * Sets the amount of knockback the arrow applies when it hits a mob. - */ - public void setKnockbackStrength(int p_70240_1_) - { - this.knockbackStrength = p_70240_1_; - } - - /** - * If returns false, the item will not inflict any damage against entities. - */ - @Override - public boolean canAttackWithItem() - { - return false; - } - - /** - * Whether the arrow has a stream of critical hit particles flying behind it. - */ - public void setIsCritical(boolean p_70243_1_) - { - byte b0 = this.dataWatcher.getWatchableObjectByte(16); - - if (p_70243_1_) - { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); - } - else - { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); - } - } - - /** - * Whether the arrow has a stream of critical hit particles flying behind it. - */ - public boolean getIsCritical() - { - byte b0 = this.dataWatcher.getWatchableObjectByte(16); - return (b0 & 1) != 0; - } - - private void explode() { - if(!worldObj.isRemote) { - - if(mode == 0) { - ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, false); - } else if( mode == 1) { - ExplosionLarge.explodeFire(worldObj, posX, posY, posZ, 10, true, false, false); - } else if(mode == 2) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + public double getDamage() { + return this.damage; + } + @Override + public boolean canAttackWithItem() { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public void setIsCritical(boolean p_70243_1_) { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if(p_70243_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind + * it. + */ + public boolean getIsCritical() { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + return (b0 & 1) != 0; + } + + private void explode() { + if(!worldObj.isRemote) { + + if(mode == 0) { + ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, false); + } else if(mode == 1) { + ExplosionLarge.explodeFire(worldObj, posX, posY, posZ, 10, true, false, false); + } else if(mode == 2) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(this.worldObj); entity.posX = this.posX; entity.posY = this.posY; @@ -503,18 +437,17 @@ public class EntityModBeam extends Entity implements IProjectile entity.speed = 25; entity.coefficient = 1.0F; entity.waste = false; - + this.worldObj.spawnEntityInWorld(entity); - - EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 10); - cloud.posX = this.posX; - cloud.posY = this.posY; - cloud.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(cloud); - } else if(mode == 3) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - + + EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 10); + cloud.posX = this.posX; + cloud.posY = this.posY; + cloud.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(cloud); + } else if(mode == 3) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(this.worldObj); entity.posX = this.posX; entity.posY = this.posY; @@ -523,66 +456,60 @@ public class EntityModBeam extends Entity implements IProjectile entity.speed = 25; entity.coefficient = 1.0F; entity.waste = false; - + this.worldObj.spawnEntityInWorld(entity); - - EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 20); - cloud.posX = this.posX; - cloud.posY = this.posY; - cloud.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(cloud); - } else if(mode == 4) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - - EntityVortex vortex = new EntityVortex(this.worldObj, 1F); - vortex.posX = this.posX; - vortex.posY = this.posY; - vortex.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(vortex); - } else if(mode == 5) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - - EntityVortex vortex = new EntityVortex(this.worldObj, 2.5F); - vortex.posX = this.posX; - vortex.posY = this.posY; - vortex.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(vortex); - } else if(mode == 6) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - - EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 2.5F); - vortex.posX = this.posX; - vortex.posY = this.posY; - vortex.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(vortex); - } else if(mode == 7) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - - EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 5F); - vortex.posX = this.posX; - vortex.posY = this.posY; - vortex.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(vortex); - } else if(mode == 8) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - - EntityBlackHole vortex = new EntityBlackHole(this.worldObj, 2F); - vortex.posX = this.posX; - vortex.posY = this.posY; - vortex.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(vortex); - } else { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, - "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - - this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.gadgetRadius, posX, posY, posZ)); - this.worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(worldObj, posX, posY, posZ, MainRegistry.gadgetRadius)); - } - } - } + + EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 20); + cloud.posX = this.posX; + cloud.posY = this.posY; + cloud.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(cloud); + } else if(mode == 4) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityVortex vortex = new EntityVortex(this.worldObj, 1F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 5) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityVortex vortex = new EntityVortex(this.worldObj, 2.5F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 6) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 2.5F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 7) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 5F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 8) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityBlackHole vortex = new EntityBlackHole(this.worldObj, 2F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, BombConfig.gadgetRadius, posX, posY, posZ)); + this.worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(worldObj, posX, posY, posZ, BombConfig.gadgetRadius)); + } + } + } } diff --git a/src/main/java/com/hbm/handler/ToolAbility.java b/src/main/java/com/hbm/handler/ToolAbility.java index 22c942277..f8a857c04 100644 --- a/src/main/java/com/hbm/handler/ToolAbility.java +++ b/src/main/java/com/hbm/handler/ToolAbility.java @@ -6,12 +6,12 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import com.hbm.config.ToolConfig; import com.hbm.inventory.CentrifugeRecipes; import com.hbm.inventory.CrystallizerRecipes; import com.hbm.inventory.ShredderRecipes; import com.hbm.items.ModItems; import com.hbm.items.tool.IItemAbility; -import com.hbm.main.MainRegistry; import com.hbm.util.EnchantmentUtil; import net.minecraft.block.Block; @@ -48,9 +48,9 @@ public abstract class ToolAbility { Block b = world.getBlock(x, y, z); - if(b == Blocks.stone && !MainRegistry.recursiveStone) + if(b == Blocks.stone && !ToolConfig.recursiveStone) return; - if(b == Blocks.netherrack && !MainRegistry.recursiveNetherrack) + if(b == Blocks.netherrack && !ToolConfig.recursiveNetherrack) return; List indices = Arrays.asList(new Integer[] {0, 1, 2, 3, 4, 5}); @@ -77,7 +77,7 @@ public abstract class ToolAbility { depth += 1; - if(depth > MainRegistry.recursionDepth) + if(depth > ToolConfig.recursionDepth) return; pos.add(new ThreeInts(x, y, z)); diff --git a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java index 8213402d0..c955c4818 100644 --- a/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/BulletConfigFactory.java @@ -3,6 +3,7 @@ package com.hbm.handler.guncfg; import java.util.List; import java.util.Random; +import com.hbm.config.BombConfig; import com.hbm.entity.particle.EntityBSmokeFX; import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.ArmorUtil; @@ -238,7 +239,7 @@ public class BulletConfigFactory { bullet.bounceMod = 1.0; bullet.doesPenetrate = true; bullet.doesBreakGlass = false; - bullet.nuke = 35; + bullet.nuke = BombConfig.fatmanRadius; bullet.style = BulletConfiguration.STYLE_NUKE; bullet.plink = BulletConfiguration.PLINK_GRENADE; diff --git a/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java b/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java index bed1cb4d5..337921383 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunFatmanFactory.java @@ -2,6 +2,7 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityBalefire; import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.explosion.ExplosionParticleB; @@ -171,7 +172,7 @@ public class GunFatmanFactory { bf.posX = x; bf.posY = y; bf.posZ = z; - bf.destructionRange = (int) (MainRegistry.fatmanRadius * 1.25); + bf.destructionRange = (int) (BombConfig.fatmanRadius * 1.25); bullet.worldObj.spawnEntityInWorld(bf); ExplosionParticleB.spawnMush(bullet.worldObj, x, y, z); } diff --git a/src/main/java/com/hbm/inventory/MachineRecipes.java b/src/main/java/com/hbm/inventory/MachineRecipes.java index 4665997f5..6d7320395 100644 --- a/src/main/java/com/hbm/inventory/MachineRecipes.java +++ b/src/main/java/com/hbm/inventory/MachineRecipes.java @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.Spaghetti; import com.hbm.items.ModItems; @@ -41,7 +42,7 @@ public class MachineRecipes { if(item == null || item2 == null) return null; - if (MainRegistry.enableDebugMode) { + if (GeneralConfig.enableDebugMode) { if (item.getItem() == Items.iron_ingot && item2.getItem() == Items.quartz || item.getItem() == Items.quartz && item2.getItem() == Items.iron_ingot) { return new ItemStack(ModBlocks.test_render, 1); @@ -723,7 +724,7 @@ public class MachineRecipes { public Map getAlloyRecipes() { Map recipes = new HashMap(); - if (MainRegistry.enableDebugMode) { + if (GeneralConfig.enableDebugMode) { recipes.put(new ItemStack[] { new ItemStack(Items.iron_ingot), new ItemStack(Items.quartz) }, new ItemStack(Item.getItemFromBlock(ModBlocks.test_render))); } diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java b/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java index c5f3454ff..eb87dd6b7 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java @@ -4,11 +4,13 @@ import java.util.Arrays; import org.lwjgl.opengl.GL11; +import com.hbm.config.WeaponConfig; import com.hbm.inventory.container.ContainerMachineRadar; import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; import com.hbm.tileentity.machine.TileEntityMachineRadar; +import api.hbm.entity.IRadarDetectable.RadarTargetType; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; @@ -35,33 +37,14 @@ public class GUIMachineRadar extends GuiInfoContainer { if(!diFurnace.nearbyMissiles.isEmpty()) { for(int[] m : diFurnace.nearbyMissiles) { - int x = guiLeft + (int)((m[0] - diFurnace.xCoord) / ((double)MainRegistry.radarRange * 2 + 1) * (200D - 8D)) + 108; - int z = guiTop + (int)((m[1] - diFurnace.zCoord) / ((double)MainRegistry.radarRange * 2 + 1) * (200D - 8D)) + 117; + int x = guiLeft + (int)((m[0] - diFurnace.xCoord) / ((double)WeaponConfig.radarRange * 2 + 1) * (200D - 8D)) + 108; + int z = guiTop + (int)((m[1] - diFurnace.zCoord) / ((double)WeaponConfig.radarRange * 2 + 1) * (200D - 8D)) + 117; if(mouseX + 4 > x && mouseX - 4 < x && mouseY + 4 > z && mouseY - 4 < z) { - String[] text = new String[] { "Error." }; - - if(m[2] == 0) - text = new String[] { "Tier 1 Missile", m[0] + " / " + m[1], "Alt.: " + m[3] }; - else if(m[2] == 1) - text = new String[] { "Tier 2 Missile", m[0] + " / " + m[1], "Alt.: " + m[3] }; - else if(m[2] == 2) - text = new String[] { "Tier 3 Missile", m[0] + " / " + m[1], "Alt.: " + m[3] }; - else if(m[2] == 3) - text = new String[] { "Tier 4 Missile", m[0] + " / " + m[1], "Alt.: " + m[3] }; - else if(m[2] == 4) - text = new String[] { "Anti Ballistic Missile", m[0] + " / " + m[1], "Alt.: " + m[3] }; - else if(m[2] == 5) - text = new String[] { "Player", m[0] + " / " + m[1], "Alt.: " + m[3] }; - /*else if(m[2] == 6) - text = new String[] { "Stinger Missile", m[0] + " / " + m[1], "Alt.: " + m[3] }; - else if(m[2] == 7) - text = new String[] { "Sky Stinger Missile", m[0] + " / " + m[1], "Alt.: " + m[3] };*/ - else - text = new String[] { "Unknown Force", m[0] + " / " + m[1], "Alt.: " + m[3] }; + String[] text = new String[] { RadarTargetType.values()[m[2]].name, m[0] + " / " + m[1], "Alt.: " + m[3] }; this.func_146283_a(Arrays.asList(text), x, z); @@ -91,8 +74,8 @@ public class GUIMachineRadar extends GuiInfoContainer { if(!diFurnace.nearbyMissiles.isEmpty()) { for(int[] m : diFurnace.nearbyMissiles) { - int x = (int)((m[0] - diFurnace.xCoord) / ((double)MainRegistry.radarRange * 2 + 1) * (200D - 8D)) - 4; - int z = (int)((m[1] - diFurnace.zCoord) / ((double)MainRegistry.radarRange * 2 + 1) * (200D - 8D)) - 4; + int x = (int)((m[0] - diFurnace.xCoord) / ((double)WeaponConfig.radarRange * 2 + 1) * (200D - 8D)) - 4; + int z = (int)((m[1] - diFurnace.zCoord) / ((double)WeaponConfig.radarRange * 2 + 1) * (200D - 8D)) - 4; int t = m[2]; drawTexturedModalRect(guiLeft + 108 + x, guiTop + 117 + z, 216, 8 * t, 8, 8); diff --git a/src/main/java/com/hbm/items/food/ItemWaffle.java b/src/main/java/com/hbm/items/food/ItemWaffle.java index 60ed2060b..3d75bfe66 100644 --- a/src/main/java/com/hbm/items/food/ItemWaffle.java +++ b/src/main/java/com/hbm/items/food/ItemWaffle.java @@ -1,5 +1,6 @@ package com.hbm.items.food; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionParticle; import com.hbm.main.MainRegistry; @@ -18,7 +19,7 @@ public class ItemWaffle extends ItemFood { @Override public void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { - world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, (int)(MainRegistry.fatmanRadius * 1.5), player.posX, player.posY, player.posZ)); + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, (int)(BombConfig.fatmanRadius * 1.5), player.posX, player.posY, player.posZ)); ExplosionParticle.spawnMush(world, (int)player.posX, (int)player.posY - 3, (int)player.posZ); } diff --git a/src/main/java/com/hbm/items/special/ItemDrop.java b/src/main/java/com/hbm/items/special/ItemDrop.java index 54177cb15..5da1e1f51 100644 --- a/src/main/java/com/hbm/items/special/ItemDrop.java +++ b/src/main/java/com/hbm/items/special/ItemDrop.java @@ -4,6 +4,9 @@ import java.util.List; import org.apache.logging.log4j.Level; +import com.hbm.config.BombConfig; +import com.hbm.config.GeneralConfig; +import com.hbm.config.WeaponConfig; import com.hbm.entity.effect.EntityBlackHole; import com.hbm.entity.effect.EntityCloudFleija; import com.hbm.entity.effect.EntityRagingVortex; @@ -47,7 +50,7 @@ public class ItemDrop extends Item { { ((IBomb)entityItem.worldObj.getBlock(x, y, z)).explode(entityItem.worldObj, x, y, z); - if(MainRegistry.enableExtendedLogging) + if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[DET] Tried to detonate block at " + x + " / " + y + " / " + z + " by dead man's switch!"); } } @@ -59,11 +62,11 @@ public class ItemDrop extends Item { } } if (stack.getItem() != null && stack.getItem() == ModItems.detonator_de) { - if (!entityItem.worldObj.isRemote && MainRegistry.dropDead) { + if (!entityItem.worldObj.isRemote && WeaponConfig.dropDead) { entityItem.worldObj.createExplosion(entityItem, entityItem.posX, entityItem.posY, entityItem.posZ, 15.0F, true); - if(MainRegistry.enableExtendedLogging) + if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[DET] Detonated dead man's explosive at " + ((int)entityItem.posX) + " / " + ((int)entityItem.posY) + " / " + ((int)entityItem.posZ) + "!"); } @@ -72,19 +75,19 @@ public class ItemDrop extends Item { if (entityItem.onGround) { - if (stack.getItem() != null && stack.getItem() == ModItems.cell_antimatter && MainRegistry.dropCell) { + if (stack.getItem() != null && stack.getItem() == ModItems.cell_antimatter && WeaponConfig.dropCell) { if (!entityItem.worldObj.isRemote) { entityItem.worldObj.createExplosion(entityItem, entityItem.posX, entityItem.posY, entityItem.posZ, 10.0F, true); } } - if (stack.getItem() != null && stack.getItem() == ModItems.pellet_antimatter && MainRegistry.dropCell) { + if (stack.getItem() != null && stack.getItem() == ModItems.pellet_antimatter && WeaponConfig.dropCell) { if (!entityItem.worldObj.isRemote) { ExplosionLarge.explodeFire(entityItem.worldObj, entityItem.posX, entityItem.posY, entityItem.posZ, 100, true, true, true); } } - if (stack.getItem() != null && stack.getItem() == ModItems.cell_anti_schrabidium && MainRegistry.dropCell) { + if (stack.getItem() != null && stack.getItem() == ModItems.cell_anti_schrabidium && WeaponConfig.dropCell) { if (!entityItem.worldObj.isRemote) { entityItem.worldObj.playSoundEffect(entityItem.posX, entityItem.posY, entityItem.posZ, "random.explode", 100.0f, entityItem.worldObj.rand.nextFloat() * 0.1F + 0.9F); @@ -93,21 +96,21 @@ public class ItemDrop extends Item { entity.posX = entityItem.posX; entity.posY = entityItem.posY; entity.posZ = entityItem.posZ; - entity.destructionRange = MainRegistry.aSchrabRadius; + entity.destructionRange = BombConfig.aSchrabRadius; entity.speed = 25; entity.coefficient = 1.0F; entity.waste = false; entityItem.worldObj.spawnEntityInWorld(entity); - EntityCloudFleija cloud = new EntityCloudFleija(entityItem.worldObj, MainRegistry.aSchrabRadius); + EntityCloudFleija cloud = new EntityCloudFleija(entityItem.worldObj, BombConfig.aSchrabRadius); cloud.posX = entityItem.posX; cloud.posY = entityItem.posY; cloud.posZ = entityItem.posZ; entityItem.worldObj.spawnEntityInWorld(cloud); } } - if (stack.getItem() != null && stack.getItem() == ModItems.singularity && MainRegistry.dropSing) { + if (stack.getItem() != null && stack.getItem() == ModItems.singularity && WeaponConfig.dropSing) { if (!entityItem.worldObj.isRemote) { EntityVortex bl = new EntityVortex(entityItem.worldObj, 1.5F); @@ -117,7 +120,7 @@ public class ItemDrop extends Item { entityItem.worldObj.spawnEntityInWorld(bl); } } - if (stack.getItem() != null && stack.getItem() == ModItems.singularity_counter_resonant && MainRegistry.dropSing) { + if (stack.getItem() != null && stack.getItem() == ModItems.singularity_counter_resonant && WeaponConfig.dropSing) { if (!entityItem.worldObj.isRemote) { EntityVortex bl = new EntityVortex(entityItem.worldObj, 2.5F); @@ -127,7 +130,7 @@ public class ItemDrop extends Item { entityItem.worldObj.spawnEntityInWorld(bl); } } - if (stack.getItem() != null && stack.getItem() == ModItems.singularity_super_heated && MainRegistry.dropSing) { + if (stack.getItem() != null && stack.getItem() == ModItems.singularity_super_heated && WeaponConfig.dropSing) { if (!entityItem.worldObj.isRemote) { EntityVortex bl = new EntityVortex(entityItem.worldObj, 2.5F); @@ -137,7 +140,7 @@ public class ItemDrop extends Item { entityItem.worldObj.spawnEntityInWorld(bl); } } - if (stack.getItem() != null && stack.getItem() == ModItems.black_hole && MainRegistry.dropSing) { + if (stack.getItem() != null && stack.getItem() == ModItems.black_hole && WeaponConfig.dropSing) { if (!entityItem.worldObj.isRemote) { /*entityItem.worldObj.playSoundEffect(entityItem.posX, entityItem.posY, entityItem.posZ, "random.explode", 100.0f, entityItem.worldObj.rand.nextFloat() * 0.1F + 0.9F); @@ -161,7 +164,7 @@ public class ItemDrop extends Item { entityItem.worldObj.spawnEntityInWorld(bl); } } - if (stack.getItem() != null && stack.getItem() == ModItems.singularity_spark && MainRegistry.dropSing) { + if (stack.getItem() != null && stack.getItem() == ModItems.singularity_spark && WeaponConfig.dropSing) { if (!entityItem.worldObj.isRemote) { EntityRagingVortex bl = new EntityRagingVortex(entityItem.worldObj, 3.5F); bl.posX = entityItem.posX ; @@ -170,7 +173,7 @@ public class ItemDrop extends Item { entityItem.worldObj.spawnEntityInWorld(bl); } } - if (stack.getItem() != null && stack.getItem() == ModItems.crystal_xen && MainRegistry.dropCrys) { + if (stack.getItem() != null && stack.getItem() == ModItems.crystal_xen && WeaponConfig.dropCrys) { if (!entityItem.worldObj.isRemote) { ExplosionChaos.floater(entityItem.worldObj, (int)entityItem.posX, (int)entityItem.posY, (int)entityItem.posZ, 25, 75); ExplosionChaos.move(entityItem.worldObj, (int)entityItem.posX, (int)entityItem.posY, (int)entityItem.posZ, 25, 0, 75, 0); diff --git a/src/main/java/com/hbm/items/tool/ItemDetonator.java b/src/main/java/com/hbm/items/tool/ItemDetonator.java index 55b562158..cb256870a 100644 --- a/src/main/java/com/hbm/items/tool/ItemDetonator.java +++ b/src/main/java/com/hbm/items/tool/ItemDetonator.java @@ -4,6 +4,7 @@ import java.util.List; import org.apache.logging.log4j.Level; +import com.hbm.config.GeneralConfig; import com.hbm.interfaces.IBomb; import com.hbm.main.MainRegistry; @@ -75,7 +76,7 @@ public class ItemDetonator extends Item { { ((IBomb)world.getBlock(x, y, z)).explode(world, x, y, z); - if(MainRegistry.enableExtendedLogging) + if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[DET] Tried to detonate block at " + x + " / " + y + " / " + z + " by " + player.getDisplayName() + "!"); } if(world.isRemote) diff --git a/src/main/java/com/hbm/items/tool/ItemLaserDetonator.java b/src/main/java/com/hbm/items/tool/ItemLaserDetonator.java index da3f2233b..6df66aaa0 100644 --- a/src/main/java/com/hbm/items/tool/ItemLaserDetonator.java +++ b/src/main/java/com/hbm/items/tool/ItemLaserDetonator.java @@ -4,6 +4,7 @@ import java.util.List; import org.apache.logging.log4j.Level; +import com.hbm.config.GeneralConfig; import com.hbm.interfaces.IBomb; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -37,7 +38,7 @@ public class ItemLaserDetonator extends Item { if(world.getBlock(x, y, z) instanceof IBomb) { ((IBomb)world.getBlock(x, y, z)).explode(world, x, y, z); - if(MainRegistry.enableExtendedLogging) + if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[DET] Tried to detonate block at " + x + " / " + y + " / " + z + " by " + player.getDisplayName() + "!"); player.addChatMessage(new ChatComponentText("Detonated!")); diff --git a/src/main/java/com/hbm/items/tool/ItemMultiDetonator.java b/src/main/java/com/hbm/items/tool/ItemMultiDetonator.java index 2fc237aeb..68945f835 100644 --- a/src/main/java/com/hbm/items/tool/ItemMultiDetonator.java +++ b/src/main/java/com/hbm/items/tool/ItemMultiDetonator.java @@ -5,6 +5,7 @@ import java.util.List; import org.apache.commons.lang3.ArrayUtils; import org.apache.logging.log4j.Level; +import com.hbm.config.GeneralConfig; import com.hbm.interfaces.IBomb; import com.hbm.main.MainRegistry; @@ -89,7 +90,7 @@ public class ItemMultiDetonator extends Item { if (!world.isRemote) { ((IBomb) world.getBlock(x, y, z)).explode(world, x, y, z); - if(MainRegistry.enableExtendedLogging) + if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[DET] Tried to detonate block at " + x + " / " + y + " / " + z + " by " + player.getDisplayName() + "!"); } diff --git a/src/main/java/com/hbm/items/tool/ItemToolAbility.java b/src/main/java/com/hbm/items/tool/ItemToolAbility.java index 3677d76ba..173fc9e94 100644 --- a/src/main/java/com/hbm/items/tool/ItemToolAbility.java +++ b/src/main/java/com/hbm/items/tool/ItemToolAbility.java @@ -8,8 +8,9 @@ import java.util.Set; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; +import com.hbm.config.ToolConfig; import com.hbm.handler.ToolAbility; -import com.hbm.handler.ToolAbility.SilkAbility; +import com.hbm.handler.ToolAbility.*; import com.hbm.handler.WeaponAbility; import cpw.mods.fml.relauncher.Side; @@ -31,6 +32,7 @@ import net.minecraft.network.play.client.C07PacketPlayerDigging; import net.minecraft.network.play.server.S23PacketBlockChange; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; @@ -290,13 +292,26 @@ public class ItemToolAbility extends ItemTool implements IItemAbility { setAbility(stack, i % this.breakAbility.size()); + while(!isAbilityAllowed(getCurrentAbility(stack))) { + + player.addChatComponentMessage( + new ChatComponentText("[Ability ") + .appendSibling(new ChatComponentTranslation(getCurrentAbility(stack).getName(), new Object[0])) + .appendSibling(new ChatComponentText(getCurrentAbility(stack).getExtension() + " is blacklisted!]")) + .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + + i++; + setAbility(stack, i % this.breakAbility.size()); + } + if(getCurrentAbility(stack) != null) { player.addChatComponentMessage( new ChatComponentText("[Enabled ") .appendSibling(new ChatComponentTranslation(getCurrentAbility(stack).getName(), new Object[0])) - .appendSibling(new ChatComponentText(getCurrentAbility(stack).getExtension() + "]"))); + .appendSibling(new ChatComponentText(getCurrentAbility(stack).getExtension() + "]")) + .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW))); } else { - player.addChatComponentMessage(new ChatComponentText("[Tool ability deactivated]")); + player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GOLD + "[Tool ability deactivated]")); } world.playSoundAtEntity(player, "random.orb", 0.25F, getCurrentAbility(stack) == null ? 0.75F : 1.25F); @@ -304,6 +319,30 @@ public class ItemToolAbility extends ItemTool implements IItemAbility { return stack; } + //TODO: integrate "isAllowed" into the ability class + private boolean isAbilityAllowed(ToolAbility ability) { + + if(ability instanceof HammerAbility) + return ToolConfig.abilityHammer; + if(ability instanceof RecursionAbility) + return ToolConfig.abilityVein; + if(ability instanceof LuckAbility) + return ToolConfig.abilityLuck; + if(ability instanceof SilkAbility) + return ToolConfig.abilitySilk; + if(ability instanceof SmelterAbility) + return ToolConfig.abilityFurnace; + if(ability instanceof ShredderAbility) + return ToolConfig.abilityShredder; + if(ability instanceof CentrifugeAbility) + return ToolConfig.abilityCentrifuge; + if(ability instanceof CrystallizerAbility) + return ToolConfig.abilityCrystallizer; + + return true; + + } + private ToolAbility getCurrentAbility(ItemStack stack) { int ability = getAbility(stack) % this.breakAbility.size(); diff --git a/src/main/java/com/hbm/items/weapon/ItemGunBase.java b/src/main/java/com/hbm/items/weapon/ItemGunBase.java index 40d7f7080..b2c872485 100644 --- a/src/main/java/com/hbm/items/weapon/ItemGunBase.java +++ b/src/main/java/com/hbm/items/weapon/ItemGunBase.java @@ -5,6 +5,8 @@ import java.util.List; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; +import com.hbm.config.GeneralConfig; +import com.hbm.config.WeaponConfig; import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; @@ -120,7 +122,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon { setIsAltDown(stack, false); } - if(MainRegistry.enableGuns && mainConfig.firingMode == 1 && getIsMouseDown(stack) && tryShoot(stack, world, player, isCurrentItem)) { + if(GeneralConfig.enableGuns && mainConfig.firingMode == 1 && getIsMouseDown(stack) && tryShoot(stack, world, player, isCurrentItem)) { fire(stack, world, player); setDelay(stack, mainConfig.rateOfFire); @@ -499,7 +501,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon { list.add(EnumChatFormatting.ITALIC + s); } - if(MainRegistry.enableExtendedLogging) { + if(GeneralConfig.enableExtendedLogging) { list.add(""); list.add("Type: " + getMagType(stack)); list.add("Is Reloading: " + getIsReloading(stack)); diff --git a/src/main/java/com/hbm/items/weapon/WeaponizedCell.java b/src/main/java/com/hbm/items/weapon/WeaponizedCell.java index 27d8cab7b..7d7593484 100644 --- a/src/main/java/com/hbm/items/weapon/WeaponizedCell.java +++ b/src/main/java/com/hbm/items/weapon/WeaponizedCell.java @@ -2,6 +2,7 @@ package com.hbm.items.weapon; import java.util.List; +import com.hbm.config.WeaponConfig; import com.hbm.entity.effect.EntityCloudFleijaRainbow; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.main.MainRegistry; @@ -22,7 +23,7 @@ public class WeaponizedCell extends Item { if(!world.isRemote) { - if(MainRegistry.dropStar) { + if(WeaponConfig.dropStar) { world.playSoundEffect(item.posX, item.posY, item.posZ, "random.explode", 100.0f, world.rand.nextFloat() * 0.1F + 0.9F); diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index 517e8bc1a..25cc2902b 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -3,6 +3,8 @@ package com.hbm.lib; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; +import com.hbm.config.WorldConfig; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; import com.hbm.tileentity.machine.TileEntitySafe; @@ -52,7 +54,7 @@ public class HbmWorldGen implements IWorldGenerator { case 1: generateEnd(world, rand, chunkX * 16, chunkZ * 16); break; default: - if(MainRegistry.enableMDOres) + if(GeneralConfig.enableMDOres) generateSurface(world, rand, chunkX * 16, chunkZ * 16); break; } @@ -60,7 +62,7 @@ public class HbmWorldGen implements IWorldGenerator { private void generateSurface(World world, Random rand, int i, int j) { // Ore stains per chunk - for (int k = 0; k < MainRegistry.uraniumSpawn; k++) { + for (int k = 0; k < WorldConfig.uraniumSpawn; k++) { int randPosX = i + rand.nextInt(16); // Max height of generation int randPosY = rand.nextInt(25); @@ -70,7 +72,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_uranium, 5)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.thoriumSpawn; k++) { + for (int k = 0; k < WorldConfig.thoriumSpawn; k++) { int randPosX = i + rand.nextInt(16); // Max height of generation int randPosY = rand.nextInt(30); @@ -80,7 +82,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_thorium, 5)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.titaniumSpawn; k++) { + for (int k = 0; k < WorldConfig.titaniumSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(35); int randPosZ = j + rand.nextInt(16); @@ -88,7 +90,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_titanium, 6)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.sulfurSpawn; k++) { + for (int k = 0; k < WorldConfig.sulfurSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(35); int randPosZ = j + rand.nextInt(16); @@ -96,7 +98,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_sulfur, 8)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.aluminiumSpawn; k++) { + for (int k = 0; k < WorldConfig.aluminiumSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(45); int randPosZ = j + rand.nextInt(16); @@ -104,7 +106,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_aluminium, 6)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.copperSpawn; k++) { + for (int k = 0; k < WorldConfig.copperSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(50); int randPosZ = j + rand.nextInt(16); @@ -112,7 +114,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_copper, 6)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.fluoriteSpawn; k++) { + for (int k = 0; k < WorldConfig.fluoriteSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(40); int randPosZ = j + rand.nextInt(16); @@ -120,7 +122,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_fluorite, 4)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.niterSpawn; k++) { + for (int k = 0; k < WorldConfig.niterSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(35); int randPosZ = j + rand.nextInt(16); @@ -128,7 +130,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_niter, 6)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.tungstenSpawn; k++) { + for (int k = 0; k < WorldConfig.tungstenSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(35); int randPosZ = j + rand.nextInt(16); @@ -136,7 +138,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_tungsten, 8)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.leadSpawn; k++) { + for (int k = 0; k < WorldConfig.leadSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(35); int randPosZ = j + rand.nextInt(16); @@ -144,7 +146,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_lead, 9)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.berylliumSpawn; k++) { + for (int k = 0; k < WorldConfig.berylliumSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(35); int randPosZ = j + rand.nextInt(16); @@ -206,7 +208,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_verticium, 16)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.niterSpawn; k++) { + for (int k = 0; k < WorldConfig.niterSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(25); int randPosZ = j + rand.nextInt(16); @@ -214,7 +216,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_rare, 5)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.ligniteSpawn; k++) { + for (int k = 0; k < WorldConfig.ligniteSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(25) + 35; int randPosZ = j + rand.nextInt(16); @@ -222,7 +224,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_lignite, 24)).generate(world, rand, randPosX, randPosY, randPosZ); } - for (int k = 0; k < MainRegistry.asbestosSpawn; k++) { + for (int k = 0; k < WorldConfig.asbestosSpawn; k++) { int randPosX = i + rand.nextInt(16); int randPosY = rand.nextInt(16) + 16; int randPosZ = j + rand.nextInt(16); @@ -240,12 +242,12 @@ public class HbmWorldGen implements IWorldGenerator { } }*/ - if (MainRegistry.enableDungeons) { + if (GeneralConfig.enableDungeons) { BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, j); if (biome == BiomeGenBase.plains || biome == BiomeGenBase.desert) { - if (MainRegistry.radioStructure > 0 && rand.nextInt(MainRegistry.radioStructure) == 0) { + if (WorldConfig.radioStructure > 0 && rand.nextInt(WorldConfig.radioStructure) == 0) { for (int a = 0; a < 1; a++) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); @@ -258,7 +260,7 @@ public class HbmWorldGen implements IWorldGenerator { if (biome == BiomeGenBase.plains || biome == BiomeGenBase.forest || biome == BiomeGenBase.desert || biome == BiomeGenBase.swampland || biome == BiomeGenBase.extremeHills) { - if (MainRegistry.antennaStructure > 0 && rand.nextInt(MainRegistry.antennaStructure) == 0) { + if (WorldConfig.antennaStructure > 0 && rand.nextInt(WorldConfig.antennaStructure) == 0) { for (int a = 0; a < 1; a++) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); @@ -271,7 +273,7 @@ public class HbmWorldGen implements IWorldGenerator { if (biome == BiomeGenBase.desert || biome == BiomeGenBase.beach || biome == BiomeGenBase.mesa || biome == BiomeGenBase.mesaPlateau) { - if (MainRegistry.atomStructure > 0 && rand.nextInt(MainRegistry.atomStructure) == 0) { + if (WorldConfig.atomStructure > 0 && rand.nextInt(WorldConfig.atomStructure) == 0) { for (int a = 0; a < 1; a++) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); @@ -283,7 +285,7 @@ public class HbmWorldGen implements IWorldGenerator { } if (biome == BiomeGenBase.desert) { - if (MainRegistry.vertibirdStructure > 0 && rand.nextInt(MainRegistry.vertibirdStructure) == 0) { + if (WorldConfig.vertibirdStructure > 0 && rand.nextInt(WorldConfig.vertibirdStructure) == 0) { for (int a = 0; a < 1; a++) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); @@ -299,7 +301,7 @@ public class HbmWorldGen implements IWorldGenerator { } } - if (MainRegistry.dungeonStructure > 0 && rand.nextInt(MainRegistry.dungeonStructure) == 0) { + if (WorldConfig.dungeonStructure > 0 && rand.nextInt(WorldConfig.dungeonStructure) == 0) { int x = i + rand.nextInt(16); int y = rand.nextInt(256); int z = j + rand.nextInt(16); @@ -307,7 +309,7 @@ public class HbmWorldGen implements IWorldGenerator { } if (biome == BiomeGenBase.plains || biome == BiomeGenBase.desert) { - if (MainRegistry.relayStructure > 0 && rand.nextInt(MainRegistry.relayStructure) == 0) { + if (WorldConfig.relayStructure > 0 && rand.nextInt(WorldConfig.relayStructure) == 0) { for (int a = 0; a < 1; a++) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); @@ -318,7 +320,7 @@ public class HbmWorldGen implements IWorldGenerator { } } if (biome == BiomeGenBase.plains || biome == BiomeGenBase.desert) { - if (MainRegistry.satelliteStructure > 0 && rand.nextInt(MainRegistry.satelliteStructure) == 0) { + if (WorldConfig.satelliteStructure > 0 && rand.nextInt(WorldConfig.satelliteStructure) == 0) { for (int a = 0; a < 1; a++) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); @@ -340,7 +342,7 @@ public class HbmWorldGen implements IWorldGenerator { } } - if (MainRegistry.bunkerStructure > 0 && rand.nextInt(MainRegistry.bunkerStructure) == 0) { + if (WorldConfig.bunkerStructure > 0 && rand.nextInt(WorldConfig.bunkerStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -348,7 +350,7 @@ public class HbmWorldGen implements IWorldGenerator { new Bunker().generate(world, rand, x, y, z); } - if (MainRegistry.siloStructure > 0 && rand.nextInt(MainRegistry.siloStructure) == 0) { + if (WorldConfig.siloStructure > 0 && rand.nextInt(WorldConfig.siloStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -356,7 +358,7 @@ public class HbmWorldGen implements IWorldGenerator { new Silo().generate(world, rand, x, y, z); } - if (MainRegistry.factoryStructure > 0 && rand.nextInt(MainRegistry.factoryStructure) == 0) { + if (WorldConfig.factoryStructure > 0 && rand.nextInt(WorldConfig.factoryStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -364,7 +366,7 @@ public class HbmWorldGen implements IWorldGenerator { new Factory().generate(world, rand, x, y, z); } - if (MainRegistry.dudStructure > 0 && rand.nextInt(MainRegistry.dudStructure) == 0) { + if (WorldConfig.dudStructure > 0 && rand.nextInt(WorldConfig.dudStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -372,7 +374,7 @@ public class HbmWorldGen implements IWorldGenerator { new Dud().generate(world, rand, x, y, z); } - if (MainRegistry.spaceshipStructure > 0 && rand.nextInt(MainRegistry.spaceshipStructure) == 0) { + if (WorldConfig.spaceshipStructure > 0 && rand.nextInt(WorldConfig.spaceshipStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -380,7 +382,7 @@ public class HbmWorldGen implements IWorldGenerator { new Spaceship().generate(world, rand, x, y, z); } - if (MainRegistry.barrelStructure > 0 && biome == BiomeGenBase.desert && rand.nextInt(MainRegistry.barrelStructure) == 0) { + if (WorldConfig.barrelStructure > 0 && biome == BiomeGenBase.desert && rand.nextInt(WorldConfig.barrelStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -388,7 +390,7 @@ public class HbmWorldGen implements IWorldGenerator { new Barrel().generate(world, rand, x, y, z); } - if (MainRegistry.broadcaster > 0 && rand.nextInt(MainRegistry.broadcaster) == 0) { + if (WorldConfig.broadcaster > 0 && rand.nextInt(WorldConfig.broadcaster) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -396,12 +398,12 @@ public class HbmWorldGen implements IWorldGenerator { 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(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("[Debug] Successfully spawned corrupted broadcaster at " + x + " " + (y) +" " + z); } } - if (MainRegistry.minefreq > 0 && MainRegistry.enableMines && rand.nextInt(MainRegistry.minefreq) == 0) { + if (WorldConfig.minefreq > 0 && GeneralConfig.enableMines && rand.nextInt(WorldConfig.minefreq) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -409,12 +411,12 @@ public class HbmWorldGen implements IWorldGenerator { if(world.getBlock(x, y - 1, z).canPlaceTorchOnTop(world, x, y - 1, z)) { world.setBlock(x, y, z, ModBlocks.mine_ap); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("[Debug] Successfully spawned landmine at " + x + " " + (y) +" " + z); } } - if (MainRegistry.radfreq > 0 && MainRegistry.enableRad && rand.nextInt(MainRegistry.radfreq) == 0 && biome == BiomeGenBase.desert) { + if (WorldConfig.radfreq > 0 && GeneralConfig.enableRad && rand.nextInt(WorldConfig.radfreq) == 0 && biome == BiomeGenBase.desert) { for (int a = 0; a < 1; a++) { int x = i + rand.nextInt(16); @@ -427,12 +429,12 @@ public class HbmWorldGen implements IWorldGenerator { new Sellafield().generate(world, x, z, r, r * 0.35D); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("[Debug] Successfully spawned raditation hotspot at " + x + " " + z); } } - if (MainRegistry.geyserWater > 0 && biome == BiomeGenBase.plains && rand.nextInt(MainRegistry.geyserWater) == 0) { + if (WorldConfig.geyserWater > 0 && biome == BiomeGenBase.plains && rand.nextInt(WorldConfig.geyserWater) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -441,7 +443,7 @@ public class HbmWorldGen implements IWorldGenerator { new Geyser().generate(world, rand, x, y, z); } - if (MainRegistry.geyserChlorine > 0 && biome == BiomeGenBase.desert && rand.nextInt(MainRegistry.geyserChlorine) == 0) { + if (WorldConfig.geyserChlorine > 0 && biome == BiomeGenBase.desert && rand.nextInt(WorldConfig.geyserChlorine) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -450,7 +452,7 @@ public class HbmWorldGen implements IWorldGenerator { new GeyserLarge().generate(world, rand, x, y, z); } - if (MainRegistry.capsuleStructure > 0 && biome == BiomeGenBase.beach && rand.nextInt(MainRegistry.capsuleStructure) == 0) { + if (WorldConfig.capsuleStructure > 0 && biome == BiomeGenBase.beach && rand.nextInt(WorldConfig.capsuleStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z) - 4; @@ -465,12 +467,12 @@ public class HbmWorldGen implements IWorldGenerator { cap.setInventorySlotContents(rand.nextInt(cap.getSizeInventory()), new ItemStack(ModItems.record_glass)); } - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("[Debug] Successfully spawned capsule at " + x + " " + z); } } - if (MainRegistry.geyserVapor > 0 && rand.nextInt(MainRegistry.geyserVapor) == 0) { + if (WorldConfig.geyserVapor > 0 && rand.nextInt(WorldConfig.geyserVapor) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -492,11 +494,11 @@ public class HbmWorldGen implements IWorldGenerator { } } - if(MainRegistry.enableDebugMode && done) + if(GeneralConfig.enableDebugMode && done) MainRegistry.logger.info("[Debug] Successfully spawned pink tree at " + x + " " + z); } - if (MainRegistry.vaultfreq > 0 && MainRegistry.enableVaults && rand.nextInt(MainRegistry.vaultfreq) == 0) { + if (WorldConfig.vaultfreq > 0 && GeneralConfig.enableVaults && rand.nextInt(WorldConfig.vaultfreq) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); int y = world.getHeightValue(x, z); @@ -537,19 +539,19 @@ public class HbmWorldGen implements IWorldGenerator { break; } - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("[Debug] Successfully spawned safe at " + x + " " + (y + 1) +" " + z); } } - if (MainRegistry.meteorStructure > 0 && rand.nextInt(MainRegistry.meteorStructure) == 0) { + if (WorldConfig.meteorStructure > 0 && rand.nextInt(WorldConfig.meteorStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); CellularDungeonFactory.meteor.generate(world, x, 10, z, rand); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("[Debug] Successfully spawned meteor dungeon at " + x + " 10 " + z); int y = world.getHeightValue(x, z); @@ -583,7 +585,7 @@ public class HbmWorldGen implements IWorldGenerator { OilBubble.spawnOil(world, randPosX, randPosY, randPosZ, 7 + rand.nextInt(9)); } - if (MainRegistry.enableNITAN) { + if (GeneralConfig.enableNITAN) { if (i <= 10000 && i + 16 >= 10000 && j <= 10000 && j + 16 >= 10000) { if (world.getBlock(10000, 250, 10000) == Blocks.air) { @@ -671,7 +673,7 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_nether_uranium, 6, Blocks.netherrack)).generate(world, rand, randPosX, randPosY, randPosZ); } - if(MainRegistry.enablePlutoniumOre) + if(GeneralConfig.enablePlutoniumOre) { for (int k = 0; k < 6; k++) { diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index d88b0e6cc..8d2ee04a7 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -33,6 +33,14 @@ import java.util.Random; import org.apache.logging.log4j.Logger; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; +import com.hbm.config.GeneralConfig; +import com.hbm.config.MachineConfig; +import com.hbm.config.PotionConfig; +import com.hbm.config.RadiationConfig; +import com.hbm.config.ToolConfig; +import com.hbm.config.WeaponConfig; +import com.hbm.config.WorldConfig; import com.hbm.creativetabs.*; import com.hbm.entity.effect.*; import com.hbm.entity.grenade.*; @@ -89,8 +97,7 @@ public class MainRegistry { // Tool Materials public static ToolMaterial tMatSchrab = EnumHelper.addToolMaterial("SCHRABIDIUM", 3, 10000, 50.0F, 100.0F, 200); - public static ToolMaterial tMatHammmer = EnumHelper.addToolMaterial("SCHRABIDIUMHAMMER", 3, 0, 50.0F, 999999996F, - 200); + public static ToolMaterial tMatHammmer = EnumHelper.addToolMaterial("SCHRABIDIUMHAMMER", 3, 0, 50.0F, 999999996F, 200); public static ToolMaterial tMatChainsaw = EnumHelper.addToolMaterial("CHAINSAW", 3, 1500, 50.0F, 22.0F, 0); public static ToolMaterial tMatSteel = EnumHelper.addToolMaterial("HBM_STEEL", 2, 500, 7.5F, 2.0F, 10); public static ToolMaterial tMatTitan = EnumHelper.addToolMaterial("HBM_TITANIUM", 3, 750, 9.0F, 2.5F, 15); @@ -113,31 +120,23 @@ public class MainRegistry { public static ToolMaterial enumToolMaterialMultitool = EnumHelper.addToolMaterial("MULTITOOL", 3, 5000, 25F, 5.5F, 25); // Armor Materials - public static ArmorMaterial enumArmorMaterialEmerald = EnumHelper.addArmorMaterial("HBM_TEST", 2500, - new int[] { 3, 8, 6, 3 }, 30); - public static ArmorMaterial aMatSchrab = EnumHelper.addArmorMaterial("HBM_SCHRABIDIUM", 100, - new int[] { 3, 8, 6, 3 }, 50); - public static ArmorMaterial aMatEuph = EnumHelper.addArmorMaterial("HBM_EUPHEMIUM", 15000000, - new int[] { 3, 8, 6, 3 }, 100); + public static ArmorMaterial enumArmorMaterialEmerald = EnumHelper.addArmorMaterial("HBM_TEST", 2500, new int[] { 3, 8, 6, 3 }, 30); + public static ArmorMaterial aMatSchrab = EnumHelper.addArmorMaterial("HBM_SCHRABIDIUM", 100, new int[] { 3, 8, 6, 3 }, 50); + public static ArmorMaterial aMatEuph = EnumHelper.addArmorMaterial("HBM_EUPHEMIUM", 15000000, new int[] { 3, 8, 6, 3 }, 100); public static ArmorMaterial aMatHaz = EnumHelper.addArmorMaterial("HBM_HAZMAT", 60, new int[] { 2, 5, 4, 1 }, 5); public static ArmorMaterial aMatHaz2 = EnumHelper.addArmorMaterial("HBM_HAZMAT2", 60, new int[] { 2, 5, 4, 1 }, 5); public static ArmorMaterial aMatHaz3 = EnumHelper.addArmorMaterial("HBM_HAZMAT3", 60, new int[] { 2, 5, 4, 1 }, 5); public static ArmorMaterial aMatT45 = EnumHelper.addArmorMaterial("HBM_T45", 1000, new int[] { 2, 5, 4, 1 }, 0); public static ArmorMaterial aMatSteel = EnumHelper.addArmorMaterial("HBM_STEEL", 20, new int[] { 2, 6, 5, 2 }, 5); - public static ArmorMaterial aMatAsbestos = EnumHelper.addArmorMaterial("HBM_ASBESTOS", 20, new int[] { 1, 4, 3, 1 }, - 5); - public static ArmorMaterial aMatTitan = EnumHelper.addArmorMaterial("HBM_TITANIUM", 25, new int[] { 3, 8, 6, 3 }, - 9); + public static ArmorMaterial aMatAsbestos = EnumHelper.addArmorMaterial("HBM_ASBESTOS", 20, new int[] { 1, 4, 3, 1 }, 5); + public static ArmorMaterial aMatTitan = EnumHelper.addArmorMaterial("HBM_TITANIUM", 25, new int[] { 3, 8, 6, 3 }, 9); public static ArmorMaterial aMatAlloy = EnumHelper.addArmorMaterial("HBM_ALLOY", 40, new int[] { 3, 8, 6, 3 }, 12); public static ArmorMaterial aMatPaa = EnumHelper.addArmorMaterial("HBM_PAA", 75, new int[] { 3, 8, 6, 3 }, 25); public static ArmorMaterial aMatCMB = EnumHelper.addArmorMaterial("HBM_CMB", 60, new int[] { 3, 8, 6, 3 }, 50); public static ArmorMaterial aMatAus3 = EnumHelper.addArmorMaterial("HBM_AUSIII", 375, new int[] { 2, 6, 5, 2 }, 0); - public static ArmorMaterial aMatSecurity = EnumHelper.addArmorMaterial("HBM_SECURITY", 100, - new int[] { 3, 8, 6, 3 }, 15); - public static ArmorMaterial aMatCobalt = EnumHelper.addArmorMaterial("HBM_COBALT", 70, new int[] { 3, 8, 6, 3 }, - 25); - public static ArmorMaterial aMatStarmetal = EnumHelper.addArmorMaterial("HBM_STARMETAL", 150, - new int[] { 3, 8, 6, 3 }, 100); + public static ArmorMaterial aMatSecurity = EnumHelper.addArmorMaterial("HBM_SECURITY", 100, new int[] { 3, 8, 6, 3 }, 15); + public static ArmorMaterial aMatCobalt = EnumHelper.addArmorMaterial("HBM_COBALT", 70, new int[] { 3, 8, 6, 3 }, 25); + public static ArmorMaterial aMatStarmetal = EnumHelper.addArmorMaterial("HBM_STARMETAL", 150, new int[] { 3, 8, 6, 3 }, 100); // Creative Tabs // ingots, nuggets, wires, machine parts @@ -185,131 +184,11 @@ public class MainRegistry { public static Achievement horizonsEnd; public static Achievement horizonsBonus; - public static boolean enableDebugMode = true; - public static boolean enableMycelium = false; - public static boolean enablePlutoniumOre = false; - public static boolean enableDungeons = true; - public static boolean enableMDOres = true; - public static boolean enableMines = true; - public static boolean enableRad = true; - public static boolean enableNITAN = true; - public static boolean enableNukeClouds = true; - public static boolean enableAutoCleanup = false; - public static boolean enableMeteorStrikes = true; - public static boolean enableMeteorShowers = true; - public static boolean enableMeteorTails = true; - public static boolean enableSpecialMeteors = true; - public static boolean enableBomberShortMode = false; - public static boolean enableVaults = true; - public static boolean enableRads = true; - public static boolean enableCataclysm = false; - public static boolean enableExtendedLogging = false; - public static boolean enableHardcoreTaint = false; - public static boolean enableGuns = true; - public static boolean enableVirus = true; - public static boolean enableCrosshairs = true; - public static final int schrabFromUraniumChance = 100; - public static int uraniumSpawn = 6; - public static int thoriumSpawn = 7; - public static int titaniumSpawn = 8; - public static int sulfurSpawn = 5; - public static int aluminiumSpawn = 7; - public static int copperSpawn = 12; - public static int fluoriteSpawn = 6; - public static int niterSpawn = 6; - public static int tungstenSpawn = 10; - public static int leadSpawn = 6; - public static int berylliumSpawn = 6; - public static int ligniteSpawn = 2; - public static int asbestosSpawn = 2; - - public static int gadgetRadius = 150; - public static int boyRadius = 120; - public static int manRadius = 175; - public static int mikeRadius = 250; - public static int tsarRadius = 500; - public static int prototypeRadius = 150; - public static int fleijaRadius = 50; - public static int soliniumRadius = 75; - public static int n2Radius = 100; - public static int missileRadius = 100; - public static int mirvRadius = 100; - public static int fatmanRadius = 35; - public static int nukaRadius = 25; - public static int aSchrabRadius = 20; - - public static int blastSpeed = 1024; - public static int falloutRange = 100; - public static int fSpeed = 256; - // public static int falloutDura = 100; - - public static int radioStructure = 500; - public static int antennaStructure = 250; - public static int atomStructure = 500; - public static int vertibirdStructure = 500; - public static int dungeonStructure = 64; - public static int relayStructure = 500; - public static int satelliteStructure = 500; - public static int bunkerStructure = 1000; - public static int siloStructure = 1000; - public static int factoryStructure = 1000; - public static int dudStructure = 500; - public static int spaceshipStructure = 1000; - public static int barrelStructure = 5000; - public static int geyserWater = 3000; - public static int geyserChlorine = 3000; - public static int geyserVapor = 500; - public static int meteorStructure = 15000; - public static int capsuleStructure = 100; - - public static int broadcaster = 5000; - public static int minefreq = 64; - public static int radfreq = 5000; - public static int vaultfreq = 2500; - - public static int meteorStrikeChance = 20 * 60 * 180; - public static int meteorShowerChance = 20 * 60 * 5; - public static int meteorShowerDuration = 6000; - public static int limitExplosionLifespan = 0; - public static int radarRange = 1000; - public static int radarBuffer = 30; - public static int radarAltitude = 55; - public static int ciwsHitrate = 50; - - public static int mk4 = 1024; - public static int rain = 0; - public static int cont = 0; - public static int fogRad = 100; - public static int fogCh = 20; - public static float hellRad = 0.1F; - public static int worldRad = 10; - public static int worldRadThreshold = 20; - public static int generalOverride = 0; public static int polaroidID = 1; - public static boolean dropCell = true; - public static boolean dropSing = true; - public static boolean dropStar = true; - public static boolean dropCrys = true; - public static boolean dropDead = true; - - public static int recursionDepth = 500; - public static boolean recursiveStone = true; - public static boolean recursiveNetherrack = true; - - public static int taintID = 62; - public static int radiationID = 63; - public static int bangID = 64; - public static int mutationID = 65; - public static int radxID = 66; - public static int leadID = 67; - public static int radawayID = 68; - public static int telekinesisID = 69; - public static int phosphorusID = 70; - public static int x; public static int y; public static int z; @@ -699,8 +578,11 @@ public class MainRegistry { EntityRegistry.registerGlobalEntityID(EntityTaintCrab.class, "entity_taint_crab", EntityRegistry.findGlobalUniqueEntityId(), 0xAAAAAA, 0xFF00FF); EntityRegistry.registerGlobalEntityID(EntityMaskMan.class, "entity_mob_mask_man", EntityRegistry.findGlobalUniqueEntityId(), 0x818572, 0xC7C1B7); - EntityRegistry.registerGlobalEntityID(EntityBOTPrimeHead.class, "entity_balls_o_tron_mk0", EntityRegistry.findGlobalUniqueEntityId(), 0xAAAAAA, 0xAAAAAA); - EntityRegistry.registerModEntity(EntityBOTPrimeBody.class, "entity_balls_o_tron_mk0_segfault", 148, this, 1000, 1, true); + // EntityRegistry.registerGlobalEntityID(EntityBOTPrimeHead.class, + // "entity_balls_o_tron_mk0", EntityRegistry.findGlobalUniqueEntityId(), + // 0xAAAAAA, 0xAAAAAA); + // EntityRegistry.registerModEntity(EntityBOTPrimeBody.class, + // "entity_balls_o_tron_mk0_segfault", 148, this, 1000, 1, true); ForgeChunkManager.setForcedChunkLoadingCallback(this, new LoadingCallback() { @@ -769,14 +651,12 @@ public class MainRegistry { return new EntityGrenadeGas(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_schrabidium, - new BehaviorProjectileDispense() { + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_schrabidium, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeSchrabidium(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeSchrabidium(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_nuke, new BehaviorProjectileDispense() { protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { @@ -837,14 +717,12 @@ public class MainRegistry { return new EntityGrenadeShrapnel(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_black_hole, - new BehaviorProjectileDispense() { + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_black_hole, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeBlackHole(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeBlackHole(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_gascan, new BehaviorProjectileDispense() { protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { @@ -857,13 +735,12 @@ public class MainRegistry { return new EntityGrenadeCloud(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_pink_cloud, - new BehaviorProjectileDispense() { + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_pink_cloud, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadePC(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); - } - }); + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadePC(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_smart, new BehaviorProjectileDispense() { protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { @@ -888,14 +765,12 @@ public class MainRegistry { return new EntityGrenadeBurst(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_generic, - new BehaviorProjectileDispense() { + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_generic, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeIFGeneric(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeIFGeneric(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_he, new BehaviorProjectileDispense() { protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { @@ -920,58 +795,48 @@ public class MainRegistry { return new EntityGrenadeIFImpact(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_incendiary, - new BehaviorProjectileDispense() { + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_incendiary, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeIFIncendiary(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeIFIncendiary(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_toxic, new BehaviorProjectileDispense() { protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { return new EntityGrenadeIFToxic(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_concussion, - new BehaviorProjectileDispense() { + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_concussion, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeIFConcussion(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_brimstone, - new BehaviorProjectileDispense() { + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeIFConcussion(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_brimstone, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeIFBrimstone(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_mystery, - new BehaviorProjectileDispense() { + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeIFBrimstone(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_mystery, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeIFMystery(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeIFMystery(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_spark, new BehaviorProjectileDispense() { protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { return new EntityGrenadeIFSpark(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); } }); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_hopwire, - new BehaviorProjectileDispense() { + BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_hopwire, new BehaviorProjectileDispense() { - protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { - return new EntityGrenadeIFHopwire(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), - p_82499_2_.getZ()); - } - }); + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityGrenadeIFHopwire(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_null, new BehaviorProjectileDispense() { protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { @@ -982,86 +847,61 @@ public class MainRegistry { @EventHandler public static void load(FMLInitializationEvent event) { - /* - * achievementGetTitanium = new Achievement("achievement.getTitanium", - * "getTitanium", 0, -6, ModItems.ingot_titanium, - * (Achievement)null).initIndependentStat() .registerStat(); - * achievementCraftAlloyFurnace = new - * Achievement("achievement.craftAlloyFurnace", "craftAlloyFurnace", -2, - * -4, Item.getItemFromBlock(ModBlocks.machine_difurnace_off), - * (Achievement)null).initIndependentStat() .registerStat(); - * achievementCraftBreedingReactor = new - * Achievement("achievement.craftBreedingReactor", - * "craftBreedingReactor", 2, -4, - * Item.getItemFromBlock(ModBlocks.machine_reactor), - * (Achievement)null).initIndependentStat() .registerStat(); - * achievementCraftCentrifuge = new - * Achievement("achievement.craftCentrifuge", "craftCentrifuge", 2, -2, - * Item.getItemFromBlock(ModBlocks.machine_centrifuge), - * achievementCraftBreedingReactor).initIndependentStat() - * .registerStat(); AchievementPage.registerAchievementPage(new - * AchievementPage("NTM Achievements", new Achievement[]{ - * achievementGetTitanium, achievementCraftAlloyFurnace, - * achievementCraftBreedingReactor, achievementCraftCentrifuge })); - */ - achSacrifice = new Achievement("achievement.sacrifice", "sacrifice", 0, -2, ModItems.burnt_bark, null) - .initIndependentStat().setSpecial().registerStat(); - achImpossible = new Achievement("achievement.impossible", "impossible", 2, -2, ModItems.nothing, null) - .initIndependentStat().setSpecial().registerStat(); - achTOB = new Achievement("achievement.tasteofblood", "tasteofblood", 0, 0, - new ItemStack(ModItems.fluid_icon, 1, FluidType.ASCHRAB.getID()), null).initIndependentStat() - .setSpecial().registerStat(); - achFreytag = new Achievement("achievement.freytag", "freytag", 0, -4, ModItems.gun_mp40, null) - .initIndependentStat().setSpecial().registerStat(); - achSelenium = new Achievement("achievement.selenium", "selenium", -2, -4, ModItems.ingot_starmetal, null) - .initIndependentStat().setSpecial().registerStat(); - achPotato = new Achievement("achievement.potato", "potato", -2, -2, ModItems.battery_potatos, null) - .initIndependentStat().setSpecial().registerStat(); - achC44 = new Achievement("achievement.c44", "c44", 2, -4, ModItems.gun_revolver_pip, null).initIndependentStat() - .setSpecial().registerStat(); - achC20_5 = new Achievement("achievement.c20_5", "c20_5", 4, -4, ModItems.gun_dampfmaschine, null) - .initIndependentStat().setSpecial().registerStat(); - achSpace = new Achievement("achievement.space", "space", 4, -2, ModItems.missile_carrier, null) - .initIndependentStat().setSpecial().registerStat(); - achFOEQ = new Achievement("achievement.FOEQ", "FOEQ", 4, 0, ModItems.sat_foeq, null).initIndependentStat() - .setSpecial().registerStat(); - achFiend = new Achievement("achievement.fiend", "fiend", 6, -2, ModItems.shimmer_sledge, null) - .initIndependentStat().setSpecial().registerStat(); - achFiend2 = new Achievement("achievement.fiend2", "fiend2", 6, 0, ModItems.shimmer_axe, null) - .initIndependentStat().setSpecial().registerStat(); - achSoyuz = new Achievement("achievement.soyuz", "soyuz", -2, 0, Items.baked_potato, null).initIndependentStat() - .setSpecial().registerStat(); - bobMetalworks = new Achievement("achievement.metalworks", "metalworks", -2, 2, ModItems.bob_metalworks, null) - .initIndependentStat().registerStat(); - bobAssembly = new Achievement("achievement.assembly", "assembly", 0, 2, ModItems.bob_assembly, bobMetalworks) - .initIndependentStat().registerStat(); - bobChemistry = new Achievement("achievement.chemistry", "chemistry", 2, 2, ModItems.bob_chemistry, bobAssembly) - .initIndependentStat().registerStat(); - bobOil = new Achievement("achievement.oil", "oil", 4, 2, ModItems.bob_oil, bobChemistry).initIndependentStat() - .registerStat(); - bobNuclear = new Achievement("achievement.nuclear", "nuclear", 6, 2, ModItems.bob_nuclear, bobOil) - .initIndependentStat().registerStat(); - bobHidden = new Achievement("achievement.hidden", "hidden", 8, 2, ModItems.gun_dampfmaschine, bobNuclear) - .initIndependentStat().registerStat(); + achSacrifice = new Achievement("achievement.sacrifice", "sacrifice", 0, -2, ModItems.burnt_bark, null).initIndependentStat().setSpecial().registerStat(); + achImpossible = new Achievement("achievement.impossible", "impossible", 2, -2, ModItems.nothing, null).initIndependentStat().setSpecial().registerStat(); + achTOB = new Achievement("achievement.tasteofblood", "tasteofblood", 0, 0, new ItemStack(ModItems.fluid_icon, 1, FluidType.ASCHRAB.getID()), null).initIndependentStat().setSpecial().registerStat(); + achFreytag = new Achievement("achievement.freytag", "freytag", 0, -4, ModItems.gun_mp40, null).initIndependentStat().setSpecial().registerStat(); + achSelenium = new Achievement("achievement.selenium", "selenium", -2, -4, ModItems.ingot_starmetal, null).initIndependentStat().setSpecial().registerStat(); + achPotato = new Achievement("achievement.potato", "potato", -2, -2, ModItems.battery_potatos, null).initIndependentStat().setSpecial().registerStat(); + achC44 = new Achievement("achievement.c44", "c44", 2, -4, ModItems.gun_revolver_pip, null).initIndependentStat().setSpecial().registerStat(); + achC20_5 = new Achievement("achievement.c20_5", "c20_5", 4, -4, ModItems.gun_dampfmaschine, null).initIndependentStat().setSpecial().registerStat(); + achSpace = new Achievement("achievement.space", "space", 4, -2, ModItems.missile_carrier, null).initIndependentStat().setSpecial().registerStat(); + achFOEQ = new Achievement("achievement.FOEQ", "FOEQ", 4, 0, ModItems.sat_foeq, null).initIndependentStat().setSpecial().registerStat(); + achFiend = new Achievement("achievement.fiend", "fiend", 6, -2, ModItems.shimmer_sledge, null).initIndependentStat().setSpecial().registerStat(); + achFiend2 = new Achievement("achievement.fiend2", "fiend2", 6, 0, ModItems.shimmer_axe, null).initIndependentStat().setSpecial().registerStat(); + achSoyuz = new Achievement("achievement.soyuz", "soyuz", -2, 0, Items.baked_potato, null).initIndependentStat().setSpecial().registerStat(); - horizonsStart = new Achievement("achievement.horizonsStart", "horizonsStart", -2, 4, ModItems.sat_gerald, null) - .initIndependentStat().registerStat(); - horizonsEnd = new Achievement("achievement.horizonsEnd", "horizonsEnd", 0, 4, ModItems.sat_gerald, - horizonsStart).initIndependentStat().registerStat(); - horizonsBonus = new Achievement("achievement.horizonsBonus", "horizonsBonus", 2, 4, ModItems.sat_gerald, - horizonsEnd).initIndependentStat().registerStat().setSpecial(); + bobMetalworks = new Achievement("achievement.metalworks", "metalworks", -2, 2, ModItems.bob_metalworks, null).initIndependentStat().registerStat(); + bobAssembly = new Achievement("achievement.assembly", "assembly", 0, 2, ModItems.bob_assembly, bobMetalworks).initIndependentStat().registerStat(); + bobChemistry = new Achievement("achievement.chemistry", "chemistry", 2, 2, ModItems.bob_chemistry, bobAssembly).initIndependentStat().registerStat(); + bobOil = new Achievement("achievement.oil", "oil", 4, 2, ModItems.bob_oil, bobChemistry).initIndependentStat().registerStat(); + bobNuclear = new Achievement("achievement.nuclear", "nuclear", 6, 2, ModItems.bob_nuclear, bobOil).initIndependentStat().registerStat(); + bobHidden = new Achievement("achievement.hidden", "hidden", 8, 2, ModItems.gun_dampfmaschine, bobNuclear).initIndependentStat().registerStat(); - achRadPoison = new Achievement("achievement.radPoison", "radPoison", -2, 6, ModItems.geiger_counter, null) - .initIndependentStat().registerStat(); - achRadDeath = new Achievement("achievement.radDeath", "radDeath", 0, 6, Items.skull, achRadPoison) - .initIndependentStat().registerStat().setSpecial(); + horizonsStart = new Achievement("achievement.horizonsStart", "horizonsStart", -2, 4, ModItems.sat_gerald, null).initIndependentStat().registerStat(); + horizonsEnd = new Achievement("achievement.horizonsEnd", "horizonsEnd", 0, 4, ModItems.sat_gerald, horizonsStart).initIndependentStat().registerStat(); + horizonsBonus = new Achievement("achievement.horizonsBonus", "horizonsBonus", 2, 4, ModItems.sat_gerald, horizonsEnd).initIndependentStat().registerStat().setSpecial(); - AchievementPage.registerAchievementPage(new AchievementPage("Nuclear Tech", - new Achievement[] { achSacrifice, achImpossible, achTOB, achFreytag, achSelenium, achPotato, achC44, - achC20_5, achSpace, achFOEQ, achFiend, achFiend2, achSoyuz, bobMetalworks, bobAssembly, - bobChemistry, bobOil, bobNuclear, bobHidden, horizonsStart, horizonsEnd, horizonsBonus, - achRadPoison, achRadDeath })); + achRadPoison = new Achievement("achievement.radPoison", "radPoison", -2, 6, ModItems.geiger_counter, null).initIndependentStat().registerStat(); + achRadDeath = new Achievement("achievement.radDeath", "radDeath", 0, 6, Items.skull, achRadPoison).initIndependentStat().registerStat().setSpecial(); + + AchievementPage.registerAchievementPage(new AchievementPage("Nuclear Tech", new Achievement[] { + achSacrifice, + achImpossible, + achTOB, + achFreytag, + achSelenium, + achPotato, + achC44, + achC20_5, + achSpace, + achFOEQ, + achFiend, + achFiend2, + achSoyuz, + bobMetalworks, + bobAssembly, + bobChemistry, + bobOil, + bobNuclear, + bobHidden, + horizonsStart, + horizonsEnd, + horizonsBonus, + achRadPoison, + achRadDeath + })); // MUST be initialized AFTER achievements!! BobmazonOfferFactory.init(); @@ -1081,113 +921,63 @@ public class MainRegistry { TileEntityNukeCustom.registerBombItems(); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(Items.water_bucket), - new ItemStack(Items.bucket), FluidType.WATER, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(Items.lava_bucket), - new ItemStack(Items.bucket), FluidType.LAVA, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.bucket_mud), - new ItemStack(Items.bucket), FluidType.WATZ, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(Items.water_bucket), new ItemStack(Items.bucket), FluidType.WATER, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(Items.lava_bucket), new ItemStack(Items.bucket), FluidType.LAVA, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.bucket_mud), new ItemStack(Items.bucket), FluidType.WATZ, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_water), - new ItemStack(ModItems.rod_empty), FluidType.WATER, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_dual_water), - new ItemStack(ModItems.rod_dual_empty), FluidType.WATER, 2000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_quad_water), - new ItemStack(ModItems.rod_quad_empty), FluidType.WATER, 4000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_water), new ItemStack(ModItems.rod_empty), FluidType.WATER, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_dual_water), new ItemStack(ModItems.rod_dual_empty), FluidType.WATER, 2000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_quad_water), new ItemStack(ModItems.rod_quad_empty), FluidType.WATER, 4000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_coolant), - new ItemStack(ModItems.rod_empty), FluidType.COOLANT, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_dual_coolant), - new ItemStack(ModItems.rod_dual_empty), FluidType.COOLANT, 2000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_quad_coolant), - new ItemStack(ModItems.rod_quad_empty), FluidType.COOLANT, 4000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_coolant), new ItemStack(ModItems.rod_empty), FluidType.COOLANT, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_dual_coolant), new ItemStack(ModItems.rod_dual_empty), FluidType.COOLANT, 2000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_quad_coolant), new ItemStack(ModItems.rod_quad_empty), FluidType.COOLANT, 4000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_oil), - new ItemStack(ModItems.canister_empty), FluidType.OIL, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_smear), - new ItemStack(ModItems.canister_empty), FluidType.SMEAR, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_heavyoil), - new ItemStack(ModItems.canister_empty), FluidType.HEAVYOIL, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_bitumen), - new ItemStack(ModItems.canister_empty), FluidType.BITUMEN, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_heatingoil), - new ItemStack(ModItems.canister_empty), FluidType.HEATINGOIL, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_reoil), - new ItemStack(ModItems.canister_empty), FluidType.RECLAIMED, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_petroil), - new ItemStack(ModItems.canister_empty), FluidType.PETROIL, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_canola), - new ItemStack(ModItems.canister_empty), FluidType.LUBRICANT, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_naphtha), - new ItemStack(ModItems.canister_empty), FluidType.NAPHTHA, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_fuel), - new ItemStack(ModItems.canister_empty), FluidType.DIESEL, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_lightoil), - new ItemStack(ModItems.canister_empty), FluidType.LIGHTOIL, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_kerosene), - new ItemStack(ModItems.canister_empty), FluidType.KEROSENE, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_biofuel), - new ItemStack(ModItems.canister_empty), FluidType.BIOFUEL, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_NITAN), - new ItemStack(ModItems.canister_empty), FluidType.NITAN, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_full), - new ItemStack(ModItems.gas_empty), FluidType.GAS, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_petroleum), - new ItemStack(ModItems.gas_empty), FluidType.PETROLEUM, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_biogas), - new ItemStack(ModItems.gas_empty), FluidType.BIOGAS, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModBlocks.red_barrel), - new ItemStack(ModItems.tank_steel), FluidType.DIESEL, 10000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModBlocks.pink_barrel), - new ItemStack(ModItems.tank_steel), FluidType.KEROSENE, 10000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModBlocks.lox_barrel), - new ItemStack(ModItems.tank_steel), FluidType.OXYGEN, 10000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_oil), new ItemStack(ModItems.canister_empty), FluidType.OIL, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_smear), new ItemStack(ModItems.canister_empty), FluidType.SMEAR, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_heavyoil), new ItemStack(ModItems.canister_empty), FluidType.HEAVYOIL, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_bitumen), new ItemStack(ModItems.canister_empty), FluidType.BITUMEN, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_heatingoil), new ItemStack(ModItems.canister_empty), FluidType.HEATINGOIL, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_reoil), new ItemStack(ModItems.canister_empty), FluidType.RECLAIMED, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_petroil), new ItemStack(ModItems.canister_empty), FluidType.PETROIL, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_canola), new ItemStack(ModItems.canister_empty), FluidType.LUBRICANT, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_naphtha), new ItemStack(ModItems.canister_empty), FluidType.NAPHTHA, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_fuel), new ItemStack(ModItems.canister_empty), FluidType.DIESEL, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_lightoil), new ItemStack(ModItems.canister_empty), FluidType.LIGHTOIL, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_kerosene), new ItemStack(ModItems.canister_empty), FluidType.KEROSENE, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_biofuel), new ItemStack(ModItems.canister_empty), FluidType.BIOFUEL, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_NITAN), new ItemStack(ModItems.canister_empty), FluidType.NITAN, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_full), new ItemStack(ModItems.gas_empty), FluidType.GAS, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_petroleum), new ItemStack(ModItems.gas_empty), FluidType.PETROLEUM, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_biogas), new ItemStack(ModItems.gas_empty), FluidType.BIOGAS, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModBlocks.red_barrel), new ItemStack(ModItems.tank_steel), FluidType.DIESEL, 10000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModBlocks.pink_barrel), new ItemStack(ModItems.tank_steel), FluidType.KEROSENE, 10000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModBlocks.lox_barrel), new ItemStack(ModItems.tank_steel), FluidType.OXYGEN, 10000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_deuterium), - new ItemStack(ModItems.cell_empty), FluidType.DEUTERIUM, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_tritium), - new ItemStack(ModItems.cell_empty), FluidType.TRITIUM, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_tritium), - new ItemStack(ModItems.rod_empty), FluidType.TRITIUM, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_dual_tritium), - new ItemStack(ModItems.rod_dual_empty), FluidType.TRITIUM, 2000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_quad_tritium), - new ItemStack(ModItems.rod_quad_empty), FluidType.TRITIUM, 4000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_uf6), - new ItemStack(ModItems.cell_empty), FluidType.UF6, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_puf6), - new ItemStack(ModItems.cell_empty), FluidType.PUF6, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_antimatter), - new ItemStack(ModItems.cell_empty), FluidType.AMAT, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_anti_schrabidium), - new ItemStack(ModItems.cell_empty), FluidType.ASCHRAB, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_sas3), - new ItemStack(ModItems.cell_empty), FluidType.SAS3, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.bottle_mercury), - new ItemStack(Items.glass_bottle), FluidType.MERCURY, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_deuterium), new ItemStack(ModItems.cell_empty), FluidType.DEUTERIUM, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_tritium), new ItemStack(ModItems.cell_empty), FluidType.TRITIUM, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_tritium), new ItemStack(ModItems.rod_empty), FluidType.TRITIUM, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_dual_tritium), new ItemStack(ModItems.rod_dual_empty), FluidType.TRITIUM, 2000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.rod_quad_tritium), new ItemStack(ModItems.rod_quad_empty), FluidType.TRITIUM, 4000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_uf6), new ItemStack(ModItems.cell_empty), FluidType.UF6, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_puf6), new ItemStack(ModItems.cell_empty), FluidType.PUF6, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_antimatter), new ItemStack(ModItems.cell_empty), FluidType.AMAT, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_anti_schrabidium), new ItemStack(ModItems.cell_empty), FluidType.ASCHRAB, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_sas3), new ItemStack(ModItems.cell_empty), FluidType.SAS3, 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.bottle_mercury), new ItemStack(Items.glass_bottle), FluidType.MERCURY, 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 1), - new ItemStack(ModItems.tank_waste, 1, 0), FluidType.WATZ, 8000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 2), - new ItemStack(ModItems.tank_waste, 1, 1), FluidType.WATZ, 8000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 3), - new ItemStack(ModItems.tank_waste, 1, 2), FluidType.WATZ, 8000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 4), - new ItemStack(ModItems.tank_waste, 1, 3), FluidType.WATZ, 8000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 5), - new ItemStack(ModItems.tank_waste, 1, 4), FluidType.WATZ, 8000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 6), - new ItemStack(ModItems.tank_waste, 1, 5), FluidType.WATZ, 8000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 7), - new ItemStack(ModItems.tank_waste, 1, 6), FluidType.WATZ, 8000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 8), - new ItemStack(ModItems.tank_waste, 1, 7), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 1), new ItemStack(ModItems.tank_waste, 1, 0), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 2), new ItemStack(ModItems.tank_waste, 1, 1), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 3), new ItemStack(ModItems.tank_waste, 1, 2), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 4), new ItemStack(ModItems.tank_waste, 1, 3), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 5), new ItemStack(ModItems.tank_waste, 1, 4), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 6), new ItemStack(ModItems.tank_waste, 1, 5), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 7), new ItemStack(ModItems.tank_waste, 1, 6), FluidType.WATZ, 8000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.tank_waste, 1, 8), new ItemStack(ModItems.tank_waste, 1, 7), FluidType.WATZ, 8000)); for(int i = 1; i < FluidType.values().length; i++) { - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.fluid_tank_full, 1, i), - new ItemStack(ModItems.fluid_tank_empty), FluidType.getEnum(i), 1000)); - FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.fluid_barrel_full, 1, i), - new ItemStack(ModItems.fluid_barrel_empty), FluidType.getEnum(i), 16000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.fluid_tank_full, 1, i), new ItemStack(ModItems.fluid_tank_empty), FluidType.getEnum(i), 1000)); + FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.fluid_barrel_full, 1, i), new ItemStack(ModItems.fluid_barrel_empty), FluidType.getEnum(i), 16000)); } HazmatRegistry.instance.registerHazmat(ModItems.hazmat_helmet, 0.2F); @@ -1290,66 +1080,45 @@ public class MainRegistry { TileEntityMachineReactorLarge.registerFuelEntry(6, ReactorFuelType.URANIUM, ModItems.rod_uranium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(12, ReactorFuelType.URANIUM, ModItems.rod_dual_uranium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(24, ReactorFuelType.URANIUM, ModItems.rod_quad_uranium_fuel); - TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.URANIUM, ModItems.rod_empty, - ModItems.rod_uranium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.URANIUM, ModItems.rod_dual_empty, - ModItems.rod_dual_uranium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.URANIUM, ModItems.rod_quad_empty, - ModItems.rod_quad_uranium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.URANIUM, ModItems.rod_empty, ModItems.rod_uranium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.URANIUM, ModItems.rod_dual_empty, ModItems.rod_dual_uranium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.URANIUM, ModItems.rod_quad_empty, ModItems.rod_quad_uranium_fuel_depleted); TileEntityMachineReactorLarge.registerFuelEntry(1, ReactorFuelType.PLUTONIUM, ModItems.nugget_plutonium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(9, ReactorFuelType.PLUTONIUM, ModItems.ingot_plutonium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(6, ReactorFuelType.PLUTONIUM, ModItems.rod_plutonium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(12, ReactorFuelType.PLUTONIUM, - ModItems.rod_dual_plutonium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(24, ReactorFuelType.PLUTONIUM, - ModItems.rod_quad_plutonium_fuel); - TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.PLUTONIUM, ModItems.rod_empty, - ModItems.rod_plutonium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.PLUTONIUM, ModItems.rod_dual_empty, - ModItems.rod_dual_plutonium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.PLUTONIUM, ModItems.rod_quad_empty, - ModItems.rod_quad_plutonium_fuel_depleted); + TileEntityMachineReactorLarge.registerFuelEntry(12, ReactorFuelType.PLUTONIUM, ModItems.rod_dual_plutonium_fuel); + TileEntityMachineReactorLarge.registerFuelEntry(24, ReactorFuelType.PLUTONIUM, ModItems.rod_quad_plutonium_fuel); + TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.PLUTONIUM, ModItems.rod_empty, ModItems.rod_plutonium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.PLUTONIUM, ModItems.rod_dual_empty, ModItems.rod_dual_plutonium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.PLUTONIUM, ModItems.rod_quad_empty, ModItems.rod_quad_plutonium_fuel_depleted); TileEntityMachineReactorLarge.registerFuelEntry(1, ReactorFuelType.MOX, ModItems.nugget_mox_fuel); TileEntityMachineReactorLarge.registerFuelEntry(9, ReactorFuelType.MOX, ModItems.ingot_mox_fuel); TileEntityMachineReactorLarge.registerFuelEntry(6, ReactorFuelType.MOX, ModItems.rod_mox_fuel); TileEntityMachineReactorLarge.registerFuelEntry(12, ReactorFuelType.MOX, ModItems.rod_dual_mox_fuel); TileEntityMachineReactorLarge.registerFuelEntry(24, ReactorFuelType.MOX, ModItems.rod_quad_mox_fuel); - TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.MOX, ModItems.rod_empty, - ModItems.rod_mox_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.MOX, ModItems.rod_dual_empty, - ModItems.rod_dual_mox_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.MOX, ModItems.rod_quad_empty, - ModItems.rod_quad_mox_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.MOX, ModItems.rod_empty, ModItems.rod_mox_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.MOX, ModItems.rod_dual_empty, ModItems.rod_dual_mox_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.MOX, ModItems.rod_quad_empty, ModItems.rod_quad_mox_fuel_depleted); - TileEntityMachineReactorLarge.registerFuelEntry(10, ReactorFuelType.SCHRABIDIUM, - ModItems.nugget_schrabidium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(90, ReactorFuelType.SCHRABIDIUM, - ModItems.ingot_schrabidium_fuel); + TileEntityMachineReactorLarge.registerFuelEntry(10, ReactorFuelType.SCHRABIDIUM, ModItems.nugget_schrabidium_fuel); + TileEntityMachineReactorLarge.registerFuelEntry(90, ReactorFuelType.SCHRABIDIUM, ModItems.ingot_schrabidium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(60, ReactorFuelType.SCHRABIDIUM, ModItems.rod_schrabidium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(120, ReactorFuelType.SCHRABIDIUM, - ModItems.rod_dual_schrabidium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(240, ReactorFuelType.SCHRABIDIUM, - ModItems.rod_quad_schrabidium_fuel); - TileEntityMachineReactorLarge.registerWasteEntry(60, ReactorFuelType.SCHRABIDIUM, ModItems.rod_empty, - ModItems.rod_schrabidium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(120, ReactorFuelType.SCHRABIDIUM, ModItems.rod_dual_empty, - ModItems.rod_dual_schrabidium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(240, ReactorFuelType.SCHRABIDIUM, ModItems.rod_quad_empty, - ModItems.rod_quad_schrabidium_fuel_depleted); + TileEntityMachineReactorLarge.registerFuelEntry(120, ReactorFuelType.SCHRABIDIUM, ModItems.rod_dual_schrabidium_fuel); + TileEntityMachineReactorLarge.registerFuelEntry(240, ReactorFuelType.SCHRABIDIUM, ModItems.rod_quad_schrabidium_fuel); + TileEntityMachineReactorLarge.registerWasteEntry(60, ReactorFuelType.SCHRABIDIUM, ModItems.rod_empty, ModItems.rod_schrabidium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(120, ReactorFuelType.SCHRABIDIUM, ModItems.rod_dual_empty, ModItems.rod_dual_schrabidium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(240, ReactorFuelType.SCHRABIDIUM, ModItems.rod_quad_empty, ModItems.rod_quad_schrabidium_fuel_depleted); TileEntityMachineReactorLarge.registerFuelEntry(1, ReactorFuelType.THORIUM, ModItems.nugget_thorium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(9, ReactorFuelType.THORIUM, ModItems.ingot_thorium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(6, ReactorFuelType.THORIUM, ModItems.rod_thorium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(12, ReactorFuelType.THORIUM, ModItems.rod_dual_thorium_fuel); TileEntityMachineReactorLarge.registerFuelEntry(24, ReactorFuelType.THORIUM, ModItems.rod_quad_thorium_fuel); - TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.THORIUM, ModItems.rod_empty, - ModItems.rod_thorium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.THORIUM, ModItems.rod_dual_empty, - ModItems.rod_dual_thorium_fuel_depleted); - TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.THORIUM, ModItems.rod_quad_empty, - ModItems.rod_quad_thorium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(6, ReactorFuelType.THORIUM, ModItems.rod_empty, ModItems.rod_thorium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(12, ReactorFuelType.THORIUM, ModItems.rod_dual_empty, ModItems.rod_dual_thorium_fuel_depleted); + TileEntityMachineReactorLarge.registerWasteEntry(24, ReactorFuelType.THORIUM, ModItems.rod_quad_empty, ModItems.rod_quad_thorium_fuel_depleted); proxy.registerMissileItems(); } @@ -1368,344 +1137,15 @@ public class MainRegistry { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); - final String CATEGORY_GENERAL = "01_general"; - enableDebugMode = config.get(CATEGORY_GENERAL, "1.00_enableDebugMode", false).getBoolean(false); - enableMycelium = config.get(CATEGORY_GENERAL, "1.01_enableMyceliumSpread", false).getBoolean(false); - enablePlutoniumOre = config.get(CATEGORY_GENERAL, "1.02_enablePlutoniumNetherOre", false).getBoolean(false); - enableDungeons = config.get(CATEGORY_GENERAL, "1.03_enableDungeonSpawn", true).getBoolean(true); - enableMDOres = config.get(CATEGORY_GENERAL, "1.04_enableOresInModdedDimensions", true).getBoolean(true); - enableMines = config.get(CATEGORY_GENERAL, "1.05_enableLandmineSpawn", true).getBoolean(true); - enableRad = config.get(CATEGORY_GENERAL, "1.06_enableRadHotspotSpawn", true).getBoolean(true); - enableNITAN = config.get(CATEGORY_GENERAL, "1.07_enableNITANChestSpawn", true).getBoolean(true); - enableNukeClouds = config.get(CATEGORY_GENERAL, "1.08_enableMushroomClouds", true).getBoolean(true); - enableAutoCleanup = config.get(CATEGORY_GENERAL, "1.09_enableAutomaticRadCleanup", false).getBoolean(false); - enableMeteorStrikes = config.get(CATEGORY_GENERAL, "1.10_enableMeteorStrikes", true).getBoolean(true); - enableMeteorShowers = config.get(CATEGORY_GENERAL, "1.11_enableMeteorShowers", true).getBoolean(true); - enableMeteorTails = config.get(CATEGORY_GENERAL, "1.12_enableMeteorTails", true).getBoolean(true); - enableSpecialMeteors = config.get(CATEGORY_GENERAL, "1.13_enableSpecialMeteors", false).getBoolean(false); - enableBomberShortMode = config.get(CATEGORY_GENERAL, "1.14_enableBomberShortMode", false).getBoolean(false); - enableVaults = config.get(CATEGORY_GENERAL, "1.15_enableVaultSpawn", true).getBoolean(true); - enableRads = config.get(CATEGORY_GENERAL, "1.16_enableNewRadiation", true).getBoolean(true); - enableCataclysm = config.get(CATEGORY_GENERAL, "1.17_enableCataclysm", false).getBoolean(false); - enableExtendedLogging = config.get(CATEGORY_GENERAL, "1.18_enableExtendedLogging", false).getBoolean(false); - enableHardcoreTaint = config.get(CATEGORY_GENERAL, "1.19_enableHardcoreTaint", false).getBoolean(false); - enableGuns = config.get(CATEGORY_GENERAL, "1.20_enableGuns", true).getBoolean(true); - enableVirus = config.get(CATEGORY_GENERAL, "1.21_enableVirus", false).getBoolean(false); - enableCrosshairs = config.get(CATEGORY_GENERAL, "1.22_enableCrosshairs", true).getBoolean(true); - - final String CATEGORY_OREGEN = "02_ores"; - uraniumSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.00_uraniumSpawnrate", - "Ammount of uranium ore veins per chunk", 7); - titaniumSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.01_titaniumSpawnrate", - "Ammount of titanium ore veins per chunk", 8); - sulfurSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.02_sulfurSpawnrate", - "Ammount of sulfur ore veins per chunk", 5); - aluminiumSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.03_aluminiumSpawnrate", - "Ammount of aluminium ore veins per chunk", 7); - copperSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.04_copperSpawnrate", - "Ammount of copper ore veins per chunk", 12); - fluoriteSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.05_fluoriteSpawnrate", - "Ammount of fluorite ore veins per chunk", 6); - niterSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.06_niterSpawnrate", - "Ammount of niter ore veins per chunk", 6); - tungstenSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.07_tungstenSpawnrate", - "Ammount of tungsten ore veins per chunk", 10); - leadSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.08_leadSpawnrate", - "Ammount of lead ore veins per chunk", 6); - berylliumSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.09_berylliumSpawnrate", - "Ammount of beryllium ore veins per chunk", 6); - thoriumSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.10_thoriumSpawnrate", - "Ammount of thorium ore veins per chunk", 7); - ligniteSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.11_ligniteSpawnrate", - "Ammount of lignite ore veins per chunk", 2); - asbestosSpawn = createConfigInt(config, CATEGORY_OREGEN, "2.12_asbestosSpawnRate", - "Ammount of asbestos ore veins per chunk", 2); - - final String CATEGORY_NUKES = "03_nukes"; - Property propGadget = config.get(CATEGORY_NUKES, "3.00_gadgetRadius", 150); - propGadget.comment = "Radius of the Gadget"; - gadgetRadius = propGadget.getInt(); - Property propBoy = config.get(CATEGORY_NUKES, "3.01_boyRadius", 120); - propBoy.comment = "Radius of Little Boy"; - boyRadius = propBoy.getInt(); - Property propMan = config.get(CATEGORY_NUKES, "3.02_manRadius", 175); - propMan.comment = "Radius of Fat Man"; - manRadius = propMan.getInt(); - Property propMike = config.get(CATEGORY_NUKES, "3.03_mikeRadius", 250); - propMike.comment = "Radius of Ivy Mike"; - mikeRadius = propMike.getInt(); - Property propTsar = config.get(CATEGORY_NUKES, "3.04_tsarRadius", 500); - propTsar.comment = "Radius of the Tsar Bomba"; - tsarRadius = propTsar.getInt(); - Property propPrototype = config.get(CATEGORY_NUKES, "3.05_prototypeRadius", 150); - propPrototype.comment = "Radius of the Prototype"; - prototypeRadius = propPrototype.getInt(); - Property propFleija = config.get(CATEGORY_NUKES, "3.06_fleijaRadius", 50); - propFleija.comment = "Radius of F.L.E.I.J.A."; - fleijaRadius = propFleija.getInt(); - Property propMissile = config.get(CATEGORY_NUKES, "3.07_missileRadius", 100); - propMissile.comment = "Radius of the nuclear missile"; - missileRadius = propMissile.getInt(); - Property propMirv = config.get(CATEGORY_NUKES, "3.08_mirvRadius", 100); - propMirv.comment = "Radius of a MIRV"; - mirvRadius = propMirv.getInt(); - Property propFatman = config.get(CATEGORY_NUKES, "3.09_fatmanRadius", 35); - propFatman.comment = "Radius of the Fatman Launcher"; - fatmanRadius = propFatman.getInt(); - Property propNuka = config.get(CATEGORY_NUKES, "3.10_nukaRadius", 25); - propNuka.comment = "Radius of the nuka grenade"; - nukaRadius = propNuka.getInt(); - Property propASchrab = config.get(CATEGORY_NUKES, "3.11_aSchrabRadius", 20); - propASchrab.comment = "Radius of dropped anti schrabidium"; - aSchrabRadius = propASchrab.getInt(); - Property propSolinium = config.get(CATEGORY_NUKES, "3.12_soliniumRadius", 75); - propSolinium.comment = "Radius of the blue rinse"; - soliniumRadius = propSolinium.getInt(); - Property propN2 = config.get(CATEGORY_NUKES, "3.13_n2Radius", 130); - propN2.comment = "Radius of the N2 mine"; - n2Radius = propN2.getInt(); - - final String CATEGORY_DUNGEON = "04_dungeons"; - Property propRadio = config.get(CATEGORY_DUNGEON, "4.00_radioSpawn", 500); - propRadio.comment = "Spawn radio station on every nTH chunk"; - radioStructure = propRadio.getInt(); - Property propAntenna = config.get(CATEGORY_DUNGEON, "4.01_antennaSpawn", 250); - propAntenna.comment = "Spawn antenna on every nTH chunk"; - antennaStructure = propAntenna.getInt(); - Property propAtom = config.get(CATEGORY_DUNGEON, "4.02_atomSpawn", 500); - propAtom.comment = "Spawn power plant on every nTH chunk"; - atomStructure = propAtom.getInt(); - Property propVertibird = config.get(CATEGORY_DUNGEON, "4.03_vertibirdSpawn", 500); - propVertibird.comment = "Spawn vertibird on every nTH chunk"; - vertibirdStructure = propVertibird.getInt(); - Property propDungeon = config.get(CATEGORY_DUNGEON, "4.04_dungeonSpawn", 64); - propDungeon.comment = "Spawn library dungeon on every nTH chunk"; - dungeonStructure = propDungeon.getInt(); - Property propRelay = config.get(CATEGORY_DUNGEON, "4.05_relaySpawn", 500); - propRelay.comment = "Spawn relay on every nTH chunk"; - relayStructure = propRelay.getInt(); - Property propSatellite = config.get(CATEGORY_DUNGEON, "4.06_satelliteSpawn", 500); - propSatellite.comment = "Spawn satellite dish on every nTH chunk"; - satelliteStructure = propSatellite.getInt(); - Property propBunker = config.get(CATEGORY_DUNGEON, "4.07_bunkerSpawn", 1000); - propBunker.comment = "Spawn bunker on every nTH chunk"; - bunkerStructure = propBunker.getInt(); - Property propSilo = config.get(CATEGORY_DUNGEON, "4.08_siloSpawn", 1000); - propSilo.comment = "Spawn missile silo on every nTH chunk"; - siloStructure = propSilo.getInt(); - Property propFactory = config.get(CATEGORY_DUNGEON, "4.09_factorySpawn", 1000); - propFactory.comment = "Spawn factory on every nTH chunk"; - factoryStructure = propFactory.getInt(); - Property propDud = config.get(CATEGORY_DUNGEON, "4.10_dudSpawn", 500); - propDud.comment = "Spawn dud on every nTH chunk"; - dudStructure = propDud.getInt(); - Property propSpaceship = config.get(CATEGORY_DUNGEON, "4.11_spaceshipSpawn", 1000); - propSpaceship.comment = "Spawn spaceship on every nTH chunk"; - spaceshipStructure = propSpaceship.getInt(); - Property propBarrel = config.get(CATEGORY_DUNGEON, "4.12_barrelSpawn", 5000); - propBarrel.comment = "Spawn waste tank on every nTH chunk"; - barrelStructure = propBarrel.getInt(); - Property propBroadcaster = config.get(CATEGORY_DUNGEON, "4.13_broadcasterSpawn", 5000); - propBroadcaster.comment = "Spawn corrupt broadcaster on every nTH chunk"; - broadcaster = propBroadcaster.getInt(); - Property propMines = config.get(CATEGORY_DUNGEON, "4.14_landmineSpawn", 64); - propMines.comment = "Spawn AP landmine on every nTH chunk"; - minefreq = propMines.getInt(); - Property propRad = config.get(CATEGORY_DUNGEON, "4.15_radHotsoptSpawn", 5000); - propRad.comment = "Spawn radiation hotspot on every nTH chunk"; - radfreq = propRad.getInt(); - Property propVault = config.get(CATEGORY_DUNGEON, "4.16_vaultSpawn", 2500); - propVault.comment = "Spawn locked safe on every nTH chunk"; - vaultfreq = propVault.getInt(); - Property pGW = config.get(CATEGORY_DUNGEON, "4.17_geyserWaterSpawn", 3000); - pGW.comment = "Spawn water geyser on every nTH chunk"; - geyserWater = pGW.getInt(); - Property pGC = config.get(CATEGORY_DUNGEON, "4.18_geyserChlorineSpawn", 3000); - pGC.comment = "Spawn poison geyser on every nTH chunk"; - geyserChlorine = pGC.getInt(); - Property pGV = config.get(CATEGORY_DUNGEON, "4.19_geyserVaporSpawn", 500); - pGV.comment = "Spawn vapor geyser on every nTH chunk"; - geyserVapor = pGV.getInt(); - meteorStructure = createConfigInt(config, CATEGORY_DUNGEON, "4.20_meteorSpawn", - "Spawn meteor dungeon on every nTH chunk", 15000); - capsuleStructure = createConfigInt(config, CATEGORY_DUNGEON, "4.21_capsuleSpawn", - "Spawn landing capsule on every nTH chunk", 100); - - final String CATEGORY_METEOR = "05_meteors"; - Property propMeteorStrikeChance = config.get(CATEGORY_METEOR, "5.00_meteorStrikeChance", 20 * 60 * 60 * 5); - propMeteorStrikeChance.comment = "The probability of a meteor spawning (an average of once every nTH ticks)"; - meteorStrikeChance = propMeteorStrikeChance.getInt(); - Property propMeteorShowerChance = config.get(CATEGORY_METEOR, "5.01_meteorShowerChance", 20 * 60 * 15); - propMeteorShowerChance.comment = "The probability of a meteor spawning during meteor shower (an average of once every nTH ticks)"; - meteorShowerChance = propMeteorShowerChance.getInt(); - Property propMeteorShowerDuration = config.get(CATEGORY_METEOR, "5.02_meteorShowerDuration", 20 * 60 * 30); - propMeteorShowerDuration.comment = "Max duration of meteor shower in ticks"; - meteorShowerDuration = propMeteorShowerDuration.getInt(); - - final String CATEGORY_NUKE = "06_explosions"; - Property propLimitExplosionLifespan = config.get(CATEGORY_NUKE, "6.00_limitExplosionLifespan", 0); - propLimitExplosionLifespan.comment = "How long an explosion can be unloaded until it dies in seconds. Based of system time. 0 disables the effect"; - limitExplosionLifespan = propLimitExplosionLifespan.getInt(); - // explosion speed - Property propBlastSpeed = config.get(CATEGORY_NUKE, "6.01_blastSpeed", 1024); - propBlastSpeed.comment = "Base speed of MK3 system (old and schrabidium) detonations (Blocks / tick)"; - blastSpeed = propBlastSpeed.getInt(); - // fallout range - Property propFalloutRange = config.get(CATEGORY_NUKE, "6.02_blastSpeedNew", 1024); - propFalloutRange.comment = "Base speed of MK4 system (new) detonations (Blocks / tick)"; - mk4 = propFalloutRange.getInt(); - // fallout speed - Property falloutRangeProp = config.get(CATEGORY_NUKE, "6.03_falloutRange", 100); - falloutRangeProp.comment = "Radius of fallout area (base radius * value in percent)"; - falloutRange = falloutRangeProp.getInt(); - // new explosion speed - Property falloutSpeed = config.get(CATEGORY_NUKE, "6.04_falloutSpeed", 256); - falloutSpeed.comment = "Blocks processed per tick by the fallout rain"; - fSpeed = falloutSpeed.getInt(); - // afterrain duration - Property radRain = config.get(CATEGORY_NUKE, "6.05_falloutRainDuration", 0); - radRain.comment = "Duration of the thunderstorm after fallout in ticks (only large explosions)"; - rain = radRain.getInt(); - // afterrain radiation - Property rainCont = config.get(CATEGORY_NUKE, "6.06_falloutRainRadiation", 0); - rainCont.comment = "Radiation in 100th RADs created by fallout rain"; - cont = rainCont.getInt(); - // fog threshold - Property fogThresh = config.get(CATEGORY_NUKE, "6.07_fogThreshold", 100); - fogThresh.comment = "Radiation in RADs required for fog to spawn"; - fogRad = fogThresh.getInt(); - // fog chance - Property fogChance = config.get(CATEGORY_NUKE, "6.08_fogChance", 10); - fogChance.comment = "1:n chance of fog spawning every second"; - fogCh = fogChance.getInt(); - // nether radiation - Property netherRad = config.get(CATEGORY_NUKE, "6.09_netherRad", 10); - netherRad.comment = "RAD/s in the nether in hundredths"; - hellRad = netherRad.getInt() * 0.01F; - worldRad = createConfigInt(config, CATEGORY_NUKE, "6.10_worldRadCount", - "How many block operations radiation can perform per tick", 10); - worldRadThreshold = createConfigInt(config, CATEGORY_NUKE, "6.11_worldRadThreshold", - "The least amount of RADs required for block modification to happen", 20); - - final String CATEGORY_MISSILE = "07_missile_machines"; - Property propRadarRange = config.get(CATEGORY_MISSILE, "7.00_radarRange", 1000); - propRadarRange.comment = "Range of the radar, 50 will result in 100x100 block area covered"; - radarRange = propRadarRange.getInt(); - Property propRadarBuffer = config.get(CATEGORY_MISSILE, "7.01_radarBuffer", 30); - propRadarBuffer.comment = "How high entities have to be above the radar to be detected"; - radarBuffer = propRadarBuffer.getInt(); - Property propRadarAltitude = config.get(CATEGORY_MISSILE, "7.02_radarAltitude", 55); - propRadarAltitude.comment = "Y height required for the radar to work"; - radarAltitude = propRadarAltitude.getInt(); - Property propCiwsHitrate = config.get(CATEGORY_MISSILE, "7.03_ciwsAccuracy", 50); - propCiwsHitrate.comment = "Additional modifier for CIWS accuracy"; - ciwsHitrate = propRadarAltitude.getInt(); - - final String CATEGORY_POTION = "08_potion_effects"; - taintID = createConfigInt(config, CATEGORY_POTION, "8.00_taintPotionID", - "What potion ID the taint effect will have", 62); - radiationID = createConfigInt(config, CATEGORY_POTION, "8.01_radiationPotionID", - "What potion ID the radiation effect will have", 63); - bangID = createConfigInt(config, CATEGORY_POTION, "8.02_bangPotionID", - "What potion ID the B93 timebomb effect will have", 64); - mutationID = createConfigInt(config, CATEGORY_POTION, "8.03_mutationPotionID", - "What potion ID the taint mutation effect will have", 65); - radxID = createConfigInt(config, CATEGORY_POTION, "8.04_radxPotionID", - "What potion ID the Rad-X effect will have", 66); - leadID = createConfigInt(config, CATEGORY_POTION, "8.05_leadPotionID", - "What potion ID the lead poisoning effect will have", 67); - radawayID = createConfigInt(config, CATEGORY_POTION, "8.06_radawayPotionID", - "What potion ID the radaway effect will have", 68); - telekinesisID = createConfigInt(config, CATEGORY_POTION, "8.07_telekinesisPotionID", - "What potion ID the telekinesis effect will have", 69); - phosphorusID = createConfigInt(config, CATEGORY_POTION, "8.08_phosphorusPotionID", - "What potion ID the phosphorus effect will have", 70); - - final String CATEGORY_MACHINE = "09_machines"; - - final String CATEGORY_DROPS = "10_dangerous_drops"; - dropCell = createConfigBool(config, CATEGORY_DROPS, "10.00_dropCell", - "Whether antimatter cells should explode when dropped", true); - dropSing = createConfigBool(config, CATEGORY_DROPS, "10.01_dropBHole", - "Whether singularities and blaack holes should spawn when dropped", true); - dropStar = createConfigBool(config, CATEGORY_DROPS, "10.02_dropStar", - "Whether rigged star blaster cells should explode when dropped", true); - dropCrys = createConfigBool(config, CATEGORY_DROPS, "10.04_dropCrys", - "Whether xen crystals should move blocks when dropped", true); - dropDead = createConfigBool(config, CATEGORY_DROPS, "10.05_dropDead", - "Whether dead man's explosives should explode when dropped", true); - - final String CATEGORY_TOOLS = "11_tools"; - recursionDepth = createConfigInt(config, CATEGORY_TOOLS, "11.00_recursionDepth", - "Limits veinminer's recursive function. Usually not an issue, unless you're using bukkit which is especially sensitive for some reason.", - 1000); - recursiveStone = createConfigBool(config, CATEGORY_TOOLS, "11.01_recursionDepth", - "Determines whether veinminer can break stone", false); - recursiveNetherrack = createConfigBool(config, CATEGORY_TOOLS, "11.02_recursionDepth", - "Determines whether veinminer can break netherrack", false); + GeneralConfig.loadFromConfig(config); + WorldConfig.loadFromConfig(config); + MachineConfig.loadFromConfig(config); + BombConfig.loadFromConfig(config); + RadiationConfig.loadFromConfig(config); + PotionConfig.loadFromConfig(config); + ToolConfig.loadFromConfig(config); + WeaponConfig.loadFromConfig(config); config.save(); - - radioStructure = setDef(radioStructure, 1000); - antennaStructure = setDef(antennaStructure, 1000); - atomStructure = setDef(atomStructure, 1000); - vertibirdStructure = setDef(vertibirdStructure, 1000); - dungeonStructure = setDef(dungeonStructure, 1000); - relayStructure = setDef(relayStructure, 1000); - satelliteStructure = setDef(satelliteStructure, 1000); - bunkerStructure = setDef(bunkerStructure, 1000); - siloStructure = setDef(siloStructure, 1000); - factoryStructure = setDef(factoryStructure, 1000); - dudStructure = setDef(dudStructure, 1000); - spaceshipStructure = setDef(spaceshipStructure, 1000); - barrelStructure = setDef(barrelStructure, 1000); - geyserWater = setDef(geyserWater, 1000); - geyserChlorine = setDef(geyserChlorine, 1000); - geyserVapor = setDef(geyserVapor, 1000); - broadcaster = setDef(broadcaster, 1000); - minefreq = setDef(minefreq, 1000); - radfreq = setDef(radfreq, 1000); - vaultfreq = setDef(vaultfreq, 1000); - meteorStrikeChance = setDef(meteorStrikeChance, 1000); - meteorShowerChance = setDef(meteorShowerChance, 1000); - meteorStructure = setDef(meteorStructure, 15000); - capsuleStructure = setDef(capsuleStructure, 100); - fogCh = setDef(fogCh, 20); - } - - private static int setDef(int value, int def) { - - if(value <= 0) { - logger.error( - "Fatal error config: Randomizer value has been set to zero, despite bound having to be positive integer!"); - logger.error(String.format( - "Errored value will default back to %d, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", - def)); - return def; - } - - return value; - } - - private static int createConfigInt(Configuration config, String category, String name, String comment, int def) { - - Property prop = config.get(category, name, def); - prop.comment = comment; - return prop.getInt(); - } - - private static boolean createConfigBool(Configuration config, String category, String name, String comment, - boolean def) { - - Property prop = config.get(category, name, def); - prop.comment = comment; - return prop.getBoolean(); - } - - private static String[] createConfigStringList(Configuration config, String category, String name, String comment) { - - Property prop = config.get(category, name, new String[] { "PLACEHOLDER" }); - prop.comment = comment; - return prop.getStringList(); } } diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 00dd1e674..d913ef42c 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -9,6 +9,9 @@ import java.util.Random; import org.apache.commons.lang3.math.NumberUtils; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; +import com.hbm.config.RadiationConfig; +import com.hbm.config.WorldConfig; import com.hbm.entity.missile.EntityMissileBaseAdvanced; import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.projectile.EntityBurningFOEQ; @@ -91,7 +94,7 @@ public class ModEventHandler if(event.entity.worldObj.isRemote) return; - if(MainRegistry.enableCataclysm) { + if(GeneralConfig.enableCataclysm) { EntityBurningFOEQ foeq = new EntityBurningFOEQ(event.entity.worldObj); foeq.setPositionAndRotation(event.entity.posX, 500, event.entity.posZ, 0.0F, 0.0F); event.entity.worldObj.spawnEntityInWorld(foeq); @@ -166,8 +169,8 @@ public class ModEventHandler ///// /// METEOR SHOWER START /// - if(event.world != null && !event.world.isRemote && event.world.provider.isSurfaceWorld() && MainRegistry.enableMeteorStrikes) { - if(event.world.rand.nextInt(meteorShower > 0 ? MainRegistry.meteorShowerChance : MainRegistry.meteorStrikeChance) == 0) { + if(event.world != null && !event.world.isRemote && event.world.provider.isSurfaceWorld() && GeneralConfig.enableMeteorStrikes) { + if(event.world.rand.nextInt(meteorShower > 0 ? WorldConfig.meteorShowerChance : WorldConfig.meteorStrikeChance) == 0) { if(!event.world.playerEntities.isEmpty()) { EntityPlayer p = (EntityPlayer)event.world.playerEntities.get(event.world.rand.nextInt(event.world.playerEntities.size())); @@ -186,23 +189,23 @@ public class ModEventHandler if(meteorShower > 0) { meteorShower--; - if(meteorShower == 0 && MainRegistry.enableDebugMode) + if(meteorShower == 0 && GeneralConfig.enableDebugMode) MainRegistry.logger.info("Ended meteor shower."); } - if(event.world.rand.nextInt(MainRegistry.meteorStrikeChance * 100) == 0 && MainRegistry.enableMeteorShowers) { + if(event.world.rand.nextInt(WorldConfig.meteorStrikeChance * 100) == 0 && GeneralConfig.enableMeteorShowers) { meteorShower = - (int)(MainRegistry.meteorShowerDuration * 0.75 + - MainRegistry.meteorShowerDuration * 0.25 * event.world.rand.nextFloat()); + (int)(WorldConfig.meteorShowerDuration * 0.75 + + WorldConfig.meteorShowerDuration * 0.25 * event.world.rand.nextFloat()); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("Started meteor shower! Duration: " + meteorShower); } } /// METEOR SHOWER END /// /// RADIATION STUFF START /// - if(event.world != null && !event.world.isRemote && MainRegistry.enableRads) { + if(event.world != null && !event.world.isRemote && GeneralConfig.enableRads) { int thunder = AuxSavedData.getThunder(event.world); @@ -243,17 +246,17 @@ public class ModEventHandler Chunk chunk = entity.worldObj.getChunkFromBlockCoords((int)entity.posX, (int)entity.posZ); float rad = data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition); - if(event.world.provider.isHellWorld && MainRegistry.hellRad > 0 && rad < MainRegistry.hellRad) - rad = MainRegistry.hellRad; + if(event.world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad) + rad = RadiationConfig.hellRad; if(rad > 0) { ContaminationUtil.applyRadData(entity, rad / 2); } - if(entity.worldObj.isRaining() && MainRegistry.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && + if(entity.worldObj.isRaining() && RadiationConfig.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && entity.worldObj.canBlockSeeTheSky(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ))) { - ContaminationUtil.applyRadData(entity, MainRegistry.cont * 0.005F); + ContaminationUtil.applyRadData(entity, RadiationConfig.cont * 0.005F); } } @@ -645,31 +648,31 @@ public class ModEventHandler //let's start from the back: - //this part means that the message's first character has to equal a '!': -------------------------+ - // | - //this is a logical AND operator: -------------------------------------------------------------+ | - // | | - //this is a reference to a field in | | - //Library.java containing a reference UUID: --------------------------------------+ | | - // | | | - //this will compare said UUID with | | | - //the string representation of the | | | - //current player's UUID: ----------+ | | | - // | | | | - //another AND operator: --------+ | | | | - // | | | | | - //this is a reference to a | | | | | - //boolean called | | | | | - //'enableDebugMode' which is | | | | | - //only set once by the mod's | | | | | - //config and is disabled by | | | | | - //default. "debug" is not a | | | | | - //substring of the message, nor | | | | | - //something that can be toggled | | | | | - //in any other way except for | | | | | - //the config file: | | | | | | - // V V V V V V - if(MainRegistry.enableDebugMode && player.getUniqueID().toString().equals(Library.HbMinecraft) && message.startsWith("!")) { + //this part means that the message's first character has to equal a '!': --------------------------+ + // | + //this is a logical AND operator: --------------------------------------------------------------+ | + // | | + //this is a reference to a field in | | + //Library.java containing a reference UUID: ---------------------------------------+ | | + // | | | + //this will compare said UUID with | | | + //the string representation of the | | | + //current player's UUID: -----------+ | | | + // | | | | + //another AND operator: ---------+ | | | | + // | | | | | + //this is a reference to a | | | | | + //boolean called | | | | | + //'enableDebugMode' which is | | | | | + //only set once by the mod's | | | | | + //config and is disabled by | | | | | + //default. "debug" is not a | | | | | + //substring of the message, nor | | | | | + //something that can be toggled | | | | | + //in any other way except for | | | | | + //the config file: | | | | | | + // V V V V V V + if(GeneralConfig.enableDebugMode && player.getUniqueID().toString().equals(Library.HbMinecraft) && message.startsWith("!")) { String[] msg = message.split(" "); diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index ea83475d9..0d0efa0bf 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -2,6 +2,7 @@ package com.hbm.main; import java.util.List; +import com.hbm.config.GeneralConfig; import com.hbm.entity.mob.EntityHunterChopper; import com.hbm.entity.projectile.EntityChopperMine; import com.hbm.handler.BulletConfigSyncingUtil; @@ -106,7 +107,7 @@ public class ModEventHandlerClient { } /// HANDLE CUSTOM CROSSHAIRS /// - if(event.type == ElementType.CROSSHAIRS && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IHoldableWeapon && MainRegistry.enableCrosshairs) { + if(event.type == ElementType.CROSSHAIRS && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IHoldableWeapon && GeneralConfig.enableCrosshairs) { event.setCanceled(true); if(!(player.getHeldItem().getItem() instanceof ItemGunBase && ((ItemGunBase)player.getHeldItem().getItem()).mainConfig.hasSights && player.isSneaking())) diff --git a/src/main/java/com/hbm/potion/HbmPotion.java b/src/main/java/com/hbm/potion/HbmPotion.java index ccd966f9f..74274575e 100644 --- a/src/main/java/com/hbm/potion/HbmPotion.java +++ b/src/main/java/com/hbm/potion/HbmPotion.java @@ -4,11 +4,12 @@ import java.lang.reflect.Field; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.bomb.BlockTaint; +import com.hbm.config.GeneralConfig; +import com.hbm.config.PotionConfig; import com.hbm.entity.mob.EntityTaintCrab; import com.hbm.entity.mob.EntityTaintedCreeper; import com.hbm.explosion.ExplosionLarge; import com.hbm.lib.ModDamageSource; -import com.hbm.main.MainRegistry; import com.hbm.util.ContaminationUtil; import cpw.mods.fml.relauncher.ReflectionHelper; @@ -37,15 +38,15 @@ public class HbmPotion extends Potion { } public static void init() { - taint = registerPotion(MainRegistry.taintID, true, 8388736, "potion.hbm_taint", 0, 0); - radiation = registerPotion(MainRegistry.radiationID, true, 8700200, "potion.hbm_radiation", 1, 0); - bang = registerPotion(MainRegistry.bangID, true, 1118481, "potion.hbm_bang", 3, 0); - mutation = registerPotion(MainRegistry.mutationID, false, 8388736, "potion.hbm_mutation", 2, 0); - radx = registerPotion(MainRegistry.radxID, false, 0xBB4B00, "potion.hbm_radx", 5, 0); - lead = registerPotion(MainRegistry.leadID, true, 0x767682, "potion.hbm_lead", 6, 0); - radaway = registerPotion(MainRegistry.radawayID, false, 0xBB4B00, "potion.hbm_radaway", 7, 0); - telekinesis = registerPotion(MainRegistry.telekinesisID, true, 0x00F3FF, "potion.hbm_telekinesis", 0, 1); - phosphorus = registerPotion(MainRegistry.phosphorusID, true, 0xFFFF00, "potion.hbm_phosphorus", 1, 1); + taint = registerPotion(PotionConfig.taintID, true, 8388736, "potion.hbm_taint", 0, 0); + radiation = registerPotion(PotionConfig.radiationID, true, 8700200, "potion.hbm_radiation", 1, 0); + bang = registerPotion(PotionConfig.bangID, true, 1118481, "potion.hbm_bang", 3, 0); + mutation = registerPotion(PotionConfig.mutationID, false, 8388736, "potion.hbm_mutation", 2, 0); + radx = registerPotion(PotionConfig.radxID, false, 0xBB4B00, "potion.hbm_radx", 5, 0); + lead = registerPotion(PotionConfig.leadID, true, 0x767682, "potion.hbm_lead", 6, 0); + radaway = registerPotion(PotionConfig.radawayID, false, 0xBB4B00, "potion.hbm_radaway", 7, 0); + telekinesis = registerPotion(PotionConfig.telekinesisID, true, 0x00F3FF, "potion.hbm_telekinesis", 0, 1); + phosphorus = registerPotion(PotionConfig.phosphorusID, true, 0xFFFF00, "potion.hbm_phosphorus", 1, 1); } public static HbmPotion registerPotion(int id, boolean isBad, int color, String name, int x, int y) { @@ -92,7 +93,7 @@ public class HbmPotion extends Potion { if(!(entity instanceof EntityTaintedCreeper) && !(entity instanceof EntityTaintCrab) && entity.worldObj.rand.nextInt(40) == 0) entity.attackEntityFrom(ModDamageSource.taint, (level + 1)); - if(MainRegistry.enableHardcoreTaint && !entity.worldObj.isRemote) { + if(GeneralConfig.enableHardcoreTaint && !entity.worldObj.isRemote) { int x = (int)(entity.posX - 1); int y = (int)entity.posY; diff --git a/src/main/java/com/hbm/saveddata/RadiationSavedData.java b/src/main/java/com/hbm/saveddata/RadiationSavedData.java index cca683ad5..b46ab859d 100644 --- a/src/main/java/com/hbm/saveddata/RadiationSavedData.java +++ b/src/main/java/com/hbm/saveddata/RadiationSavedData.java @@ -3,6 +3,8 @@ package com.hbm.saveddata; import java.util.HashMap; import java.util.Map.Entry; +import com.hbm.config.GeneralConfig; +import com.hbm.config.RadiationConfig; import com.hbm.main.MainRegistry; import com.hbm.packet.AuxParticlePacket; import com.hbm.packet.PacketDispatcher; @@ -75,7 +77,7 @@ public class RadiationSavedData extends WorldSavedData { rad = 0; } - if(rad > MainRegistry.fogRad && worldObj != null && worldObj.rand.nextInt(MainRegistry.fogCh) == 0 && worldObj.getChunkFromChunkCoords(struct.getKey().chunkXPos, struct.getKey().chunkZPos).isChunkLoaded) { + if(rad > RadiationConfig.fogRad && worldObj != null && worldObj.rand.nextInt(RadiationConfig.fogCh) == 0 && worldObj.getChunkFromChunkCoords(struct.getKey().chunkXPos, struct.getKey().chunkZPos).isChunkLoaded) { int x = struct.getKey().chunkXPos * 16 + worldObj.rand.nextInt(16); int z = struct.getKey().chunkZPos * 16 + worldObj.rand.nextInt(16); @@ -125,7 +127,7 @@ public class RadiationSavedData extends WorldSavedData { @Override public void readFromNBT(NBTTagCompound nbt) { - if(!MainRegistry.enableRads) { + if(!GeneralConfig.enableRads) { return; } diff --git a/src/main/java/com/hbm/tileentity/bomb/TileEntityNukeN45.java b/src/main/java/com/hbm/tileentity/bomb/TileEntityNukeN45.java index 7c65720e6..d48d01edb 100644 --- a/src/main/java/com/hbm/tileentity/bomb/TileEntityNukeN45.java +++ b/src/main/java/com/hbm/tileentity/bomb/TileEntityNukeN45.java @@ -3,11 +3,11 @@ package com.hbm.tileentity.bomb; import java.util.List; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionLarge; import com.hbm.items.ModItems; -import com.hbm.main.MainRegistry; import com.hbm.packet.AuxGaugePacket; import com.hbm.packet.PacketDispatcher; @@ -256,9 +256,9 @@ public class TileEntityNukeN45 extends TileEntity implements ISidedInventory { ExplosionLarge.explode(world, x, y, z, 15, true, false, false); break; case 4: - world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, (int)(MainRegistry.missileRadius * 0.75F), x + 0.5, y + 0.5, z + 0.5)); + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, (int)(BombConfig.missileRadius * 0.75F), x + 0.5, y + 0.5, z + 0.5)); - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, MainRegistry.missileRadius * 0.005F * 0.75F); + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.missileRadius * 0.005F * 0.75F); entity2.posX = x; entity2.posY = y; entity2.posZ = z; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java index 55a2c9f6e..b638d2cf2 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityBlackHole; import com.hbm.entity.effect.EntityCloudFleija; import com.hbm.entity.logic.EntityNukeExplosionMK3; @@ -277,7 +278,7 @@ public class TileEntityMachineCyclotron extends TileEntity implements ISidedInve ExplosionLarge.explodeFire(worldObj, xCoord, yCoord, zCoord, 35 + rand.nextInt(21), true, true, true); } if(i == 1) { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int)(MainRegistry.fatmanRadius * 1.5), xCoord, yCoord, zCoord)); + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int)(BombConfig.fatmanRadius * 1.5), xCoord, yCoord, zCoord)); ExplosionParticleB.spawnMush(worldObj, xCoord, yCoord - 3, zCoord); } if(i == 2) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadar.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadar.java index 24cb768d8..c14deb3d8 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadar.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadar.java @@ -3,9 +3,9 @@ package com.hbm.tileentity.machine; import java.util.ArrayList; import java.util.List; +import com.hbm.config.WeaponConfig; import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.Untested; -import com.hbm.main.MainRegistry; import com.hbm.tileentity.TileEntityTickingBase; import api.hbm.entity.IRadarDetectable; @@ -51,7 +51,7 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo @Override public void updateEntity() { - if(this.yCoord < MainRegistry.radarAltitude) + if(this.yCoord < WeaponConfig.radarAltitude) return; int lastPower = getRedPower(); @@ -87,15 +87,15 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo nearbyMissiles.clear(); - List list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord + 0.5 - MainRegistry.radarRange, 0, zCoord + 0.5 - MainRegistry.radarRange, xCoord + 0.5 + MainRegistry.radarRange, 5000, zCoord + 0.5 + MainRegistry.radarRange)); + List list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord + 0.5 - WeaponConfig.radarRange, 0, zCoord + 0.5 - WeaponConfig.radarRange, xCoord + 0.5 + WeaponConfig.radarRange, 5000, zCoord + 0.5 + WeaponConfig.radarRange)); for(Entity e : list) { - if(e instanceof EntityPlayer && e.posY >= yCoord + MainRegistry.radarBuffer) { + if(e instanceof EntityPlayer && e.posY >= yCoord + WeaponConfig.radarBuffer) { nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, RadarTargetType.PLAYER.ordinal(), (int)e.posY }); } - if(e instanceof IRadarDetectable && e.posY >= yCoord + MainRegistry.radarBuffer) { + if(e instanceof IRadarDetectable && e.posY >= yCoord + WeaponConfig.radarBuffer) { nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, ((IRadarDetectable)e).getTargetType().ordinal(), (int)e.posY }); } } @@ -105,7 +105,7 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements ICo if(!nearbyMissiles.isEmpty()) { - double maxRange = MainRegistry.radarRange * Math.sqrt(2D); + double maxRange = WeaponConfig.radarRange * Math.sqrt(2D); int power = 0; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactor.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactor.java index 55cbd01a8..c13c23a37 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactor.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactor.java @@ -20,8 +20,6 @@ public class TileEntityMachineReactor extends TileEntityMachineBase { private static final int[] slots_bottom = new int[] { 2, 0 }; private static final int[] slots_side = new int[] { 0 }; - private String customName; - public TileEntityMachineReactor() { super(3); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityWatzCore.java b/src/main/java/com/hbm/tileentity/machine/TileEntityWatzCore.java index 92529f6d0..dc3c97d6a 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityWatzCore.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityWatzCore.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.IConsumer; @@ -672,7 +673,7 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I entity.posX = this.xCoord; entity.posY = this.yCoord; entity.posZ = this.zCoord; - entity.destructionRange = MainRegistry.fleijaRadius; + entity.destructionRange = BombConfig.fleijaRadius; entity.speed = 25; entity.coefficient = 1.0F; entity.waste = false; diff --git a/src/main/java/com/hbm/world/dungeon/Antenna.java b/src/main/java/com/hbm/world/dungeon/Antenna.java index bbcd7a94e..f107f0e6f 100644 --- a/src/main/java/com/hbm/world/dungeon/Antenna.java +++ b/src/main/java/com/hbm/world/dungeon/Antenna.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.main.MainRegistry; @@ -270,7 +271,7 @@ public class Antenna extends WorldGenerator world.setBlock(x + 0, y + 20, z + 2, Blocks.air, 0, 3); world.setBlock(x + 1, y + 20, z + 2, Blocks.air, 0, 3); world.setBlock(x + 2, y + 20, z + 2, Blocks.air, 0, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned antenna at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Barrel.java b/src/main/java/com/hbm/world/dungeon/Barrel.java index f3a1ec389..d83add726 100644 --- a/src/main/java/com/hbm/world/dungeon/Barrel.java +++ b/src/main/java/com/hbm/world/dungeon/Barrel.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -403,7 +404,7 @@ public class Barrel extends WorldGenerator { world.setBlock(x + 2, y + 8, z + 5, Blocks.ladder, 3, 3); world.setBlock(x + 2, y + 9, z + 5, Blocks.ladder, 3, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned waste tank at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Bunker.java b/src/main/java/com/hbm/world/dungeon/Bunker.java index 76bd369db..687c5b3f5 100644 --- a/src/main/java/com/hbm/world/dungeon/Bunker.java +++ b/src/main/java/com/hbm/world/dungeon/Bunker.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -1598,7 +1599,7 @@ public class Bunker extends WorldGenerator world.setBlock(x + 6, y + -19, z + 10, Blocks.bed, 8, 3); world.setBlock(x + 8, y + -19, z + 10, Blocks.bed, 8, 3); world.setBlock(x + 10, y + -19, z + 10, Blocks.bed, 8, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned bunker at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java b/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java index 0a80a5084..255d6671b 100644 --- a/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java +++ b/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.main.MainRegistry; @@ -417,7 +418,7 @@ public class CrashedVertibird extends WorldGenerator world.setBlock(x + 4, y + 1 - yOffset, z + 1, Blocks.lever, 3, 3); world.setBlock(x + 6, y + 1 - yOffset, z + 1, Blocks.lever, 3, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned crashed Vertibird at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/DesertAtom003.java b/src/main/java/com/hbm/world/dungeon/DesertAtom003.java index d53a8729a..f45cc2542 100644 --- a/src/main/java/com/hbm/world/dungeon/DesertAtom003.java +++ b/src/main/java/com/hbm/world/dungeon/DesertAtom003.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -1767,7 +1768,7 @@ public class DesertAtom003 world.setBlock(x + 22, y + 5, z + 14, Blocks.lever, 2, 3); world.setBlock(x + 8, y + 8, z + 21, Blocks.wall_sign, 2, 3); world.setBlock(x + 8, y + 9, z + 21, Blocks.wall_sign, 2, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned abandoned Power Plant at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Factory.java b/src/main/java/com/hbm/world/dungeon/Factory.java index 2e24d93b4..305dfc44d 100644 --- a/src/main/java/com/hbm/world/dungeon/Factory.java +++ b/src/main/java/com/hbm/world/dungeon/Factory.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.main.MainRegistry; @@ -3133,7 +3134,7 @@ public class Factory extends WorldGenerator world.setBlock(x + 17, y + 43, z + 10, Blocks.web, 0, 3); world.setBlock(x + 18, y + 43, z + 10, Blocks.web, 0, 3); world.setBlock(x + 17, y + 43, z + 11, Blocks.web, 0, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned abandoned factory at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/LibraryDungeon.java b/src/main/java/com/hbm/world/dungeon/LibraryDungeon.java index 9f768f35e..9e0207bea 100644 --- a/src/main/java/com/hbm/world/dungeon/LibraryDungeon.java +++ b/src/main/java/com/hbm/world/dungeon/LibraryDungeon.java @@ -6,6 +6,7 @@ import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; import java.util.Random; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import net.minecraft.block.Block; @@ -1055,7 +1056,7 @@ public class LibraryDungeon extends WorldGenerator world.setBlock(x + 3, y + 5, z + 3, Blocks.air, 0, 3); world.setBlock(x + 3, y + 5, z + 6, Blocks.air, 0, 3); world.setBlock(x + 4, y + 5, z + 7, Blocks.air, 0, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned library at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Radio02.java b/src/main/java/com/hbm/world/dungeon/Radio02.java index e4ab5eb4f..5d3d713b7 100644 --- a/src/main/java/com/hbm/world/dungeon/Radio02.java +++ b/src/main/java/com/hbm/world/dungeon/Radio02.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import net.minecraft.init.Blocks; @@ -2172,7 +2173,7 @@ public class Radio02 world.setBlock(x + 8, y + 23, z + 25, Blocks.air, 0, 3); world.setBlock(x + 9, y + 23, z + 25, Blocks.air, 0, 3); world.setBlock(x + 10, y + 23, z + 25, Blocks.air, 0, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned abandoned Radio station at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Relay.java b/src/main/java/com/hbm/world/dungeon/Relay.java index af4d9196f..f467ec959 100644 --- a/src/main/java/com/hbm/world/dungeon/Relay.java +++ b/src/main/java/com/hbm/world/dungeon/Relay.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -1658,7 +1659,7 @@ public class Relay extends WorldGenerator world.setBlock(x + 5, y + 1, z + 11, Blocks.torch, 1, 3); world.setBlock(x + 3, y + 1, z + 12, Blocks.wall_sign, 4, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned relay tower at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Satellite.java b/src/main/java/com/hbm/world/dungeon/Satellite.java index 5b378fd4a..6a9b94b5f 100644 --- a/src/main/java/com/hbm/world/dungeon/Satellite.java +++ b/src/main/java/com/hbm/world/dungeon/Satellite.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -2586,7 +2587,7 @@ public class Satellite extends WorldGenerator world.setBlock(x + 16, y + 19, z + 12, Blocks.torch, 2, 3); world.setBlock(x + 22, y + 19, z + 12, Blocks.torch, 1, 3); world.setBlock(x + 19, y + 19, z + 15, Blocks.torch, 3, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned satellite dish at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Silo.java b/src/main/java/com/hbm/world/dungeon/Silo.java index 4a9f8f583..81ed05e93 100644 --- a/src/main/java/com/hbm/world/dungeon/Silo.java +++ b/src/main/java/com/hbm/world/dungeon/Silo.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -2521,7 +2522,7 @@ public class Silo extends WorldGenerator world.setBlock(x + 9, y + -1, z + 2, Blocks.ladder, 3, 3); world.setBlock(x + 9, y + 0, z + 2, Blocks.ladder, 3, 3); world.setBlock(x + 9, y + 1, z + 2, Blocks.ladder, 3, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned missile silo at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Spaceship2.java b/src/main/java/com/hbm/world/dungeon/Spaceship2.java index 34d695691..6aa1c68e4 100644 --- a/src/main/java/com/hbm/world/dungeon/Spaceship2.java +++ b/src/main/java/com/hbm/world/dungeon/Spaceship2.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import net.minecraft.block.Block; @@ -445,7 +446,7 @@ public class Spaceship2 world.setBlock(x + 7, y + 4, z + 6, Blocks.air, 0, 3); world.setBlock(x + 8, y + 4, z + 6, Blocks.air, 0, 3); world.setBlock(x + 7, y + 4, z + 7, Blocks.air, 0, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned spaceship at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/dungeon/Vertibird.java b/src/main/java/com/hbm/world/dungeon/Vertibird.java index bc153eb61..0daf81917 100644 --- a/src/main/java/com/hbm/world/dungeon/Vertibird.java +++ b/src/main/java/com/hbm/world/dungeon/Vertibird.java @@ -5,6 +5,7 @@ package com.hbm.world.dungeon; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.lib.HbmChestContents; import com.hbm.main.MainRegistry; @@ -505,7 +506,7 @@ public class Vertibird extends WorldGenerator world.setBlock(x + 12, y + 2 - yOffset, z + 1, Blocks.lever, 3, 3); world.setBlock(x + 14, y + 2 - yOffset, z + 1, Blocks.lever, 3, 3); - if(MainRegistry.enableDebugMode) + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned Vertibird at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/feature/Dud.java b/src/main/java/com/hbm/world/feature/Dud.java index 9ded3ccf8..edda9403b 100644 --- a/src/main/java/com/hbm/world/feature/Dud.java +++ b/src/main/java/com/hbm/world/feature/Dud.java @@ -3,6 +3,7 @@ package com.hbm.world.feature; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.main.MainRegistry; import net.minecraft.block.Block; @@ -77,12 +78,11 @@ public class Dud extends WorldGenerator public boolean generate_r0(World world, Random rand, int x, int y, int z) { if(!LocationIsValidSpawn(world, x, y, z)) - { return false; - } world.setBlock(x, y, z, ModBlocks.crashed_balefire, rand.nextInt(4) + 2, 3); - if(MainRegistry.enableDebugMode) + + if(GeneralConfig.enableDebugMode) System.out.print("[Debug] Successfully spawned dud at " + x + " " + y +" " + z + "\n"); return true; diff --git a/src/main/java/com/hbm/world/feature/Meteorite.java b/src/main/java/com/hbm/world/feature/Meteorite.java index 392638396..99395eff9 100644 --- a/src/main/java/com/hbm/world/feature/Meteorite.java +++ b/src/main/java/com/hbm/world/feature/Meteorite.java @@ -5,6 +5,8 @@ import java.util.List; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; +import com.hbm.config.GeneralConfig; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionParticle; @@ -32,7 +34,7 @@ public class Meteorite { e.attackEntityFrom(ModDamageSource.meteorite, 1000); } - if(MainRegistry.enableSpecialMeteors) + if(GeneralConfig.enableSpecialMeteors) switch(rand.nextInt(300)) { case 0: //Meteor-only tiny meteorite @@ -119,8 +121,8 @@ public class Meteorite { entity0.posX = x + 0.5D; entity0.posY = y + 0.5D; entity0.posZ = z + 0.5D; - entity0.destructionRange = MainRegistry.fatmanRadius; - entity0.speed = MainRegistry.blastSpeed; + entity0.destructionRange = BombConfig.fatmanRadius; + entity0.speed = BombConfig.blastSpeed; entity0.coefficient = 10.0F; world.spawnEntityInWorld(entity0);