diff --git a/changelog b/changelog index 8e9ac0516..4add55244 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,7 @@ * Nuclear craters have been reworked * The fallout effect no longer creates dead grass, instead it converts the area into three new biomes, the outer crater, crater and inner crater * The entire crater is now slaked sellafite which now has texture variance to look more like debris, as well as getting darker towards the center + * The biomes being overridden means that nukes are now a solution to thaumcraft taint. Yay! * The watz now cools up to 20% of its current heat level instead of 10%, making reactors a lot cooler and therefore react faster, which means more energy and faster depletion rates * Mud production rates have been halved, to prevent currently working setups from exploding instantly * This is your reminder that you can achieve more power, mud and depletion by building larger watz powerplants, i.e. stacking more watz segments on top of each other. Your tiny poo reactors make me sick. @@ -12,3 +13,4 @@ ## Fixed * Fixed a rare crash caused by radars force-loading chunks conflicting with certain mods' chunk loading changes +* Fixed PWR fuel rods not having any radiation value assigned to them diff --git a/src/main/java/com/hbm/config/WorldConfig.java b/src/main/java/com/hbm/config/WorldConfig.java index 30b356306..4aa3068b1 100644 --- a/src/main/java/com/hbm/config/WorldConfig.java +++ b/src/main/java/com/hbm/config/WorldConfig.java @@ -111,6 +111,10 @@ public class WorldConfig { public static int craterBiomeId = 80; public static int craterBiomeInnerId = 81; public static int craterBiomeOuterId = 82; + public static float craterBiomeRad = 5F; + public static float craterBiomeInnerRad = 25F; + public static float craterBiomeOuterRad = 0.5F; + public static float craterBiomeWaterMult = 5F; public static void loadFromConfig(Configuration config) { @@ -223,9 +227,13 @@ public class WorldConfig { meteorShowerDuration = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.05_meteorShowerDuration", "Max duration of meteor shower in ticks", 20 * 60 * 30); final String CATEGORY_BIOMES = CommonConfig.CATEGORY_BIOMES; - craterBiomeId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.00_craterBiomeId", "The numeric ID for the crater biome", 80); - craterBiomeInnerId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.01_craterBiomeInnerId", "The numeric ID for the inner crater biome", 81); - craterBiomeOuterId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.02_craterBiomeOuterId", "The numeric ID for the outer crater biome", 82); + craterBiomeId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.B00_craterBiomeId", "The numeric ID for the crater biome", 80); + craterBiomeInnerId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.B01_craterBiomeInnerId", "The numeric ID for the inner crater biome", 81); + craterBiomeOuterId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.B02_craterBiomeOuterId", "The numeric ID for the outer crater biome", 82); + craterBiomeRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R00_craterBiomeRad", "RAD/s for the crater biome", 0.5D); + craterBiomeInnerRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R01_craterBiomeInnerRad", "RAD/s for the inner crater biome", 5D); + craterBiomeOuterRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R02_craterBiomeOuterRad", "RAD/s for the outer crater biome", 25D); + craterBiomeWaterMult = (float) CommonConfig.createConfigDouble(config, CATEGORY_METEOR, "17.R03_craterBiomeWaterMult", "Multiplier for RAD/s in crater biomes when in water", 5D); radioStructure = CommonConfig.setDefZero(radioStructure, 1000); antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000); diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java index 296724e2d..b9ec033e7 100644 --- a/src/main/java/com/hbm/handler/EntityEffectHandler.java +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.java @@ -7,6 +7,7 @@ import java.util.Random; import com.hbm.config.BombConfig; import com.hbm.config.GeneralConfig; import com.hbm.config.RadiationConfig; +import com.hbm.config.WorldConfig; import com.hbm.explosion.ExplosionNukeSmall; import com.hbm.extprop.HbmLivingProps; import com.hbm.extprop.HbmPlayerProps; @@ -30,6 +31,7 @@ import com.hbm.util.ContaminationUtil; import com.hbm.util.ArmorRegistry.HazardClass; import com.hbm.util.ContaminationUtil.ContaminationType; import com.hbm.util.ContaminationUtil.HazardType; +import com.hbm.world.biome.BiomeGenCraterBase; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.block.Block; @@ -48,6 +50,7 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; public class EntityEffectHandler { @@ -57,6 +60,17 @@ public class EntityEffectHandler { HbmLivingProps.setRadBuf(entity, HbmLivingProps.getRadEnv(entity)); HbmLivingProps.setRadEnv(entity, 0); } + + if(entity instanceof EntityPlayer && entity == MainRegistry.proxy.me()) { + EntityPlayer player = MainRegistry.proxy.me(); + if(player != null) { + BiomeGenBase biome = player.worldObj.getBiomeGenForCoords((int) Math.floor(player.posX), (int) Math.floor(player.posZ)); + if(biome == BiomeGenCraterBase.craterBiome || biome == BiomeGenCraterBase.craterInnerBiome) { + Random rand = player.getRNG(); + for(int i = 0; i < 3; i++) player.worldObj.spawnParticle("townaura", player.posX + rand.nextGaussian() * 3, player.posY + rand.nextGaussian() * 2, player.posZ + rand.nextGaussian() * 3, 0, 0, 0); + } + } + } if(entity instanceof EntityPlayerMP) { HbmLivingProps props = HbmLivingProps.getData(entity); @@ -89,6 +103,18 @@ public class EntityEffectHandler { if(GeneralConfig.enable528 && entity instanceof EntityLivingBase && !entity.isImmuneToFire() && entity.worldObj.provider.isHellWorld) { entity.setFire(5); } + + BiomeGenBase biome = entity.worldObj.getBiomeGenForCoords((int) Math.floor(entity.posX), (int) Math.floor(entity.posZ)); + float radiation = 0; + if(biome == BiomeGenCraterBase.craterOuterBiome) radiation = WorldConfig.craterBiomeOuterRad; + if(biome == BiomeGenCraterBase.craterBiome) radiation = WorldConfig.craterBiomeRad; + if(biome == BiomeGenCraterBase.craterInnerBiome) radiation = WorldConfig.craterBiomeInnerRad; + + if(entity.isWet()) radiation *= WorldConfig.craterBiomeWaterMult; + + if(radiation > 0) { + ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, radiation / 20F); + } } handleContamination(entity); diff --git a/src/main/java/com/hbm/hazard/HazardRegistry.java b/src/main/java/com/hbm/hazard/HazardRegistry.java index b670bfde7..4b0476d24 100644 --- a/src/main/java/com/hbm/hazard/HazardRegistry.java +++ b/src/main/java/com/hbm/hazard/HazardRegistry.java @@ -13,6 +13,7 @@ import com.hbm.inventory.OreDictManager.DictFrame; import com.hbm.inventory.material.MaterialShapes; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemBreedingRod.BreedingRodType; +import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel; import com.hbm.items.machine.ItemRTGPelletDepleted.DepletedRTGMaterial; import com.hbm.items.machine.ItemWatzPellet.EnumWatzType; import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType; @@ -442,6 +443,22 @@ public class HazardRegistry { HazardSystem.register(DictFrame.fromOne(ModItems.watz_pellet, EnumWatzType.DU), makeData(RADIATION, u238 * ingot * 4)); HazardSystem.register(DictFrame.fromOne(ModItems.watz_pellet, EnumWatzType.NQD), makeData(RADIATION, u235 * ingot * 4)); HazardSystem.register(DictFrame.fromOne(ModItems.watz_pellet, EnumWatzType.NQR), makeData(RADIATION, pu239 * ingot * 4)); + + registerPWRFuel(EnumPWRFuel.MEU, uf * billet * 2); + registerPWRFuel(EnumPWRFuel.HEU233, u233 * billet * 2); + registerPWRFuel(EnumPWRFuel.HEU235, u235 * billet * 2); + registerPWRFuel(EnumPWRFuel.MEN, npf * billet * 2); + registerPWRFuel(EnumPWRFuel.HEN237, np237 * billet * 2); + registerPWRFuel(EnumPWRFuel.MOX, mox * billet * 2); + registerPWRFuel(EnumPWRFuel.MEP, purg * billet * 2); + registerPWRFuel(EnumPWRFuel.HEP239, pu239 * billet * 2); + registerPWRFuel(EnumPWRFuel.HEP241, pu241 * billet * 2); + registerPWRFuel(EnumPWRFuel.MEA, amrg * billet * 2); + registerPWRFuel(EnumPWRFuel.HEA242, am242 * billet * 2); + registerPWRFuel(EnumPWRFuel.HES326, sa326 * billet * 2); + registerPWRFuel(EnumPWRFuel.HES327, sa327 * billet * 2); + registerPWRFuel(EnumPWRFuel.BFB_AM_MIX, amrg * billet); + registerPWRFuel(EnumPWRFuel.BFB_PU241, pu241 * billet); HazardSystem.register(powder_yellowcake, makeData(RADIATION, yc * powder)); HazardSystem.register(block_yellowcake, makeData(RADIATION, yc * block * powder_mult)); @@ -535,6 +552,12 @@ public class HazardRegistry { private static HazardData makeData(HazardTypeBase hazard, float level) { return new HazardData().addEntry(hazard, level); } private static HazardData makeData(HazardTypeBase hazard, float level, boolean override) { return new HazardData().addEntry(hazard, level, override); } + private static void registerPWRFuel(EnumPWRFuel fuel, float baseRad) { + HazardSystem.register(DictFrame.fromOne(ModItems.pwr_fuel, fuel), makeData(RADIATION, baseRad)); + HazardSystem.register(DictFrame.fromOne(ModItems.pwr_fuel_hot, fuel), makeData(RADIATION, baseRad * 10).addEntry(HOT, 5)); + HazardSystem.register(DictFrame.fromOne(ModItems.pwr_fuel_depleted, fuel), makeData(RADIATION, baseRad * 10)); + } + private static void registerRBMKPellet(Item pellet, float base, float dep) { registerRBMKPellet(pellet, base, dep, false, 0F, 0F); } private static void registerRBMKPellet(Item pellet, float base, float dep, boolean linear) { registerRBMKPellet(pellet, base, dep, linear, 0F, 0F); } private static void registerRBMKPellet(Item pellet, float base, float dep, boolean linear, float blinding, float digamma) {