GeorgH93 / MarriageMaster

Marriage Plugin for Bukkit/Spigot
https://www.spigotmc.org/resources/marriage-master.19273/
GNU General Public License v3.0
113 stars 90 forks source link

Fixed bug with marriages duplicates in multi-partners mode + command /marry chat settarget #239

Closed Qveshn closed 2 years ago

Qveshn commented 2 years ago

The check that such a pair already exists was skipped. As a result, duplicate pairs of married players were added to the database. But there was only one chance to divorce. Only one entry was deleted from the database and a second divorce required the plugin configuration reload (/marry reload) After the appearance of duplicates, the current information on the married pair was incorrectly recognized. For example, after setting the heart color, the old heart continued to be displayed in the list of pairs (apparently from another entry in the database)

The bug was fixed by adding a check that the players are already married TO EACH OTHER.

Also added parameters to the language configuration (so far only in en.yml):

  1. Ingame.Marry.AlreadySamePair placeholders: {Player1Name},{Player1DisplayName},{Player2Name},{Player2DisplayName} value: "&cYou can't marry players that are already married to each other. &r&c{Player1DisplayName}&r&c is already married with &r&c{Player2DisplayName}&r&c."

  2. Ingame.Marry.Self.AlreadySamePair placeholders: {Name} (alias {PartnerName}), {DisplayName} (alias {PartnerDisplayName}) value: "&cWe are already married with &r&c{DisplayName}&r&c!" The word "We" emphasizes that the player is already married to this partner.

PS. Also fixed duplicate message that partner is also married (single partner mode). line 476


Updated: I am sorry. The second PR was automatically attached here I do not understand why, πŸ˜• Looks like I should do commits for every new PR in separate branches. πŸ€”

Fixed bugs with command /marry chat settarget all

Added the ability to reset the recipient of private messages (/marry chat settarget all) Added tab complete for "settarget"/"target" Added tab complete for "all" switch in "settarget" subcommand Fixed description for settarget subcommand

Qveshn commented 2 years ago

I am sorry I wanted to make two separate PRs. I made the first one. It was all ok. But when I have commited new changes and started adding the second PR, then it was joined here πŸ˜•

Second PR was supposed to be:

Fixed bugs with command /marry chat settarget all

Added the ability to reset the recipient of private messages (/marry chat settarget all) Added tab complete for "settarget"/"target" Added tab complete for "all" switch in "settarget" subcommand Fixed description for settarget subcommand

Looks like I should do every new commit in a new branch... πŸ€”

Qveshn commented 2 years ago

Just noticed: I forgot to change version in language configuration file 😟 Also I did not update other languages, because I do not know how to translate 😟

What if I add the English version of the new parameters to other files? (and also increase the version number in them)

GeorgH93 commented 2 years ago

Thanks.

Yea, with GitHub it's best to make 1 branch per pull request.

Don't worry about the other languages. I will update the German language file before releasing it and the other ones will be autofilled with the English messages, someone who knows that language can then update it (and hopefully also share the changes).

Qveshn commented 2 years ago

πŸ™‚