Skip to content

Commit

Permalink
bypass stuff (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 authored Mar 24, 2023
1 parent ea8ec78 commit 7b706e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pluginVersion=1.2.6
pluginVersion=1.2.7
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

public class CrashClaimCompat extends ProtectionCompatibility {
private static CrashClaimAPI crashClaim;

public CrashClaimCompat(JavaPlugin mainPlugin, Plugin plugin) {
super(mainPlugin, plugin);
crashClaim = new CrashClaimAPI((CrashClaim) plugin);
Expand All @@ -23,7 +24,9 @@ public CrashClaimCompat(JavaPlugin mainPlugin, Plugin plugin) {
*/
@Override
public boolean canBuild(Player player, Location target) {
return crashClaim.getClaim(target) == null || crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.BUILD);
return crashClaim.getClaim(target) == null ||
crashClaim.getPermissionHelper().getBypassManager().isBypass(player.getUniqueId()) ||
crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.BUILD);
}

/**
Expand All @@ -33,7 +36,9 @@ public boolean canBuild(Player player, Location target) {
*/
@Override
public boolean canBreak(Player player, Location target) {
return crashClaim.getClaim(target) == null || crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.BUILD);
return crashClaim.getClaim(target) == null ||
crashClaim.getPermissionHelper().getBypassManager().isBypass(player.getUniqueId()) ||
crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.BUILD);
}

/**
Expand All @@ -43,7 +48,9 @@ public boolean canBreak(Player player, Location target) {
*/
@Override
public boolean canInteract(Player player, Location target) {
return crashClaim.getClaim(target) == null || crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.INTERACTIONS);
return crashClaim.getClaim(target) == null ||
crashClaim.getPermissionHelper().getBypassManager().isBypass(player.getUniqueId()) ||
crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.INTERACTIONS);
}

/**
Expand All @@ -52,6 +59,8 @@ public boolean canInteract(Player player, Location target) {
* @return true if he can use the item at the location
*/
public boolean canUse(Player player, Location target) {
return crashClaim.getClaim(target) == null || crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.INTERACTIONS);
return crashClaim.getClaim(target) == null ||
crashClaim.getPermissionHelper().getBypassManager().isBypass(player.getUniqueId()) ||
crashClaim.getClaim(target).hasPermission(player.getUniqueId(), target, PermissionRoute.INTERACTIONS);
}
}

0 comments on commit 7b706e1

Please sign in to comment.