-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow For Default Titles in InventoryView Builders #12013
base: main
Are you sure you want to change the base?
Allow For Default Titles in InventoryView Builders #12013
Conversation
...java/org/bukkit/craftbukkit/inventory/view/builder/CraftDoubleChestInventoryViewBuilder.java
Show resolved
Hide resolved
...in/java/org/bukkit/craftbukkit/inventory/view/builder/CraftStandardInventoryViewBuilder.java
Show resolved
Hide resolved
...java/org/bukkit/craftbukkit/inventory/view/builder/CraftBlockEntityInventoryViewBuilder.java
Outdated
Show resolved
Hide resolved
...java/org/bukkit/craftbukkit/inventory/view/builder/CraftBlockEntityInventoryViewBuilder.java
Outdated
Show resolved
Hide resolved
...java/org/bukkit/craftbukkit/inventory/view/builder/CraftBlockEntityInventoryViewBuilder.java
Outdated
Show resolved
Hide resolved
...java/org/bukkit/craftbukkit/inventory/view/builder/CraftBlockEntityInventoryViewBuilder.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe MenuType#create could have a new method without title and a nullable title.
Also i get this error while testing the lectern: https://pastes.dev/KgmpW6mqCE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loom has the title of the chest set by default.
I also get some other errors while testing
for the enchantment menu: https://pastes.dev/ZgBP7TjW9Y
for the merchant menu: https://pastes.dev/whPBf9wNNc
|
I get another error when i tried to open a merchant menu without villager but with a title set: https://pastes.dev/hLGHRQQSSt And the loom is still disguised as a chest. |
This PR addresses a previous critique of no default titles for the InventoryView builders PR. The goal of this PR is to integrate default titles and minimize the explicit declaration of translatable keys to ease on maintenance burden of this API.
I have bundled the test plugin I used along with this PR to ease of testing code if needed.
Below examplifies the change from an API perspective
Within this PR I took a few different approaches to accessing titles. The first two of, which are off of the BlockEntity and Block menu provider respectively. However, there are two cases where I directly declare a Translatable component within this API, once in CraftStandardInventoryViewBuilder and once in CraftDoubleChestInventoryViewBuilder.