mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 13:26:56 +00:00
fix a few bugs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user