-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from Awoo-industries/grief-prevention-overrides
Grief prevention overrides
- Loading branch information
Showing
7 changed files
with
214 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/dev/beeps/plugins/Depends/GriefPreventionApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package dev.beeps.plugins.Depends; | ||
|
||
import me.ryanhamshire.GriefPrevention.Claim; | ||
import me.ryanhamshire.GriefPrevention.ClaimPermission; | ||
import me.ryanhamshire.GriefPrevention.GriefPrevention; | ||
import org.bukkit.entity.Player; | ||
|
||
public class GriefPreventionApi { | ||
|
||
private final GriefPrevention _api; | ||
|
||
public GriefPreventionApi(Player ply){ | ||
_api = GriefPrevention.instance; | ||
} | ||
|
||
public Claim GetClaimAtPlayerPos(Player ply){ | ||
return _api.dataStore.getClaimAt(ply.getLocation(), false, null); | ||
} | ||
|
||
public boolean PlayerHasClaimPermission(Player ply, ClaimPermission permission) { | ||
Claim claim = GetClaimAtPlayerPos(ply); | ||
if(claim == null){ | ||
return false; | ||
} | ||
|
||
return claim.hasExplicitPermission(ply.getUniqueId(), permission); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters