diff --git a/src/main/java/shukaro/warptheory/handlers/WarpEventRegistry.java b/src/main/java/shukaro/warptheory/handlers/WarpEventRegistry.java index 4cadeb5..ac281dd 100644 --- a/src/main/java/shukaro/warptheory/handlers/WarpEventRegistry.java +++ b/src/main/java/shukaro/warptheory/handlers/WarpEventRegistry.java @@ -56,14 +56,14 @@ public enum WarpEventRegistry { // Default Warp Theory warp events BATS(WarpBats::new, "Bats", "spawn bats", true, 30, false, false), BLINK(WarpBlink::new, "Blink", "random teleport", true, 130, false, false), - POISON(warp -> new WarpBuff("poison", warp, new PotionEffect(Potion.poison.id, 20 * 20)), "Poison", "poison", true, - 65, false, false), - NAUSEA(warp -> new WarpBuff("nausea", warp, new PotionEffect(Potion.confusion.id, 20 * 20)), "Nausea", "nausea", - true, 45, false, false), - JUMP(warp -> new WarpBuff("jump", warp, new PotionEffect(Potion.jump.id, 20 * 20, 20)), "Jump", "jump boost", true, - 45, false, false), - BLIND(warp -> new WarpBuff("blind", warp, new PotionEffect(Potion.blindness.id, 20 * 20)), "Blind", "blindness", + POISON(warp -> new WarpBuff("poison", warp, true, new PotionEffect(Potion.poison.id, 20 * 20)), "Poison", "poison", true, 65, false, false), + NAUSEA(warp -> new WarpBuff("nausea", warp, true, new PotionEffect(Potion.confusion.id, 20 * 20)), "Nausea", + "nausea", true, 45, false, false), + JUMP(warp -> new WarpBuff("jump", warp, true, new PotionEffect(Potion.jump.id, 20 * 20, 20)), "Jump", "jump boost", + true, 45, false, false), + BLIND(warp -> new WarpBuff("blind", warp, true, new PotionEffect(Potion.blindness.id, 20 * 20)), "Blind", + "blindness", true, 65, false, false), DECAY(WarpDecay::new, "Decay", "decay", true, 180, true, false), EARS(WarpEars::new, "Deaf", "ears (unable to read messages)", false, 75, false, false), SWAMP(WarpSwamp::new, "Swamp", "swamp (random trees)", true, 190, true, false), @@ -110,6 +110,7 @@ public enum WarpEventRegistry { warp -> new WarpBuff( "witherpotion", warp, + false, new PotionEffect(Potion.wither.id, 30 * 20, 2), new PotionEffect(Potion.hunger.id, 30 * 20, 2), new PotionEffect(Potion.moveSlowdown.id, 30 * 20, 2)), diff --git a/src/main/java/shukaro/warptheory/handlers/warpevents/WarpBuff.java b/src/main/java/shukaro/warptheory/handlers/warpevents/WarpBuff.java index fd95a17..624b702 100644 --- a/src/main/java/shukaro/warptheory/handlers/warpevents/WarpBuff.java +++ b/src/main/java/shukaro/warptheory/handlers/warpevents/WarpBuff.java @@ -12,10 +12,12 @@ public class WarpBuff extends IWarpEvent { + private final boolean preventCure; private final ImmutableList potionEffects; - public WarpBuff(String name, int minWarp, PotionEffect... effects) { + public WarpBuff(String name, int minWarp, boolean preventCure, PotionEffect... effects) { super(name, minWarp); + this.preventCure = preventCure; this.potionEffects = ImmutableList.copyOf(effects); } @@ -40,7 +42,10 @@ public boolean doEvent(World world, EntityPlayer player) { effect = new PotionEffect(id, duration, level); } - effect.getCurativeItems().clear(); + if (preventCure) { + effect.getCurativeItems().clear(); + } + player.addPotionEffect(effect); }