Radiation protection API

  • Yeah Radioactivity is a PotionEffect that you can detect and maybe even prevent... Well i do not know exactly if you can make a prevent Potion effect or something but you can detect the effect with the API files..
    But thanks for that suggestion... I put that on my todolist.

  • Instead of removing it every tick, you could just give the armor a damage resistance of Integer.MAX_VALUE if the DamageSource irs radiation.

    I am newbie in mod development, just put some small fixes to existing code before, no serious work.


    How should i do that? Maybe i just "subscribe" to some damage event(LivingHurtEvent?) and cancel it if DamageSource is radiation(not sure if it's possible for this type of event, as i said, i am newbie and just began to read Forge docs).


    By the way what constant should it be? Should i just compare source with DamageSource("radiation") ?

  • Instead of removing it every tick, you could just give the armor a damage resistance of Integer.MAX_VALUE if the DamageSource irs radiation.

    That would stop the damage, but not the effects. The confusion and other effects that warp your sight, slow you down or are otherwise annoying. Also the radiation effect goes up to insanely long times quickly.

  • In answer to the original question of how IC2 checks for the hazmat suit to decide whether to apply the radiation effect, I found the following by decompiling, in ItemReactorUranium.class:

    Code
    public void func_77663_a(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem)
      {
        if ((entity instanceof EntityLivingBase))
        {
          EntityLivingBase entityLiving = (EntityLivingBase)entity;
          if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)) {
            IC2Potion.radiation.applyTo(entityLiving, 200, 100);
          }
        }
      }


    And here is ItemArmorHazmat.hasCompleteHazmat:


    Thus it's not really part of the api currently, and it doesn't lend itself well to armor that can have radiation protection added or removed, but I think it also means that living things other than players that pick up radioactive items will be affected.

    • Official Post

    I think it also means that living things other than players that pick up radioactive items will be affected.

    There's no will about it, they are. I've killed other mod's mobs from them picking up U-238 before.

    145 Mods isn't too many. 9 types of copper and 8 types of tin aren't too many. 3 types of coffee though?

    I know that you believe that you understood what you think I said, but I am not sure you realise that what you read was not what I meant.


    ---- Minecraft Crash Report ----
    // I just don't know what went wrong :(


    I see this too much.