Advertisement
Guest User

WEffectPotion.java

a guest
Dec 30th, 2012
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. package com.gmail.lopezitospriter.Weed;
  2.  
  3. import org.bukkit.entity.LivingEntity;
  4. import org.bukkit.potion.PotionEffect;
  5. import org.bukkit.potion.PotionEffectType;
  6.  
  7. public class WEffectPotion extends WEffect {
  8. private PotionEffectType effect;
  9. private Amplifier amp;
  10. private int amplitude, max_amplitude;
  11.  
  12. public WEffectPotion(PotionEffectType effect, int delay, int duration,
  13. int amplifyer, int max_amplifyer, Amplifier amp) {
  14. this.effect = effect;
  15. this.delay = delay;
  16. this.duration = duration;
  17. amplitude = amplifyer;
  18. max_amplitude = max_amplifyer;
  19. this.amp = amp;
  20. }
  21.  
  22. public PotionEffectType getEffect() {
  23. return effect;
  24. }
  25.  
  26. @Override
  27. public String getId() {
  28. return "potion_" + effect.getName();
  29. }
  30.  
  31. @Override
  32. public void apply(LivingEntity entity) {
  33. Weed.addPotionEffect(
  34. entity,
  35. new PotionEffect(effect, duration * 20, amp.getResult(
  36. Weed.getPotionEffectAmplitude(entity, effect),
  37. amplitude, max_amplitude)));
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement