Skip to content

Better menu property API#7251

Closed
Machine-Maker wants to merge 1 commit into
PaperMC:masterfrom
Machine-Maker:feature/window-data-prop-api
Closed

Better menu property API#7251
Machine-Maker wants to merge 1 commit into
PaperMC:masterfrom
Machine-Maker:feature/window-data-prop-api

Conversation

@Machine-Maker
Copy link
Copy Markdown
Member

@Machine-Maker Machine-Maker commented Jan 2, 2022

Needs a bunch of javadoc comments still

The old property system had a few big issues (InventoryView$Property),

  1. it was incomplete, missing 2 properties, one for stonecutter, and one for loom
  2. it only allowed for one inventory type per property which is not true anymore, the 4 furnace ones apply to Furnaces, Blast Furnaces, and Smokers
  3. It relied on someone using magic values to set potion effect types or enchantments which is bad practice for the API

I changed it into a class format, with a generic for the value type that's converted to an integer in the server impl.

@Machine-Maker Machine-Maker requested a review from a team as a code owner January 2, 2022 08:42
@kashike
Copy link
Copy Markdown
Member

kashike commented Jan 2, 2022

#7223 (comment)

@Machine-Maker
Copy link
Copy Markdown
Member Author

Literally every class I ever add now, is gonna be called DataProperty 😈

@Machine-Maker Machine-Maker force-pushed the feature/window-data-prop-api branch 2 times, most recently from 5c47842 to 7476551 Compare January 2, 2022 18:54
@Machine-Maker
Copy link
Copy Markdown
Member Author

Should be good, finished adding javadocs

@Machine-Maker Machine-Maker force-pushed the feature/window-data-prop-api branch from 7476551 to fc60229 Compare February 23, 2022 20:15
Copy link
Copy Markdown
Member

@Owen1212055 Owen1212055 left a comment

Choose a reason for hiding this comment

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

image

Tested with some inventories, looks good!
(Behavior with sharing properties for stuff like smokers and furnace works fine as well)

@stale
Copy link
Copy Markdown

stale Bot commented May 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@Machine-Maker Machine-Maker force-pushed the feature/window-data-prop-api branch from fc60229 to 4ad1772 Compare June 2, 2022 01:55
@stale stale Bot removed the resolution: stale label Jun 2, 2022
@Machine-Maker
Copy link
Copy Markdown
Member Author

Rebased for 1.18.2

@Machine-Maker Machine-Maker force-pushed the feature/window-data-prop-api branch from 4ad1772 to f19ecf9 Compare December 7, 2022 07:19
@Machine-Maker Machine-Maker force-pushed the feature/window-data-prop-api branch 2 times, most recently from 836cc84 to cbd25fc Compare December 20, 2023 00:05
@Machine-Maker Machine-Maker changed the title Better window data property API Better menu property API Dec 20, 2023
@Machine-Maker
Copy link
Copy Markdown
Member Author

Rebased and updated for 1.20.4.

Renamed type to MenuProperty
Added crafter options

@Machine-Maker Machine-Maker force-pushed the feature/window-data-prop-api branch from cbd25fc to e7dd918 Compare December 20, 2023 00:07
@Machine-Maker Machine-Maker force-pushed the feature/window-data-prop-api branch from e7dd918 to 18eb96f Compare December 20, 2023 00:09
@Machine-Maker
Copy link
Copy Markdown
Member Author

No longer needed because there are subinterfaces for each view type (like EnchantmentView, BrewingStandView, etc.).

@Machine-Maker Machine-Maker deleted the feature/window-data-prop-api branch September 29, 2024 19:50
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.

3 participants