-
Notifications
You must be signed in to change notification settings - Fork 1
Accessing Protection System
Bartłomiej Stępień edited this page Sep 13, 2023
·
2 revisions
Eagle Factions provides a protection system that is used to determine if a player can do things inside claimed territories (but not only).
To use Protection System yourself you can use ProtectionManager
interface.
ProtectionManager protectionManager = eagleFactions.getProtectionManager();
ProtectionManager
contains many useful protection methods, take look here to get to know them.
For example, if you would want to know if player can break a block in a given location, you could you the following code:
ProtectionResult result = protectionManager.canBreak(blockSnapshot, player, shouldNotify); // shouldNotify tells the protection system to send player a message about not having access to given block
if (result.hasAccess()) {
// player can break this block! :D
} else {
// player cannot break this block :(
}
- Open an issue here on Github if you want to report a bug or suggest an enhancement
- Write to me on Spongepowered Forum
- Join my Discord server and contact me there