Files
purpur-heights/src/main/java/games/dmg/spigotheights/StaturePotion.java
T
dmg fd601961eb
Release / release (push) Successful in 2m11s
CI / build (push) Successful in 54s
feat(potions): add restoration potion for default player size
2026-09-06 19:42:17 -04:00

30 lines
866 B
Java

package games.dmg.spigotheights;
import java.util.function.IntUnaryOperator;
public enum StaturePotion {
SHIFTING("Potion of Shifting Stature"),
GROWTH("Potion of Growth"),
DIMINUTION("Potion of Diminution"),
RESTORATION("Potion of Restoration");
private final String displayName;
StaturePotion(String displayName) {
this.displayName = displayName;
}
public double scaleAfterDrinking(double current, HeightSettings settings, IntUnaryOperator randomIndex) {
return switch (this) {
case SHIFTING -> HeightMath.randomScale(settings, randomIndex);
case GROWTH -> HeightMath.grow(current, settings);
case DIMINUTION -> HeightMath.shrink(current, settings);
case RESTORATION -> 1.0;
};
}
public String displayName() {
return displayName;
}
}