-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
CraftBukkit versions following 0a1c89e4b1c
-
Yes
As of this commit allowing for negative power, the `power` field has become type `Integer` allowing it to be null (by default). The `getPower()` method does not, however, check for its nullability and does an unboxing operation to return a primitive `int`. This can be quickly fixed with a ternary.
@Override public int getPower() { - return this.power; + return hasPower() ? this.power : 0; }