Skip to content

Commit

Permalink
Merge pull request #666 from zyxkad/dev/1.19.2
Browse files Browse the repository at this point in the history
only clear owner when new empty card is swapped but not after load
  • Loading branch information
SirEndii authored Nov 4, 2024
2 parents 6888ed5 + 5433311 commit 6b38dfa
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ public boolean canPlaceItemThroughFace(int index, @NotNull ItemStack itemStackIn

@Override
public void setItem(int index, @NotNull ItemStack stack) {
if (stack.getItem() instanceof MemoryCardItem && stack.hasTag() && stack.getTag().contains("ownerId")) {
UUID owner = stack.getTag().getUUID("ownerId");
this.owner = owner;
stack.getTag().remove("ownerId");
stack.getTag().remove("owner");
if (stack.getItem() instanceof MemoryCardItem) {
if (stack.hasTag() && stack.getTag().contains("ownerId")) {
UUID owner = stack.getTag().getUUID("ownerId");
this.owner = owner;
stack.getTag().remove("ownerId");
stack.getTag().remove("owner");
} else if (stack != this.getItem(index)) {
// Only clear owner when the new card item is not the current item
this.owner = null;
}
} else {
this.owner = null;
}
Expand Down

0 comments on commit 6b38dfa

Please sign in to comment.