use of com.dreammaster.modhazardousitems.HazardousItems.ItmDamageEffect 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);
}
use of com.dreammaster.modhazardousitems.HazardousItems.ItmDamageEffect in project NewHorizonsCoreMod by GTNewHorizons.
the class HazardousItemsHandler method VerifyConfiguredDamageEffects.
/**
* Verify defined DamageEffects in configfile
*
* @param pCollection
* @return true if everything is ok
*/
public boolean VerifyConfiguredDamageEffects(HazardousItems pItemCollection) {
boolean tResult = true;
for (HazardousItem hi : pItemCollection.getHazardousItems()) {
for (ItmDamageEffect ide : hi.getDamageEffects()) {
if (!DamageTypeHelper.IsValidDamageSource(ide.getDamageSource())) {
_mLogger.warn(String.format("HazardousItem [%s] has invalid DamageSource entry: [%s]", hi.getItemName(), ide.getDamageSource()));
tResult = false;
}
}
}
for (HazardousFluid hf : pItemCollection.getHazardousFluids()) {
for (ItmDamageEffect ide : hf.getDamageEffects()) {
if (!DamageTypeHelper.IsValidDamageSource(ide.getDamageSource())) {
_mLogger.warn(String.format("HazardousFluid [%s] has invalid DamageSource entry: [%s]", hf.getFluidName(), ide.getDamageSource()));
tResult = false;
}
}
}
return tResult;
}
use of com.dreammaster.modhazardousitems.HazardousItems.ItmDamageEffect in project NewHorizonsCoreMod by GTNewHorizons.
the class HazardousObjectFactory method createDamageEffect.
public ItmDamageEffect createDamageEffect(Float pAmount, String pSource) {
ItmDamageEffect dEf = new ItmDamageEffect();
dEf.setAmount(pAmount);
dEf.setDamageSource(pSource);
return dEf;
}
Aggregations