Skip to content

Allow usage of MiniMessage in server configuration files#7549

Closed
Astralchroma wants to merge 1 commit into
PaperMC:masterfrom
Astralchroma:master
Closed

Allow usage of MiniMessage in server configuration files#7549
Astralchroma wants to merge 1 commit into
PaperMC:masterfrom
Astralchroma:master

Conversation

@Astralchroma
Copy link
Copy Markdown
Contributor

@Astralchroma Astralchroma commented Mar 5, 2022

Allows the messages in bukkit.yml, spigot.yml, and paper.yml to be written using the MiniMessage format.

In order to maintain compatibility with existing configuration files the option configuration-uses-minimessage option has been added to paper.yml. This option defaults to false for any configuration files before config version 26.

New configuration files use MiniMessage by default, and the default messages have been converted to use it.

This also includes 2 minor API changes:

  • Bukkit#getPermissionMessage which returned a String has been deprecated in favor of Bukkit#permissionMessage which returns a Component
  • Server#getPermissionMessage which returned a String has been deprecated in favor of Server#permissionMessage which returns a Component

Closes #7520

@Astralchroma Astralchroma requested a review from a team as a code owner March 5, 2022 19:25
Comment thread patches/server/0880-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Copy link
Copy Markdown
Member

@NoahvdAa NoahvdAa left a comment

Choose a reason for hiding this comment

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

Congrats on making your first paper PR, welcome!

Comment thread patches/api/0373-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/api/0373-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/server/0880-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/server/0880-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
@electronicboy
Copy link
Copy Markdown
Member

as I said on discord, really we should consilidate all of the messages into a singular patch file, rather than this patch which tweaks all of the old options, we'd also have to look into migrating bukkits messages over, but, am not sure 100% on that's based done without the config migration stuff

Copy link
Copy Markdown
Member

@Machine-Maker Machine-Maker left a comment

Choose a reason for hiding this comment

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

Ok, basically all of this should be done in the patch that makes these changes originally.

Comment thread patches/api/0373-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/api/0373-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/api/0373-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/server/0880-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/server/0880-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
Comment thread patches/server/0880-Allow-usage-of-MiniMessage-in-server-configuration.patch Outdated
@Astralchroma
Copy link
Copy Markdown
Contributor Author

Astralchroma commented Mar 6, 2022

Ok, basically all of this should be done in the patch that makes these changes originally.

So I have been working on doing this, but when it comes to messages added by Spigot, that has to be done in a new patch, which is fine, but... patch 147 depends on one of these messages, so the patch has to go before 147.

How would I go about adding a patch before an existing patch?

@Machine-Maker
Copy link
Copy Markdown
Member

How would I go about adding a patch before an existing patch?

I wouldn't put it right before, I'd maybe put it in the adventure patch. @kashike might want to weigh in on that. but to add a patch, just interactive rebase to the commit you want to add a patch after, and then just make a new commit, and then continue rebasing.

@Astralchroma
Copy link
Copy Markdown
Contributor Author

So after basically rewriting this PR, usage of MiniMessage is no longer optional, I will add code to automatically convert Legacy messages to MiniMessage in a bit.

I have also changed everything to be done as part of previous patches. Which was very annoying and took forever.

@Astralchroma
Copy link
Copy Markdown
Contributor Author

Not dead, just have alot of things to be doing, I will get back to this later.

@Astralchroma
Copy link
Copy Markdown
Contributor Author

Closed because I am not sure how to go about handling configuration migration, so I will leave someone else to deal with it.

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.

Allow using MiniMessage in '...-message' configuration options

5 participants