Changed getAttacker comment and rearranged the method to prioritize playerAttacker.
This commit is contained in:
parent
fe481c91c8
commit
3503bf4417
|
@ -32,13 +32,17 @@ public class TreeDamageEvent extends PlayerEvent implements Cancellable {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return the attacker as either FallingBlock or Player
|
||||
* Get the attacker. This returns either a FallingBlock or a Player.
|
||||
* @return the attacker as Entity.
|
||||
*/
|
||||
public Entity getAttacker() {
|
||||
if (this.blockAttacker != null)
|
||||
return this.blockAttacker;
|
||||
if (this.playerAttacker != null)
|
||||
if (this.playerAttacker != null) {
|
||||
return this.playerAttacker;
|
||||
}
|
||||
if (this.blockAttacker != null) {
|
||||
return this.blockAttacker;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue