cleaned up some configs, more radiation config options

This commit is contained in:
Boblet 2022-04-06 13:32:17 +02:00
parent c40ba15023
commit 4071fc87bb
21 changed files with 110 additions and 87 deletions

View File

@ -4,8 +4,8 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig; import com.hbm.config.GeneralConfig;
import com.hbm.config.RadiationConfig;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.potion.HbmPotion; import com.hbm.potion.HbmPotion;
import cpw.mods.fml.relauncher.Side; 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(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); world.setBlock(x, y, z, Blocks.dirt);
} }

View File

@ -25,10 +25,12 @@ public class BombConfig {
public static int falloutRange = 100; public static int falloutRange = 100;
public static int fDelay = 4; public static int fDelay = 4;
public static int limitExplosionLifespan = 0; public static int limitExplosionLifespan = 0;
public static int rain = 0;
public static int cont = 0;
public static void loadFromConfig(Configuration config) { 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); Property propGadget = config.get(CATEGORY_NUKES, "3.00_gadgetRadius", 150);
propGadget.comment = "Radius of the Gadget"; propGadget.comment = "Radius of the Gadget";
gadgetRadius = propGadget.getInt(); gadgetRadius = propGadget.getInt();
@ -72,7 +74,7 @@ public class BombConfig {
propN2.comment = "Radius of the N2 mine"; propN2.comment = "Radius of the N2 mine";
n2Radius = propN2.getInt(); 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); 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"; 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(); limitExplosionLifespan = propLimitExplosionLifespan.getInt();
@ -91,5 +93,12 @@ public class BombConfig {
Property falloutDelayProp = config.get(CATEGORY_NUKE, "6.04_falloutDelay", 4); Property falloutDelayProp = config.get(CATEGORY_NUKE, "6.04_falloutDelay", 4);
falloutDelayProp.comment = "How many ticks to wait for the next fallout chunk computation"; falloutDelayProp.comment = "How many ticks to wait for the next fallout chunk computation";
fDelay = falloutDelayProp.getInt(); 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();
} }
} }

View File

@ -6,6 +6,22 @@ import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property; import net.minecraftforge.common.config.Property;
public class CommonConfig { 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) { 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) { public static int createConfigInt(Configuration config, String category, String name, String comment, int def) {
Property prop = config.get(category, name, def); Property prop = config.get(category, name, def);
prop.comment = comment; prop.comment = comment;
return prop.getInt(); 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); Property prop = config.get(category, name, def);
prop.comment = comment; prop.comment = comment;
return prop.getBoolean(); return prop.getBoolean();
} }
public static String createConfigString(Configuration config, String category, String name, String comment, String def) { public static String createConfigString(Configuration config, String category, String name, String comment, String def) {
Property prop = config.get(category, name, def); Property prop = config.get(category, name, def);
prop.comment = comment; prop.comment = comment;
return prop.getString(); return prop.getString();
} }
public static String[] createConfigStringList(Configuration config, String category, String name, String comment) { public static String[] createConfigStringList(Configuration config, String category, String name, String comment) {
Property prop = config.get(category, name, new String[] { "PLACEHOLDER" }); Property prop = config.get(category, name, new String[] { "PLACEHOLDER" });
prop.comment = comment; prop.comment = comment;
return prop.getStringList(); return prop.getStringList();

View File

@ -13,14 +13,8 @@ public class GeneralConfig {
public static boolean enableRad = true; public static boolean enableRad = true;
public static boolean enableNITAN = true; public static boolean enableNITAN = true;
public static boolean enableNukeClouds = 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 enableBomberShortMode = false;
public static boolean enableVaults = true; public static boolean enableVaults = true;
public static boolean enableRads = true;
public static boolean enableCataclysm = false; public static boolean enableCataclysm = false;
public static boolean enableExtendedLogging = false; public static boolean enableExtendedLogging = false;
public static boolean enableHardcoreTaint = false; public static boolean enableHardcoreTaint = false;
@ -42,7 +36,7 @@ public class GeneralConfig {
public static void loadFromConfig(Configuration config) { 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); enableDebugMode = config.get(CATEGORY_GENERAL, "1.00_enableDebugMode", false).getBoolean(false);
enableMycelium = config.get(CATEGORY_GENERAL, "1.01_enableMyceliumSpread", 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); 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); enableRad = config.get(CATEGORY_GENERAL, "1.06_enableRadHotspotSpawn", true).getBoolean(true);
enableNITAN = config.get(CATEGORY_GENERAL, "1.07_enableNITANChestSpawn", 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); 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); enableBomberShortMode = config.get(CATEGORY_GENERAL, "1.14_enableBomberShortMode", false).getBoolean(false);
enableVaults = config.get(CATEGORY_GENERAL, "1.15_enableVaultSpawn", true).getBoolean(true); 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); enableCataclysm = config.get(CATEGORY_GENERAL, "1.17_enableCataclysm", false).getBoolean(false);
enableExtendedLogging = config.get(CATEGORY_GENERAL, "1.18_enableExtendedLogging", 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); 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); enableReflectorCompat = config.get(CATEGORY_GENERAL, "1.24_enableReflectorCompat", false).getBoolean(false);
enableRenderDistCheck = config.get(CATEGORY_GENERAL, "1.25_enableRenderDistCheck", true).getBoolean(true); 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" config.addCustomCategoryComment(CATEGORY_528, "CAUTION\n"
+ "528 Mode: Please proceed with caution!\n" + "528 Mode: Please proceed with caution!\n"

View File

@ -9,7 +9,7 @@ public class MachineConfig {
public static void loadFromConfig(Configuration config) { 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); 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); doRTGsDecay = CommonConfig.createConfigBool(config, CATEGORY_MACHINE, "9.01_doRTGsDecay", "Should RTG/Betavoltaic fuel decay at all?", true);

View File

@ -29,7 +29,7 @@ public class MobConfig {
public static void loadFromConfig(Configuration config) { 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); 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); maskmanDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.M01_maskmanDelay", "How many world ticks need to pass for a check to be performed", 60 * 60 * 60);

View File

@ -20,7 +20,7 @@ public class PotionConfig {
public static void loadFromConfig(Configuration config) { 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); 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); 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); bangID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.02_bangPotionID", "What potion ID the B93 timebomb effect will have", 64);

View File

@ -5,37 +5,31 @@ import net.minecraftforge.common.config.Property;
public class RadiationConfig { public class RadiationConfig {
public static int rain = 0;
public static int cont = 0;
public static int fogRad = 100; public static int fogRad = 100;
public static int fogCh = 20; 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 worldRad = 10;
public static int worldRadThreshold = 20; public static int worldRadThreshold = 20;
public static boolean worldRadEffects = true; 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) { 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); fogRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "FOG_00_threshold", "Radiation in RADs required for fog to spawn", 100);
radRain.comment = "Duration of the thunderstorm after fallout in ticks (only large explosions)"; fogCh = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "FOG_01_threshold", "1:n chance of fog spawning every second", 20);
rain = radRain.getInt(); hellRad = CommonConfig.createConfigDouble(config, CATEGORY_NUKE, "AMBIENT_00_nether", "RAD/s in the nether", 0.1D);
Property rainCont = config.get(CATEGORY_NUKE, "6.06_falloutRainRadiation", 0); worldRadEffects = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADWORLD_00_toggle", "Whether high radiation levels should perform changes in the world", true);
rainCont.comment = "Radiation in 100th RADs created by fallout rain"; worldRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "RADWORLD_01_amount", "How many block operations radiation can perform per tick", 10);
cont = rainCont.getInt(); worldRadThreshold = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "RADWORLD_02_minimum", "The least amount of RADs required for block modification to happen", 20);
Property fogThresh = config.get(CATEGORY_NUKE, "6.07_fogThreshold", 100); cleanupDeadDirt = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADWORLD_03_regrow", "Whether dead grass and mycelium should decay into dirt", false);
fogThresh.comment = "Radiation in RADs required for fog to spawn";
fogRad = fogThresh.getInt(); enableContamination = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADIATION_00_enableContamination", "Toggles player contamination (and negative effects from radiation poisoning)", true);
Property fogChance = config.get(CATEGORY_NUKE, "6.08_fogChance", 10); enableChunkRads = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADIATION_01_enableChunkRads", "Toggles the world radiation system (chunk radiation only, some blocks use an AoE!)", true);
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);
fogCh = CommonConfig.setDef(fogCh, 20); fogCh = CommonConfig.setDef(fogCh, 20);
} }

View File

@ -21,7 +21,7 @@ public class ToolConfig {
public static void loadFromConfig(Configuration config) { 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); 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); 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); recursiveNetherrack = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.02_recursionNetherrack", "Determines whether veinminer can break netherrack", false);

View File

@ -18,7 +18,7 @@ public class WeaponConfig {
public static void loadFromConfig(Configuration config) { 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); Property propRadarRange = config.get(CATEGORY_MISSILE, "7.00_radarRange", 1000);
propRadarRange.comment = "Range of the radar, 50 will result in 100x100 block area covered"; propRadarRange.comment = "Range of the radar, 50 will result in 100x100 block area covered";
radarRange = propRadarRange.getInt(); radarRange = propRadarRange.getInt();
@ -32,7 +32,7 @@ public class WeaponConfig {
propCiwsHitrate.comment = "Additional modifier for CIWS accuracy"; propCiwsHitrate.comment = "Additional modifier for CIWS accuracy";
ciwsHitrate = propRadarAltitude.getInt(); 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); 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); 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); dropStar = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.02_dropStar", "Whether rigged star blaster cells should explode when dropped", true);

View File

@ -1,7 +1,6 @@
package com.hbm.config; package com.hbm.config;
import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
public class WorldConfig { public class WorldConfig {
@ -77,13 +76,17 @@ public class WorldConfig {
public static int radfreq = 5000; public static int radfreq = 5000;
public static int vaultfreq = 2500; 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 meteorStrikeChance = 20 * 60 * 180;
public static int meteorShowerChance = 20 * 60 * 5; public static int meteorShowerChance = 20 * 60 * 5;
public static int meteorShowerDuration = 6000; public static int meteorShowerDuration = 6000;
public static void loadFromConfig(Configuration config) { 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); 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); 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); 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); 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); 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); 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); 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); 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); pyramidStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.24_pyramidSpawn", "Spawn pyramid on every nTH chunk", 4000);
final String CATEGORY_METEOR = "05_meteors"; final String CATEGORY_METEOR = CommonConfig.CATEGORY_METEORS;
Property propMeteorStrikeChance = config.get(CATEGORY_METEOR, "5.00_meteorStrikeChance", 20 * 60 * 60 * 5); enableMeteorStrikes = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.00_enableMeteorStrikes", "Toggles the spawning of meteors", true);
propMeteorStrikeChance.comment = "The probability of a meteor spawning (an average of once every nTH ticks)"; enableMeteorShowers = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.01_enableMeteorShowers", "Toggles meteor showers, which start with a 1% chance for every spawned meteor", true);
meteorStrikeChance = propMeteorStrikeChance.getInt(); enableMeteorTails = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.02_enableMeteorTails", "Toggles the particle effect created by falling meteors", true);
Property propMeteorShowerChance = config.get(CATEGORY_METEOR, "5.01_meteorShowerChance", 20 * 60 * 15); enableSpecialMeteors = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.03_enableSpecialMeteors", "Toggles rare, special meteor types with different impact effects", true);
propMeteorShowerChance.comment = "The probability of a meteor spawning during meteor shower (an average of once every nTH ticks)"; 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 = propMeteorShowerChance.getInt(); 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);
Property propMeteorShowerDuration = config.get(CATEGORY_METEOR, "5.02_meteorShowerDuration", 20 * 60 * 30); meteorShowerDuration = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.05_meteorShowerDuration", "Max duration of meteor shower in ticks", 20 * 60 * 30);
propMeteorShowerDuration.comment = "Max duration of meteor shower in ticks";
meteorShowerDuration = propMeteorShowerDuration.getInt();
radioStructure = CommonConfig.setDefZero(radioStructure, 1000); radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000); antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000);

View File

@ -65,12 +65,12 @@ public class EntityFalloutRain extends Entity {
tickDelay--; tickDelay--;
if(this.isDead) { if(this.isDead) {
if(RadiationConfig.rain > 0 && getScale() > 150) { if(BombConfig.rain > 0 && getScale() > 150) {
worldObj.getWorldInfo().setRaining(true); worldObj.getWorldInfo().setRaining(true);
worldObj.getWorldInfo().setThundering(true); worldObj.getWorldInfo().setThundering(true);
worldObj.getWorldInfo().setRainTime(RadiationConfig.rain); worldObj.getWorldInfo().setRainTime(BombConfig.rain);
worldObj.getWorldInfo().setThunderTime(RadiationConfig.rain); worldObj.getWorldInfo().setThunderTime(BombConfig.rain);
AuxSavedData.setThunder(worldObj, RadiationConfig.rain); AuxSavedData.setThunder(worldObj, BombConfig.rain);
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.hbm.entity.projectile; package com.hbm.entity.projectile;
import com.hbm.config.GeneralConfig; import com.hbm.config.WorldConfig;
import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionLarge;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.world.feature.Meteorite; import com.hbm.world.feature.Meteorite;
@ -36,7 +36,7 @@ public class EntityMeteor extends Entity {
if(!this.worldObj.isRemote && this.onGround && this.posY < 260) { if(!this.worldObj.isRemote && this.onGround && this.posY < 260) {
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), true); 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, posY + 5, posZ, 75);
ExplosionLarge.spawnParticles(worldObj, posX + 5, posY, posZ, 75); ExplosionLarge.spawnParticles(worldObj, posX + 5, posY, 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(); this.setDead();
} }
if(GeneralConfig.enableMeteorTails && worldObj.isRemote) { if(WorldConfig.enableMeteorTails && worldObj.isRemote) {
NBTTagCompound data = new NBTTagCompound(); NBTTagCompound data = new NBTTagCompound();
data.setString("type", "exhaust"); data.setString("type", "exhaust");

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import com.hbm.config.RadiationConfig;
import com.hbm.entity.mob.EntityDuck; import com.hbm.entity.mob.EntityDuck;
import com.hbm.lib.ModDamageSource; import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
@ -63,14 +64,22 @@ public class HbmLivingProps implements IExtendedEntityProperties {
/// RADIATION /// /// RADIATION ///
public static float getRadiation(EntityLivingBase entity) { public static float getRadiation(EntityLivingBase entity) {
if(!RadiationConfig.enableContamination)
return 0;
return getData(entity).radiation; return getData(entity).radiation;
} }
public static void setRadiation(EntityLivingBase entity, float rad) { 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) { public static void incrementRadiation(EntityLivingBase entity, float rad) {
if(!RadiationConfig.enableContamination)
return;
HbmLivingProps data = getData(entity); HbmLivingProps data = getData(entity);
float radiation = getData(entity).radiation + rad; float radiation = getData(entity).radiation + rad;

View File

@ -117,7 +117,7 @@ public class BossSpawnHandler {
} }
} }
if(GeneralConfig.enableMeteorStrikes && !world.isRemote) { if(WorldConfig.enableMeteorStrikes && !world.isRemote) {
meteorUpdate(world); meteorUpdate(world);
} }
@ -198,7 +198,7 @@ public class BossSpawnHandler {
MainRegistry.logger.info("Ended meteor shower."); 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()); meteorShower = (int)(WorldConfig.meteorShowerDuration * 0.75 + WorldConfig.meteorShowerDuration * 0.25 * meteorRand.nextFloat());
if(GeneralConfig.enableDebugMode) if(GeneralConfig.enableDebugMode)

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import com.hbm.config.BombConfig;
import com.hbm.config.GeneralConfig; import com.hbm.config.GeneralConfig;
import com.hbm.config.RadiationConfig; import com.hbm.config.RadiationConfig;
import com.hbm.explosion.ExplosionNukeSmall; import com.hbm.explosion.ExplosionNukeSmall;
@ -121,15 +122,14 @@ public class EntityEffectHandler {
float rad = ChunkRadiationManager.proxy.getRadiation(world, ix, iy, iz); float rad = ChunkRadiationManager.proxy.getRadiation(world, ix, iy, iz);
if(world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad) if(world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad)
rad = RadiationConfig.hellRad; rad = (float) RadiationConfig.hellRad;
if(rad > 0) { if(rad > 0) {
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, rad / 20F); 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)) { 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);
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, RadiationConfig.cont * 0.0005F);
} }
if(entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode) if(entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode)

View File

@ -16,27 +16,27 @@ public class ChunkRadiationManager {
@SubscribeEvent @SubscribeEvent
public void onWorldLoad(WorldEvent.Load event) { public void onWorldLoad(WorldEvent.Load event) {
proxy.receiveWorldLoad(event); if(RadiationConfig.enableChunkRads) proxy.receiveWorldLoad(event);
} }
@SubscribeEvent @SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event) { public void onWorldUnload(WorldEvent.Unload event) {
proxy.receiveWorldUnload(event); if(RadiationConfig.enableChunkRads) proxy.receiveWorldUnload(event);
} }
@SubscribeEvent @SubscribeEvent
public void onChunkLoad(ChunkDataEvent.Load event) { public void onChunkLoad(ChunkDataEvent.Load event) {
proxy.receiveChunkLoad(event); if(RadiationConfig.enableChunkRads) proxy.receiveChunkLoad(event);
} }
@SubscribeEvent @SubscribeEvent
public void onChunkSave(ChunkDataEvent.Save event) { public void onChunkSave(ChunkDataEvent.Save event) {
proxy.receiveChunkSave(event); if(RadiationConfig.enableChunkRads) proxy.receiveChunkSave(event);
} }
@SubscribeEvent @SubscribeEvent
public void onChunkUnload(ChunkEvent.Unload event) { public void onChunkUnload(ChunkEvent.Unload event) {
proxy.receiveChunkUnload(event); if(RadiationConfig.enableChunkRads) proxy.receiveChunkUnload(event);
} }
int eggTimer = 0; int eggTimer = 0;
@ -44,7 +44,7 @@ public class ChunkRadiationManager {
@SubscribeEvent @SubscribeEvent
public void updateSystem(TickEvent.ServerTickEvent event) { 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++; eggTimer++;

View File

@ -27,6 +27,7 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -530,6 +531,9 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
List<Entity> entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.expand(3, 0, 3)); List<Entity> entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.expand(3, 0, 3));
for(Entity e : entities) { for(Entity e : entities) {
if(e instanceof EntityItem)
continue;
Vec3 vec = Vec3.createVectorHelper(player.posX - e.posX, 0, player.posZ - e.posZ); Vec3 vec = Vec3.createVectorHelper(player.posX - e.posX, 0, player.posZ - e.posZ);

View File

@ -742,7 +742,7 @@ public class ModEventHandler {
/// TOM IMPACT END/// /// TOM IMPACT END///
/// RADIATION STUFF START /// /// 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); int thunder = AuxSavedData.getThunder(event.world);

View File

@ -1,6 +1,5 @@
package com.hbm.util; package com.hbm.util;
import com.hbm.config.GeneralConfig;
import com.hbm.entity.mob.EntityDuck; import com.hbm.entity.mob.EntityDuck;
import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.mob.EntityQuackos; import com.hbm.entity.mob.EntityQuackos;
@ -274,7 +273,7 @@ public class ContaminationUtil {
return false; return false;
} }
if(hazard == HazardType.RADIATION && (isRadImmune(entity) || !GeneralConfig.enableRads)) if(hazard == HazardType.RADIATION && isRadImmune(entity))
return false; return false;
switch(hazard) { switch(hazard) {

View File

@ -6,6 +6,7 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig; import com.hbm.config.GeneralConfig;
import com.hbm.config.WorldConfig;
import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNT; import com.hbm.explosion.ExplosionNT;
import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionNukeGeneric;
@ -37,7 +38,7 @@ public class Meteorite {
e.attackEntityFrom(ModDamageSource.meteorite, 1000); e.attackEntityFrom(ModDamageSource.meteorite, 1000);
} }
if(GeneralConfig.enableSpecialMeteors) if(WorldConfig.enableSpecialMeteors)
switch(rand.nextInt(300)) { switch(rand.nextInt(300)) {
case 0: case 0:
// Meteor-only tiny meteorite // Meteor-only tiny meteorite