diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-30 16:32:45 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-30 16:32:45 +1000 |
commit | 5ba0476c5d9ffa41e272d35d8703543e5468c0b3 (patch) | |
tree | b88d7fbd38006859c1dbbdd6f4bfa64dfa0820a1 /src/Java/miscutil/core/util | |
parent | 31fa812d171e05b1756852155adecba90fb4f848 (diff) | |
download | GT5-Unofficial-5ba0476c5d9ffa41e272d35d8703543e5468c0b3.tar.gz GT5-Unofficial-5ba0476c5d9ffa41e272d35d8703543e5468c0b3.tar.bz2 GT5-Unofficial-5ba0476c5d9ffa41e272d35d8703543e5468c0b3.zip |
% Refined the Radiation handler.
> Now it does variable damage based on what material is being handled.
% Refined the material generation system.
> Radioactive materials no longer generate Gears, Rings, Screws, Bolts or Rotors. (No point or use.)
Diffstat (limited to 'src/Java/miscutil/core/util')
-rw-r--r-- | src/Java/miscutil/core/util/Utils.java | 29 | ||||
-rw-r--r-- | src/Java/miscutil/core/util/item/UtilsItems.java | 66 |
2 files changed, 72 insertions, 23 deletions
diff --git a/src/Java/miscutil/core/util/Utils.java b/src/Java/miscutil/core/util/Utils.java index 4a5f43b7c4..2419234e26 100644 --- a/src/Java/miscutil/core/util/Utils.java +++ b/src/Java/miscutil/core/util/Utils.java @@ -3,6 +3,8 @@ package miscutil.core.util; import static gregtech.api.enums.GT_Values.F; import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import ic2.core.IC2Potion; +import ic2.core.item.armor.ItemArmorHazmat; import java.awt.Color; import java.awt.Graphics; @@ -21,6 +23,7 @@ import miscutil.core.util.math.MathUtils; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -49,7 +52,7 @@ public class Utils { public static TC_AspectStack getTcAspectStack (TC_Aspects aspect, int size){ TC_AspectStack returnValue = null; - + if (aspect.name().toUpperCase() == "COGNITIO"){ //Adds in Compat for older GT Versions which Misspell aspects. try { @@ -57,7 +60,7 @@ public class Utils { } catch (NoSuchFieldError r){ Utils.LOG_INFO("Fallback TC Aspect found - "+aspect.name()+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR"); returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size); - + } } else if (aspect.name().toUpperCase() == "EXANIMUS"){ @@ -437,6 +440,28 @@ public class Utils { return true; } + public static boolean applyRadiationDamageToEntity(int damage, World world, Entity entityHolding){ + if (!world.isRemote){ + if (damage > 0 && (entityHolding instanceof EntityLivingBase)) { + EntityLivingBase entityLiving = (EntityLivingBase) entityHolding; + if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)) { + int duration; + if (entityLiving.getActivePotionEffect(IC2Potion.radiation) != null){ + //Utils.LOG_INFO("t"); + duration = (damage*5)+entityLiving.getActivePotionEffect(IC2Potion.radiation).getDuration(); + } + else { + //Utils.LOG_INFO("f"); + duration = damage*30; + } + IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15); + } + } + return true; + } + return false; + } + } diff --git a/src/Java/miscutil/core/util/item/UtilsItems.java b/src/Java/miscutil/core/util/item/UtilsItems.java index eca3d750af..8b1772305b 100644 --- a/src/Java/miscutil/core/util/item/UtilsItems.java +++ b/src/Java/miscutil/core/util/item/UtilsItems.java @@ -255,30 +255,54 @@ public class UtilsItems { } int sRadiation = 0; - if (materialName.toLowerCase().contains("uranium") || materialName.toLowerCase().contains("plutonium") || materialName.toLowerCase().contains("thorium")){ + if (materialName.toLowerCase().contains("uranium")){ sRadiation = 2; } - Item temp; - Block tempBlock; - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); - temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); - if (hotIngot){ - Item tempIngot = temp; - temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, UtilsItems.getSimpleStack(tempIngot, 1), materialTier); - } - temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, sRadiation); - temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, sRadiation); - temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation); + else if (materialName.toLowerCase().contains("plutonium")){ + sRadiation = 4; + } + else if (materialName.toLowerCase().contains("thorium")){ + sRadiation = 1; + } + if (sRadiation >= 1){ + Item temp; + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); + + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation); + + temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + } + + else { + Item temp; + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); + temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); + if (hotIngot){ + Item tempIngot = temp; + temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, UtilsItems.getSimpleStack(tempIngot, 1), materialTier); + } + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation); + + temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + temp = new BaseItemRing("itemRing"+unlocalizedName, materialName, Colour, materialTier); + temp = new BaseItemBolt("itemBolt"+unlocalizedName, materialName, Colour, materialTier); + temp = new BaseItemScrew("itemScrew"+unlocalizedName, materialName, Colour, materialTier); + temp = new BaseItemRotor("itemRotor"+unlocalizedName, materialName, Colour); + temp = new BaseItemGear("itemGear"+unlocalizedName, materialName, Colour, materialTier); + } - temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRing("itemRing"+unlocalizedName, materialName, Colour, materialTier); - temp = new BaseItemBolt("itemBolt"+unlocalizedName, materialName, Colour, materialTier); - temp = new BaseItemScrew("itemScrew"+unlocalizedName, materialName, Colour, materialTier); - temp = new BaseItemRotor("itemRotor"+unlocalizedName, materialName, Colour); - temp = new BaseItemGear("itemGear"+unlocalizedName, materialName, Colour, materialTier); } } |