@@ -831,7 +831,7 @@ public static boolean isCloneItemOwnedBy(ItemStack itemStack, Player player) {
831831 public static boolean clonePermissionsOwnedBy (ItemStack itemStack , Player player ) {
832832 if (player == null || !isCloneItem (itemStack )) return false ;
833833 Map <String , PermissionAccess > permissions = readClonePermissions (itemStack );
834- return hasOnlySelfOwners (permissions , player );
834+ return hasOwnerForPlayer (permissions , player );
835835 }
836836
837837 public static boolean applyCloneItem (Block targetBlock , Player operator , ItemStack itemStack ) {
@@ -842,11 +842,11 @@ public static boolean applyCloneItem(Block targetBlock, Player operator, ItemSta
842842
843843 Map <String , PermissionAccess > clonedPermissions = readClonePermissions (itemStack );
844844 if (clonedPermissions .isEmpty ()) return false ;
845- if (!hasOnlySelfOwners (clonedPermissions , operator )) return false ;
845+ if (!hasOwnerForPlayer (clonedPermissions , operator )) return false ;
846846
847847 LockData targetData = getLockData (targetBlock );
848848 if (targetData .hasPdcData () && targetData .isLocked ()) {
849- if (!hasOnlySelfOwners (targetData .permissions (), operator )) return false ;
849+ if (!hasOwnerForPlayer (targetData .permissions (), operator )) return false ;
850850 }
851851
852852 boolean hasOwner = clonedPermissions .values ().stream ().anyMatch (v -> v == PermissionAccess .OWNER );
@@ -903,17 +903,15 @@ private static UUID getCloneItemOwner(ItemStack itemStack) {
903903 }
904904 }
905905
906- private static boolean hasOnlySelfOwners (Map <String , PermissionAccess > permissions , Player player ) {
906+ private static boolean hasOwnerForPlayer (Map <String , PermissionAccess > permissions , Player player ) {
907907 if (permissions == null || permissions .isEmpty () || player == null ) return false ;
908- boolean foundOwner = false ;
909908 for (Map .Entry <String , PermissionAccess > entry : permissions .entrySet ()) {
910909 if (entry .getValue () != PermissionAccess .OWNER ) continue ;
911- foundOwner = true ;
912- if (!isSelfSubject (player , entry .getKey ())) {
913- return false ;
910+ if (isSelfSubject (player , entry .getKey ())) {
911+ return true ;
914912 }
915913 }
916- return foundOwner ;
914+ return false ;
917915 }
918916
919917 private static void removeClonePermissionKeys (PersistentDataContainer pdc ) {
0 commit comments