diff --git a/src/main/java/com/hbm/blocks/generic/WasteEarth.java b/src/main/java/com/hbm/blocks/generic/WasteEarth.java index e6e876f24..419574181 100644 --- a/src/main/java/com/hbm/blocks/generic/WasteEarth.java +++ b/src/main/java/com/hbm/blocks/generic/WasteEarth.java @@ -4,8 +4,8 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.config.GeneralConfig; +import com.hbm.config.RadiationConfig; import com.hbm.lib.RefStrings; -import com.hbm.main.MainRegistry; import com.hbm.potion.HbmPotion; import cpw.mods.fml.relauncher.Side; @@ -159,7 +159,7 @@ public class WasteEarth extends Block { if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) { - if(GeneralConfig.enableAutoCleanup || (world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2)) { + if(RadiationConfig.cleanupDeadDirt || (world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2)) { world.setBlock(x, y, z, Blocks.dirt); } diff --git a/src/main/java/com/hbm/config/BombConfig.java b/src/main/java/com/hbm/config/BombConfig.java index 8e325df4f..3ad1da586 100644 --- a/src/main/java/com/hbm/config/BombConfig.java +++ b/src/main/java/com/hbm/config/BombConfig.java @@ -25,10 +25,12 @@ public class BombConfig { public static int falloutRange = 100; public static int fDelay = 4; public static int limitExplosionLifespan = 0; + public static int rain = 0; + public static int cont = 0; public static void loadFromConfig(Configuration config) { - final String CATEGORY_NUKES = "03_nukes"; + final String CATEGORY_NUKES = CommonConfig.CATEGORY_NUKES; Property propGadget = config.get(CATEGORY_NUKES, "3.00_gadgetRadius", 150); propGadget.comment = "Radius of the Gadget"; gadgetRadius = propGadget.getInt(); @@ -72,7 +74,7 @@ public class BombConfig { propN2.comment = "Radius of the N2 mine"; n2Radius = propN2.getInt(); - final String CATEGORY_NUKE = "06_explosions"; + final String CATEGORY_NUKE = CommonConfig.CATEGORY_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(); @@ -91,5 +93,12 @@ public class BombConfig { Property falloutDelayProp = config.get(CATEGORY_NUKE, "6.04_falloutDelay", 4); falloutDelayProp.comment = "How many ticks to wait for the next fallout chunk computation"; fDelay = falloutDelayProp.getInt(); + + 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(); + Property rainCont = config.get(CATEGORY_NUKE, "6.06_falloutRainRadiation", 0); + rainCont.comment = "Radiation in 100th RADs created by fallout rain"; + cont = rainCont.getInt(); } } diff --git a/src/main/java/com/hbm/config/CommonConfig.java b/src/main/java/com/hbm/config/CommonConfig.java index 59cc4f297..2c9b88e1e 100644 --- a/src/main/java/com/hbm/config/CommonConfig.java +++ b/src/main/java/com/hbm/config/CommonConfig.java @@ -6,6 +6,22 @@ import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; public class CommonConfig { + + public static final String CATEGORY_GENERAL = "01_general"; + public static final String CATEGORY_ORES = "02_ores"; + public static final String CATEGORY_NUKES = "03_nukes"; + public static final String CATEGORY_DUNGEONS = "04_dungeons"; + public static final String CATEGORY_METEORS = "05_meteors"; + public static final String CATEGORY_EXPLOSIONS = "06_explosions"; + public static final String CATEGORY_MISSILE = "07_missile_machines"; + public static final String CATEGORY_POTION = "08_potion_effects"; + public static final String CATEGORY_MACHINES = "09_machines"; + public static final String CATEGORY_DROPS = "10_dangerous_drops"; + public static final String CATEGORY_TOOLS = "11_tools"; + public static final String CATEGORY_MOBS = "12_mobs"; + public static final String CATEGORY_RADIATION = "13_radiation"; + + public static final String CATEGORY_528 = "528"; public static int setDefZero(int value, int def) { @@ -30,28 +46,30 @@ public class CommonConfig { } public 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(); } - public static boolean createConfigBool(Configuration config, String category, String name, String comment, boolean def) { + public static double createConfigDouble(Configuration config, String category, String name, String comment, double def) { + Property prop = config.get(category, name, def); + prop.comment = comment; + return prop.getDouble(); + } + public 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(); } public static String createConfigString(Configuration config, String category, String name, String comment, String def) { - Property prop = config.get(category, name, def); prop.comment = comment; return prop.getString(); } public 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/config/GeneralConfig.java b/src/main/java/com/hbm/config/GeneralConfig.java index 391ad8516..8330e60c2 100644 --- a/src/main/java/com/hbm/config/GeneralConfig.java +++ b/src/main/java/com/hbm/config/GeneralConfig.java @@ -13,14 +13,8 @@ public class GeneralConfig { 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; @@ -42,7 +36,7 @@ public class GeneralConfig { public static void loadFromConfig(Configuration config) { - final String CATEGORY_GENERAL = "01_general"; + final String CATEGORY_GENERAL = CommonConfig.CATEGORY_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); @@ -52,14 +46,8 @@ public class GeneralConfig { 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); @@ -70,7 +58,7 @@ public class GeneralConfig { enableReflectorCompat = config.get(CATEGORY_GENERAL, "1.24_enableReflectorCompat", false).getBoolean(false); enableRenderDistCheck = config.get(CATEGORY_GENERAL, "1.25_enableRenderDistCheck", true).getBoolean(true); - final String CATEGORY_528 = "528"; + final String CATEGORY_528 = CommonConfig.CATEGORY_528; config.addCustomCategoryComment(CATEGORY_528, "CAUTION\n" + "528 Mode: Please proceed with caution!\n" diff --git a/src/main/java/com/hbm/config/MachineConfig.java b/src/main/java/com/hbm/config/MachineConfig.java index 555bfd4a8..ffa932dde 100644 --- a/src/main/java/com/hbm/config/MachineConfig.java +++ b/src/main/java/com/hbm/config/MachineConfig.java @@ -9,7 +9,7 @@ public class MachineConfig { public static void loadFromConfig(Configuration config) { - final String CATEGORY_MACHINE = "09_machines"; + final String CATEGORY_MACHINE = CommonConfig.CATEGORY_MACHINES; scaleRTGPower = CommonConfig.createConfigBool(config, CATEGORY_MACHINE, "9.00_scaleRTGPower", "Should RTG/Betavoltaic fuel power scale down as it decays?", false); doRTGsDecay = CommonConfig.createConfigBool(config, CATEGORY_MACHINE, "9.01_doRTGsDecay", "Should RTG/Betavoltaic fuel decay at all?", true); diff --git a/src/main/java/com/hbm/config/MobConfig.java b/src/main/java/com/hbm/config/MobConfig.java index c98ee9c95..cd01ac0c8 100644 --- a/src/main/java/com/hbm/config/MobConfig.java +++ b/src/main/java/com/hbm/config/MobConfig.java @@ -29,7 +29,7 @@ public class MobConfig { public static void loadFromConfig(Configuration config) { - final String CATEGORY = "12_mobs"; + final String CATEGORY = CommonConfig.CATEGORY_MOBS; enableMaskman = CommonConfig.createConfigBool(config, CATEGORY, "12.M00_enableMaskman", "Whether mask man should spawn", true); maskmanDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.M01_maskmanDelay", "How many world ticks need to pass for a check to be performed", 60 * 60 * 60); diff --git a/src/main/java/com/hbm/config/PotionConfig.java b/src/main/java/com/hbm/config/PotionConfig.java index 415c77e3f..cf235cd68 100644 --- a/src/main/java/com/hbm/config/PotionConfig.java +++ b/src/main/java/com/hbm/config/PotionConfig.java @@ -20,7 +20,7 @@ public class PotionConfig { public static void loadFromConfig(Configuration config) { - final String CATEGORY_POTION = "08_potion_effects"; + final String CATEGORY_POTION = CommonConfig.CATEGORY_POTION; taintID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.00_taintPotionID", "What potion ID the taint effect will have", 62); radiationID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.01_radiationPotionID", "What potion ID the radiation effect will have", 63); bangID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.02_bangPotionID", "What potion ID the B93 timebomb effect will have", 64); diff --git a/src/main/java/com/hbm/config/RadiationConfig.java b/src/main/java/com/hbm/config/RadiationConfig.java index 446497037..9723b9001 100644 --- a/src/main/java/com/hbm/config/RadiationConfig.java +++ b/src/main/java/com/hbm/config/RadiationConfig.java @@ -5,37 +5,31 @@ import net.minecraftforge.common.config.Property; public class RadiationConfig { - 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 double hellRad = 0.1; public static int worldRad = 10; public static int worldRadThreshold = 20; public static boolean worldRadEffects = true; + public static boolean cleanupDeadDirt = false; + + public static boolean enableContamination = true; + public static boolean enableChunkRads = true; public static void loadFromConfig(Configuration config) { - final String CATEGORY_NUKE = "06_explosions"; + final String CATEGORY_NUKE = CommonConfig.CATEGORY_RADIATION; - 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(); - Property rainCont = config.get(CATEGORY_NUKE, "6.06_falloutRainRadiation", 0); - rainCont.comment = "Radiation in 100th RADs created by fallout rain"; - cont = rainCont.getInt(); - Property fogThresh = config.get(CATEGORY_NUKE, "6.07_fogThreshold", 100); - fogThresh.comment = "Radiation in RADs required for fog to spawn"; - fogRad = fogThresh.getInt(); - Property fogChance = config.get(CATEGORY_NUKE, "6.08_fogChance", 10); - fogChance.comment = "1:n chance of fog spawning every second"; - fogCh = fogChance.getInt(); - 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 = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "6.10_worldRadCount", "How many block operations radiation can perform per tick", 10); - worldRadThreshold = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "6.11_worldRadThreshold", "The least amount of RADs required for block modification to happen", 20); - worldRadEffects = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "6.12_worldRadEffects", "Whether high radiation levels should perform changes in the world", true); + fogRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "FOG_00_threshold", "Radiation in RADs required for fog to spawn", 100); + fogCh = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "FOG_01_threshold", "1:n chance of fog spawning every second", 20); + hellRad = CommonConfig.createConfigDouble(config, CATEGORY_NUKE, "AMBIENT_00_nether", "RAD/s in the nether", 0.1D); + worldRadEffects = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADWORLD_00_toggle", "Whether high radiation levels should perform changes in the world", true); + worldRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "RADWORLD_01_amount", "How many block operations radiation can perform per tick", 10); + worldRadThreshold = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "RADWORLD_02_minimum", "The least amount of RADs required for block modification to happen", 20); + cleanupDeadDirt = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADWORLD_03_regrow", "Whether dead grass and mycelium should decay into dirt", false); + + enableContamination = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADIATION_00_enableContamination", "Toggles player contamination (and negative effects from radiation poisoning)", true); + enableChunkRads = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADIATION_01_enableChunkRads", "Toggles the world radiation system (chunk radiation only, some blocks use an AoE!)", true); fogCh = CommonConfig.setDef(fogCh, 20); } diff --git a/src/main/java/com/hbm/config/ToolConfig.java b/src/main/java/com/hbm/config/ToolConfig.java index c20bb03d5..fd03a0fe7 100644 --- a/src/main/java/com/hbm/config/ToolConfig.java +++ b/src/main/java/com/hbm/config/ToolConfig.java @@ -21,7 +21,7 @@ public class ToolConfig { public static void loadFromConfig(Configuration config) { - final String CATEGORY_TOOLS = "11_tools"; + final String CATEGORY_TOOLS = CommonConfig.CATEGORY_TOOLS; recursionDepth = CommonConfig.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 = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.01_recursionStone", "Determines whether veinminer can break stone", false); recursiveNetherrack = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.02_recursionNetherrack", "Determines whether veinminer can break netherrack", false); diff --git a/src/main/java/com/hbm/config/WeaponConfig.java b/src/main/java/com/hbm/config/WeaponConfig.java index c523cef48..88c3dbdae 100644 --- a/src/main/java/com/hbm/config/WeaponConfig.java +++ b/src/main/java/com/hbm/config/WeaponConfig.java @@ -18,7 +18,7 @@ public class WeaponConfig { public static void loadFromConfig(Configuration config) { - final String CATEGORY_MISSILE = "07_missile_machines"; + final String CATEGORY_MISSILE = CommonConfig.CATEGORY_MISSILE; 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(); @@ -32,7 +32,7 @@ public class WeaponConfig { propCiwsHitrate.comment = "Additional modifier for CIWS accuracy"; ciwsHitrate = propRadarAltitude.getInt(); - final String CATEGORY_DROPS = "10_dangerous_drops"; + final String CATEGORY_DROPS = CommonConfig.CATEGORY_DROPS; dropCell = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.00_dropCell", "Whether antimatter cells should explode when dropped", true); dropSing = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.01_dropBHole", "Whether singularities and black holes should spawn when dropped", true); dropStar = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.02_dropStar", "Whether rigged star blaster cells should explode when dropped", true); diff --git a/src/main/java/com/hbm/config/WorldConfig.java b/src/main/java/com/hbm/config/WorldConfig.java index 34e6d18a1..5944049ed 100644 --- a/src/main/java/com/hbm/config/WorldConfig.java +++ b/src/main/java/com/hbm/config/WorldConfig.java @@ -1,7 +1,6 @@ package com.hbm.config; import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; public class WorldConfig { @@ -77,13 +76,17 @@ public class WorldConfig { public static int radfreq = 5000; public static int vaultfreq = 2500; + public static boolean enableMeteorStrikes = true; + public static boolean enableMeteorShowers = true; + public static boolean enableMeteorTails = true; + public static boolean enableSpecialMeteors = true; public static int meteorStrikeChance = 20 * 60 * 180; public static int meteorShowerChance = 20 * 60 * 5; public static int meteorShowerDuration = 6000; public static void loadFromConfig(Configuration config) { - final String CATEGORY_OREGEN = "02_ores"; + final String CATEGORY_OREGEN = CommonConfig.CATEGORY_ORES; overworldOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D00_overworldOres", "General switch for whether overworld ores should be generated. Does not include special structures like oil.", true); netherOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D01_netherOres", "General switch for whether nether ores should be generated.", true); @@ -130,7 +133,7 @@ public class WorldConfig { enableRandom = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.R00_enableRandomOre", "Amount of random ore per chunk", false); randomSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.R01_randomOreSpawnrate", "Amount of random ore per chunk", 0); - final String CATEGORY_DUNGEON = "04_dungeons"; + final String CATEGORY_DUNGEON = CommonConfig.CATEGORY_DUNGEONS; radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500); antennaStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.01_antennaSpawn", "Spawn antenna on every nTH chunk", 250); atomStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.02_atomSpawn", "Spawn power plant on every nTH chunk", 500); @@ -157,16 +160,14 @@ public class WorldConfig { jungleStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.23_jungleDungeonSpawn", "Spawn jungle dungeon on every nTH chunk", 2000); pyramidStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.24_pyramidSpawn", "Spawn pyramid on every nTH chunk", 4000); - 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_METEOR = CommonConfig.CATEGORY_METEORS; + enableMeteorStrikes = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.00_enableMeteorStrikes", "Toggles the spawning of meteors", true); + enableMeteorShowers = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.01_enableMeteorShowers", "Toggles meteor showers, which start with a 1% chance for every spawned meteor", true); + enableMeteorTails = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.02_enableMeteorTails", "Toggles the particle effect created by falling meteors", true); + enableSpecialMeteors = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.03_enableSpecialMeteors", "Toggles rare, special meteor types with different impact effects", true); + meteorStrikeChance = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.03_meteorStrikeChance", "The probability of a meteor spawning (an average of once every nTH ticks)", 20 * 60 * 60 * 5); + meteorShowerChance = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.04_meteorShowerChance", "The probability of a meteor spawning during meteor shower (an average of once every nTH ticks)", 20 * 60 * 15); + meteorShowerDuration = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.05_meteorShowerDuration", "Max duration of meteor shower in ticks", 20 * 60 * 30); radioStructure = CommonConfig.setDefZero(radioStructure, 1000); antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000); diff --git a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java index 67963d3ef..b875bcd87 100644 --- a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java +++ b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java @@ -65,12 +65,12 @@ public class EntityFalloutRain extends Entity { tickDelay--; if(this.isDead) { - if(RadiationConfig.rain > 0 && getScale() > 150) { + if(BombConfig.rain > 0 && getScale() > 150) { worldObj.getWorldInfo().setRaining(true); worldObj.getWorldInfo().setThundering(true); - worldObj.getWorldInfo().setRainTime(RadiationConfig.rain); - worldObj.getWorldInfo().setThunderTime(RadiationConfig.rain); - AuxSavedData.setThunder(worldObj, RadiationConfig.rain); + worldObj.getWorldInfo().setRainTime(BombConfig.rain); + worldObj.getWorldInfo().setThunderTime(BombConfig.rain); + AuxSavedData.setThunder(worldObj, BombConfig.rain); } } } diff --git a/src/main/java/com/hbm/entity/projectile/EntityMeteor.java b/src/main/java/com/hbm/entity/projectile/EntityMeteor.java index f0dd248ff..9686b6d23 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityMeteor.java +++ b/src/main/java/com/hbm/entity/projectile/EntityMeteor.java @@ -1,6 +1,6 @@ package com.hbm.entity.projectile; -import com.hbm.config.GeneralConfig; +import com.hbm.config.WorldConfig; import com.hbm.explosion.ExplosionLarge; import com.hbm.main.MainRegistry; import com.hbm.world.feature.Meteorite; @@ -36,7 +36,7 @@ public class EntityMeteor extends Entity { if(!this.worldObj.isRemote && this.onGround && this.posY < 260) { worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), true); - if(GeneralConfig.enableMeteorTails) { + if(WorldConfig.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); @@ -49,7 +49,7 @@ public class EntityMeteor extends Entity { this.setDead(); } - if(GeneralConfig.enableMeteorTails && worldObj.isRemote) { + if(WorldConfig.enableMeteorTails && worldObj.isRemote) { NBTTagCompound data = new NBTTagCompound(); data.setString("type", "exhaust"); diff --git a/src/main/java/com/hbm/extprop/HbmLivingProps.java b/src/main/java/com/hbm/extprop/HbmLivingProps.java index 99add36c4..9b691a3cb 100644 --- a/src/main/java/com/hbm/extprop/HbmLivingProps.java +++ b/src/main/java/com/hbm/extprop/HbmLivingProps.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; +import com.hbm.config.RadiationConfig; import com.hbm.entity.mob.EntityDuck; import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; @@ -63,14 +64,22 @@ public class HbmLivingProps implements IExtendedEntityProperties { /// RADIATION /// public static float getRadiation(EntityLivingBase entity) { + if(!RadiationConfig.enableContamination) + return 0; + return getData(entity).radiation; } public static void setRadiation(EntityLivingBase entity, float rad) { - getData(entity).radiation = rad; + if(RadiationConfig.enableContamination) + getData(entity).radiation = rad; } public static void incrementRadiation(EntityLivingBase entity, float rad) { + + if(!RadiationConfig.enableContamination) + return; + HbmLivingProps data = getData(entity); float radiation = getData(entity).radiation + rad; diff --git a/src/main/java/com/hbm/handler/BossSpawnHandler.java b/src/main/java/com/hbm/handler/BossSpawnHandler.java index bcfe40033..65b042a1d 100644 --- a/src/main/java/com/hbm/handler/BossSpawnHandler.java +++ b/src/main/java/com/hbm/handler/BossSpawnHandler.java @@ -117,7 +117,7 @@ public class BossSpawnHandler { } } - if(GeneralConfig.enableMeteorStrikes && !world.isRemote) { + if(WorldConfig.enableMeteorStrikes && !world.isRemote) { meteorUpdate(world); } @@ -198,7 +198,7 @@ public class BossSpawnHandler { MainRegistry.logger.info("Ended meteor shower."); } - if(meteorRand.nextInt(WorldConfig.meteorStrikeChance * 100) == 0 && GeneralConfig.enableMeteorShowers) { + if(meteorRand.nextInt(WorldConfig.meteorStrikeChance * 100) == 0 && WorldConfig.enableMeteorShowers) { meteorShower = (int)(WorldConfig.meteorShowerDuration * 0.75 + WorldConfig.meteorShowerDuration * 0.25 * meteorRand.nextFloat()); if(GeneralConfig.enableDebugMode) diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java index c3cb37de1..49fa4f22d 100644 --- a/src/main/java/com/hbm/handler/EntityEffectHandler.java +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.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.config.GeneralConfig; import com.hbm.config.RadiationConfig; import com.hbm.explosion.ExplosionNukeSmall; @@ -121,15 +122,14 @@ public class EntityEffectHandler { float rad = ChunkRadiationManager.proxy.getRadiation(world, ix, iy, iz); if(world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad) - rad = RadiationConfig.hellRad; + rad = (float) RadiationConfig.hellRad; if(rad > 0) { ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, rad / 20F); } - if(entity.worldObj.isRaining() && RadiationConfig.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && entity.worldObj.canBlockSeeTheSky(ix, iy, iz)) { - - ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, RadiationConfig.cont * 0.0005F); + if(entity.worldObj.isRaining() && BombConfig.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && entity.worldObj.canBlockSeeTheSky(ix, iy, iz)) { + ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, BombConfig.cont * 0.0005F); } if(entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode) diff --git a/src/main/java/com/hbm/handler/radiation/ChunkRadiationManager.java b/src/main/java/com/hbm/handler/radiation/ChunkRadiationManager.java index 2a327f1fe..4eea00856 100644 --- a/src/main/java/com/hbm/handler/radiation/ChunkRadiationManager.java +++ b/src/main/java/com/hbm/handler/radiation/ChunkRadiationManager.java @@ -16,27 +16,27 @@ public class ChunkRadiationManager { @SubscribeEvent public void onWorldLoad(WorldEvent.Load event) { - proxy.receiveWorldLoad(event); + if(RadiationConfig.enableChunkRads) proxy.receiveWorldLoad(event); } @SubscribeEvent public void onWorldUnload(WorldEvent.Unload event) { - proxy.receiveWorldUnload(event); + if(RadiationConfig.enableChunkRads) proxy.receiveWorldUnload(event); } @SubscribeEvent public void onChunkLoad(ChunkDataEvent.Load event) { - proxy.receiveChunkLoad(event); + if(RadiationConfig.enableChunkRads) proxy.receiveChunkLoad(event); } @SubscribeEvent public void onChunkSave(ChunkDataEvent.Save event) { - proxy.receiveChunkSave(event); + if(RadiationConfig.enableChunkRads) proxy.receiveChunkSave(event); } @SubscribeEvent public void onChunkUnload(ChunkEvent.Unload event) { - proxy.receiveChunkUnload(event); + if(RadiationConfig.enableChunkRads) proxy.receiveChunkUnload(event); } int eggTimer = 0; @@ -44,7 +44,7 @@ public class ChunkRadiationManager { @SubscribeEvent public void updateSystem(TickEvent.ServerTickEvent event) { - if(event.side == Side.SERVER && event.phase == Phase.END) { + if(RadiationConfig.enableChunkRads && event.side == Side.SERVER && event.phase == Phase.END) { eggTimer++; diff --git a/src/main/java/com/hbm/items/armor/ArmorFSB.java b/src/main/java/com/hbm/items/armor/ArmorFSB.java index be08d063c..d86dd00bb 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSB.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSB.java @@ -27,6 +27,7 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; @@ -530,6 +531,9 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { List entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.expand(3, 0, 3)); for(Entity e : entities) { + + if(e instanceof EntityItem) + continue; Vec3 vec = Vec3.createVectorHelper(player.posX - e.posX, 0, player.posZ - e.posZ); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 8913738e7..fb18842c8 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -742,7 +742,7 @@ public class ModEventHandler { /// TOM IMPACT END/// /// RADIATION STUFF START /// - if(event.world != null && !event.world.isRemote && GeneralConfig.enableRads) { + if(event.world != null && !event.world.isRemote) { int thunder = AuxSavedData.getThunder(event.world); diff --git a/src/main/java/com/hbm/util/ContaminationUtil.java b/src/main/java/com/hbm/util/ContaminationUtil.java index 6e8705b86..1710ff5cf 100644 --- a/src/main/java/com/hbm/util/ContaminationUtil.java +++ b/src/main/java/com/hbm/util/ContaminationUtil.java @@ -1,6 +1,5 @@ package com.hbm.util; -import com.hbm.config.GeneralConfig; import com.hbm.entity.mob.EntityDuck; import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.mob.EntityQuackos; @@ -274,7 +273,7 @@ public class ContaminationUtil { return false; } - if(hazard == HazardType.RADIATION && (isRadImmune(entity) || !GeneralConfig.enableRads)) + if(hazard == HazardType.RADIATION && isRadImmune(entity)) return false; switch(hazard) { diff --git a/src/main/java/com/hbm/world/feature/Meteorite.java b/src/main/java/com/hbm/world/feature/Meteorite.java index 17a09054e..3bbd1612a 100644 --- a/src/main/java/com/hbm/world/feature/Meteorite.java +++ b/src/main/java/com/hbm/world/feature/Meteorite.java @@ -6,6 +6,7 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.config.GeneralConfig; +import com.hbm.config.WorldConfig; import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionNT; import com.hbm.explosion.ExplosionNukeGeneric; @@ -37,7 +38,7 @@ public class Meteorite { e.attackEntityFrom(ModDamageSource.meteorite, 1000); } - if(GeneralConfig.enableSpecialMeteors) + if(WorldConfig.enableSpecialMeteors) switch(rand.nextInt(300)) { case 0: // Meteor-only tiny meteorite