1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2025-06-19 23:41:27 +02:00

fix matchPotionType: correctly match extended and upgraded potions fixes

This commit is contained in:
Jake Ben-Tovim 2025-05-25 11:21:36 -07:00 committed by GitHub
parent c3103beea2
commit 045f1bdfb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -79,8 +79,8 @@ public class PotionUtil {
String updatedName = convertLegacyNames(partialName).toUpperCase();
return Arrays.stream(PotionType.values())
.filter(potionType -> getKeyGetKey(potionType).toUpperCase().contains(updatedName))
.filter(potionType -> !isUpgraded || potionType.name().toUpperCase().contains(STRONG))
.filter(potionType -> !isExtended || potionType.name().toUpperCase().contains(LONG))
.filter(potionType -> isUpgraded == potionType.name().toUpperCase().startsWith(STRONG + "_"))
.filter(potionType -> isExtended == potionType.name().toUpperCase().startsWith(LONG + "_"))
.findAny().orElse(null);
}
}