Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only clear owner when new empty card is swapped but not after load #666

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading