Search in sources :

Example 1 with ItmPotionEffect

use of com.dreammaster.modhazardousitems.HazardousItems.ItmPotionEffect in project NewHorizonsCoreMod by GTNewHorizons.

the class HazardousItemsHandler method InitSampleConfig.

public void InitSampleConfig() {
    // Create new DamageEffect
    ItmDamageEffect tFireEffect = _mHazFactory.createDamageEffect(0.5F, "inFire");
    // Create new Potioneffect
    ItmPotionEffect tPoisonPotion = _mHazFactory.createPotionEffect(100, Potion.poison.id, 1);
    // Define a testitem to hold these effects
    HazardousItem tHazItem = _mHazFactory.createHazardousItemsHazardousItem("tfarcenim:stone", true, true, true);
    HazardousFluid tHazFluid = _mHazFactory.createHazardousFluid("tfarcenim:water", true, true, true);
    // Add both effects to our defined testItem
    tHazItem.getDamageEffects().add(tFireEffect);
    tHazItem.getPotionEffects().add(tPoisonPotion);
    tHazFluid.getDamageEffects().add(tFireEffect);
    tHazFluid.getPotionEffects().add(tPoisonPotion);
    _mHazardItemsCollection = new HazardousItems();
    _mHazardItemsCollection.getHazardousItems().add(tHazItem);
    _mHazardItemsCollection.getHazardousFluids().add(tHazFluid);
}
Also used : HazardousFluid(com.dreammaster.modhazardousitems.HazardousItems.HazardousFluid) HazardousItem(com.dreammaster.modhazardousitems.HazardousItems.HazardousItem) ItmDamageEffect(com.dreammaster.modhazardousitems.HazardousItems.ItmDamageEffect) ItmPotionEffect(com.dreammaster.modhazardousitems.HazardousItems.ItmPotionEffect)

Example 2 with ItmPotionEffect

use of com.dreammaster.modhazardousitems.HazardousItems.ItmPotionEffect in project NewHorizonsCoreMod by GTNewHorizons.

the class HazardousItemsHandler method VerifyConfiguredPotionEffects.

/**
   * Verify defined potioneffects in configfile
   * 
   * @param pCollection
   * @return true if everything is ok
   */
public boolean VerifyConfiguredPotionEffects(HazardousItems pItemCollection) {
    boolean tResult = true;
    for (HazardousItem hi : pItemCollection.getHazardousItems()) {
        for (ItmPotionEffect ipe : hi.getPotionEffects()) {
            if (!PotionHelper.IsValidPotionID(ipe.getId())) {
                _mLogger.warn(String.format("HazardousItem [%s] has invalid PotionID: [%s] (There is no such potion)", hi.getItemName(), ipe.getId()));
                tResult = false;
            }
        }
    }
    for (HazardousFluid hf : pItemCollection.getHazardousFluids()) {
        for (ItmPotionEffect ipe : hf.getPotionEffects()) {
            if (!PotionHelper.IsValidPotionID(ipe.getId())) {
                _mLogger.warn(String.format("HazardousFluid [%s] has invalid PotionID: [%s] (There is no such potion)", hf.getFluidName(), ipe.getId()));
                tResult = false;
            }
        }
    }
    return tResult;
}
Also used : HazardousFluid(com.dreammaster.modhazardousitems.HazardousItems.HazardousFluid) HazardousItem(com.dreammaster.modhazardousitems.HazardousItems.HazardousItem) ItmPotionEffect(com.dreammaster.modhazardousitems.HazardousItems.ItmPotionEffect)

Example 3 with ItmPotionEffect

use of com.dreammaster.modhazardousitems.HazardousItems.ItmPotionEffect in project NewHorizonsCoreMod by GTNewHorizons.

the class HazardousObjectFactory method createPotionEffect.

public ItmPotionEffect createPotionEffect(int pDuration, int pPotionID, int pLevel) {
    ItmPotionEffect pEf = new ItmPotionEffect();
    pEf.setDuration(pDuration);
    pEf.setId(pPotionID);
    pEf.setLevel(pLevel);
    return pEf;
}
Also used : ItmPotionEffect(com.dreammaster.modhazardousitems.HazardousItems.ItmPotionEffect)

Aggregations

ItmPotionEffect (com.dreammaster.modhazardousitems.HazardousItems.ItmPotionEffect)3 HazardousFluid (com.dreammaster.modhazardousitems.HazardousItems.HazardousFluid)2 HazardousItem (com.dreammaster.modhazardousitems.HazardousItems.HazardousItem)2 ItmDamageEffect (com.dreammaster.modhazardousitems.HazardousItems.ItmDamageEffect)1