Skip to content

Commit

Permalink
Fix Entity::getEffectLevel having two meanings when returning 0 (Mine…
Browse files Browse the repository at this point in the history
  • Loading branch information
Minikloon committed May 30, 2024
1 parent 5035c2b commit 5ac26b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/minestom/server/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1453,11 +1453,11 @@ public boolean hasEffect(@NotNull PotionEffect effect) {
* Gets the level of the specified effect.
*
* @param effect the effect type
* @return the effect level, 0 if not found
* @return the effect level, -1 if not found
*/
public int getEffectLevel(@NotNull PotionEffect effect) {
TimedPotion timedPotion = getEffect(effect);
return timedPotion == null ? 0 : timedPotion.potion().amplifier();
return timedPotion == null ? -1 : timedPotion.potion().amplifier();
}

/**
Expand Down

0 comments on commit 5ac26b1

Please sign in to comment.