fix matchPotionType: correctly match extended and upgraded potions fixes #5181

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

View File

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