Skip to content

Conversation

@Xefreh
Copy link

@Xefreh Xefreh commented Jun 28, 2025

This pull request aims to use a boolean value for the dupe key in PDC, similar to what the NMSDupeManager already implements.

@alwyn974 alwyn974 requested a review from Copilot June 28, 2025 12:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors PDCDupeManager to use a boolean flag for the dupe key instead of an integer, matching the implementation in NMSDupeManager.

  • Switches PersistentDataType.INTEGER to PersistentDataType.BOOLEAN when setting the dupe marker.
  • Updates the existence check to use the BOOLEAN type.
Comments suppressed due to low confidence (2)

src/main/java/fr/maxlego08/menu/dupe/PDCDupeManager.java:60

  • Add unit tests covering both the new BOOLEAN-based flow and a fallback or migration path for INTEGER-backed items to ensure proper detection across versions.
        return persistentDataContainer.has(this.namespacedKey, PersistentDataType.BOOLEAN);

src/main/java/fr/maxlego08/menu/dupe/PDCDupeManager.java:37

  • Existing items tagged with the old INTEGER value will no longer be recognized as dupes. Consider adding a fallback check for INTEGER or migrating legacy data so previously marked items remain detected.
            persistentDataContainer.set(namespacedKey, PersistentDataType.BOOLEAN, true);

@cidaris-org cidaris-org closed this by deleting the head repository Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants