package net.paladrill.paladrillmod.procedure; import net.paladrill.paladrillmod.ElementsPaladrillmodMod; import net.minecraft.potion.PotionEffect; import net.minecraft.item.ItemStack; import net.minecraft.init.MobEffects; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.Entity; import java.util.Map; @ElementsPaladrillmodMod.ModElement.Tag public class ProcedureLegendaryStoneOfPowerRightClickedInAir extends ElementsPaladrillmodMod.ModElement { public ProcedureLegendaryStoneOfPowerRightClickedInAir(ElementsPaladrillmodMod instance) { super(instance, 265); } public static void executeProcedure(Map dependencies) { if (dependencies.get("entity") == null) { System.err.println("Failed to load dependency entity for procedure LegendaryStoneOfPowerRightClickedInAir!"); return; } if (dependencies.get("itemstack") == null) { System.err.println("Failed to load dependency itemstack for procedure LegendaryStoneOfPowerRightClickedInAir!"); return; } Entity entity = (Entity) dependencies.get("entity"); ItemStack itemstack = (ItemStack) dependencies.get("itemstack"); if (entity instanceof EntityLivingBase) ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.REGENERATION, (int) 240, (int) 3, (true), (true))); if (entity instanceof EntityLivingBase) ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, (int) 240, (int) 4, (true), (true))); if (entity instanceof EntityPlayer) ((EntityPlayer) entity).getCooldownTracker().setCooldown(((itemstack)).getItem(), (int) 192000); } }