fix a few bugs

This commit is contained in:
2022-04-15 17:31:26 +02:00
parent 35f0e6c9d8
commit a8e606dab5
6 changed files with 47 additions and 23 deletions
@@ -65,6 +65,26 @@ public class PreventStabbyAPI {
return PreventStabby.getPlugin().getPlayerManager().canDamage(attacker.getUniqueId(), victim.getUniqueId(), sendDenyMessage);
}
/**
* Checks if player can be damaged by another. Providing UUID of entity other than player may result in exceptions
* @param attackerUuid Attacker's UUID
* @param victimUuid Victim's UUID
* @return True if victim can be attacked by attacker, false if not
*/
public static boolean canDamage(UUID attackerUuid, UUID victimUuid) {
return PreventStabby.getPlugin().getPlayerManager().canDamage(attackerUuid, victimUuid, false);
}
/**
* Checks if player can be damaged by another.
* @param attacker Attacker
* @param victim Victim
* @return True if victim can be attacked by attacker, false if not
*/
public static boolean canDamage(Player attacker, Player victim) {
return PreventStabby.getPlugin().getPlayerManager().canDamage(attacker.getUniqueId(), victim.getUniqueId(), false);
}
/**
* Checks if player has login protection.
* @param uuid UUID of player to check