Commits

FearThe1337 authored and md_5 committed 59ca64d6aec
Fix the decoding of potions for Water.
No tags

src/main/java/org/bukkit/potion/Potion.java

Modified
388 388 /**
389 389 *
390 390 * @param damage the damage value
391 391 * @return the produced potion
392 392 * @deprecated Magic value
393 393 */
394 394 @Deprecated
395 395 public static Potion fromDamage(int damage) {
396 396 PotionType type = PotionType.getByDamageValue(damage & POTION_BIT);
397 397 Potion potion;
398 - if (type == null || (type == PotionType.WATER && damage != 0)) {
398 + if (type == null || type == PotionType.WATER) {
399 399 potion = new Potion(damage & NAME_BIT);
400 400 } else {
401 401 int level = (damage & TIER_BIT) >> TIER_SHIFT;
402 402 level++;
403 403 potion = new Potion(type, level);
404 404 }
405 405 if ((damage & SPLASH_BIT) > 0) {
406 406 potion = potion.splash();
407 407 }
408 408 if ((damage & EXTENDED_BIT) > 0) {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut