Skip to content

Use pub static field for deprecated name#8766

Closed
Machine-Maker wants to merge 1 commit into
PaperMC:masterfrom
Machine-Maker:fix/item-flag-rename
Closed

Use pub static field for deprecated name#8766
Machine-Maker wants to merge 1 commit into
PaperMC:masterfrom
Machine-Maker:fix/item-flag-rename

Conversation

@Machine-Maker
Copy link
Copy Markdown
Member

The undeprecated, newly named item flag should be part of the enum with the old, now-deprecated name being the public static final field. I tested this with a spigot plugin compiled to use ItemFlag.HIDE_POTION_EFFECTS and it worked fine without any bytecode rewriting. I assume that's because enum entries are pretty much equivalent to public static final fields. So just switching the names around shouldn't cause any ABI/API problems.

@Machine-Maker Machine-Maker requested a review from a team as a code owner January 6, 2023 04:16
@Machine-Maker
Copy link
Copy Markdown
Member Author

We could also add a bytecode rewrite for the Enum#valueOf method, but I'm not sure how important that is. All of the other enums which have changed values don't have one (except for DyeColor).

@Machine-Maker Machine-Maker deleted the fix/item-flag-rename branch December 27, 2023 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

1 participant