admin mode player can transfer claim owner close #197

This commit is contained in:
Flemmli97
2022-11-26 15:02:06 +01:00
parent 530ef6c8de
commit 5ccc7e5b30
2 changed files with 4 additions and 4 deletions
@@ -281,7 +281,7 @@ public class ClaimStorage implements IPermissionStorage {
}
public boolean transferOwner(Claim claim, ServerPlayer player, UUID newOwner) {
if (!player.getUUID().equals(claim.getOwner()))
if (!PlayerClaimData.get(player).isAdminIgnoreClaim() && !player.getUUID().equals(claim.getOwner()))
return false;
this.playerClaimMap.merge(claim.getOwner(), new HashSet<>(), (old, val) -> {
old.remove(claim);
@@ -66,7 +66,7 @@ public class EntityInteractEvents {
public static InteractionResult useAtEntity(Player player, Level world, InteractionHand hand, Entity entity, /* Nullable */ EntityHitResult hitResult) {
if (!(player instanceof ServerPlayer) || player.isSpectator() || canInteract(entity))
return InteractionResult.PASS;
if(entity instanceof Enemy)
if (entity instanceof Enemy)
return InteractionResult.PASS;
ClaimStorage storage = ClaimStorage.get((ServerLevel) world);
BlockPos pos = entity.blockPosition();
@@ -76,7 +76,7 @@ public class EntityInteractEvents {
if (!claim.canInteract((ServerPlayer) player, PermissionRegistry.ARMORSTAND, pos, true))
return InteractionResult.FAIL;
}
if(entity instanceof Mob)
if (entity instanceof Mob)
return claim.canInteract((ServerPlayer) player, PermissionRegistry.ANIMALINTERACT, pos, true) ? InteractionResult.PASS : InteractionResult.FAIL;
}
return InteractionResult.PASS;
@@ -85,7 +85,7 @@ public class EntityInteractEvents {
public static InteractionResult useEntity(Player p, Level world, InteractionHand hand, Entity entity) {
if (!(p instanceof ServerPlayer player) || p.isSpectator() || canInteract(entity))
return InteractionResult.PASS;
if(entity instanceof Enemy)
if (entity instanceof Enemy)
return InteractionResult.PASS;
ClaimStorage storage = ClaimStorage.get((ServerLevel) world);
BlockPos pos = entity.blockPosition();