Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/milk-cures-wither'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Apr 10, 2024
2 parents 700b2c2 + 429da08 commit ce5e52c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/main/java/shukaro/warptheory/handlers/WarpEventRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@

public class WarpBuff extends IWarpEvent {

private final boolean preventCure;
private final ImmutableList<PotionEffect> 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);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit ce5e52c

Please sign in to comment.