GeorgH93 / MarriageMaster

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

Command /marry divorce does not work #263

Closed SrBedrock closed 2 years ago

SrBedrock commented 2 years ago

Information

Environment information Plugin + server version info:

[02:10:54 INFO]: ##### Start Marriage Master version info #####
[02:10:54 INFO]: Marriage Master: 2.6.5-Release
[02:10:54 INFO]: Server: git-Pufferfish-72 (MC: 1.18.2)
[02:10:54 INFO]: Java: 17.0.2
[02:10:54 INFO]: Vault: 1.7.3-b131
[02:10:54 INFO]: PlaceholderAPI: 2.11.1
[02:10:54 INFO]: #####  End Marriage Master version info  #####

Online mode: false BungeeCord: yes

Plugin config (optional) https://gist.github.com/SrBedrock/960d41bfcdad837c40373da1adebec64

# MarriageMaster Config File

# Language Settings
Language:
  # Defines the used language and the corresponding file used. The corresponding language file will be placed next to the config.yml named: <Language>.yml
  Language: pt_BR
  # Options:
  #     Overwrite (deletes all changes from the file and extracts a new language file)
  #     Upgrade (extracts a new language file and copy's all settings from the old language file)
  #     Update (adds the default (english) text values for all missing values, just some basic formatting)
  UpdateMode: Upgrade

# Database Settings
Database:
  # SQLite = data stored in SQLite file, MySQL = data stored in MySQL database (see selection below), Shared = use shared connection pool from PCGF PluginLib
  Type: SQLite
  # Defines the storage format for UUIDs for compatibility with other plugins (shared user table).
  # true: format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  # false: format: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  UseUUIDSeparators: false
  # Options: auto, online, offline | auto will decide based on the server online mode option.
  # If you are using BungeeCord, set it to whatever you use on your BungeeCord server!!!
  UUID_Type: offline
  SQL:
    Host: 'localhost'
    Database: 'minecraft'
    User: 'minecraft'
    Password: 'minecraft'
    # The max amount of connections to the database the connection pool will open.
    # You may want to adjust this setting based on the load of your database server and the amount of players.
    MaxConnections: 2
    # Allows to set the connection properties.
    # Properties: ["useSSL=false"]
    Properties: []
    Tables:
      User: marry_players
      Partner: marry_partners
      Home: marry_home
      Priests: marry_priests
  # Settings controlling the cache behavior of the plugin. You may can optimize it a little bit depending on your player count, ram or cpu bottlenecks.
  Cache:
    UnCache:
      # The strategy used to uncache offline players. Options
      #     interval (offline players get uncached every x seconds)
      #     intervalChecked (like interval, but also ensures that the player is already offline for at lest the interval time)
      #     ondisconnect (player instantly gets uncached as soon as he disconnects from the server, may adds overhead if other plugins try to access the player data when they go offline, also it may be problematic for players with unstable connections)
      #     ondisconnectdelayed (player gets uncached x seconds after he went offline, adds overhead on disconnect, you shouldn't use this with a lot of players joining and leaving.)
      Strategy: interval
      # Used for the interval based uncaching algorithms. Also used as delay for ondisconnectdelayed. Value in seconds. Default: 600 = 10 minutes
      Interval: 600
      Delay: 600

Marriage:
  # Defines if players need to get married by a priest or if they can marry each other on their own.
  RequirePriest: false
  # This option defines if a priest is needed to divorce 2 players or if they can divorce on their own.
  # Options: true, false, auto (auto will copy the RequirePriest value)
  DivorceRequiresPriest: false
  AllowMultiplePartners: false
  # This setting disables the "/marry setpriest" command players can still be promoted to a priest with the "marry.priest" permission.
  DisableSetPriestCommand: false
  Surnames:
    Enable: false
    Force: false
    # Surname requirements
    AllowColors: false
    AllowedCharacters: A-Za-z
    # Values below 3 will be set to 3
    MinLength: 3
    # Values below the in length will be set to the min length
    MaxLength: 16
  # Defines if marriages should be announced to all players.
  AnnounceOnMarriage: true
  # Defines if divorces should be announced to all players. auto mirrors the AnnounceOnMarriage setting
  AnnounceOnDivorce: true
  Confirmation:
    Enable: true
    AutoDialog: true
    BothPlayersOnDivorce: false
    OtherPlayerOnSelfDivorce: false

InfoOnPartnerJoinLeave:
  Enable: false
  # Delay for online partners info on join. In seconds
  JoinDelay: 0

# The prefix/suffix options do not work with all chat plugins!
# If your chat plugin support placeholder APIs it would be better to use them! More details: https://github.com/GeorgH93/MarriageMaster/wiki/Placeholders
Prefix:
  Enable: false
  # Placeholders: {Surname}, {PartnerName}, {PartnerDisplayName}, {StatusHeart}, {MagicHeart}
  String: "<heart>{PartnerName}<heart>"
  OnLineBeginning: true
Suffix:
  Enable: false
  # Placeholders: {Surname}, {PartnerName}, {PartnerDisplayName}, {StatusHeart}, {MagicHeart}
  String: "{Surname}"

Gift:
  Enable: true
  AllowedGameModesAllowed: [ "SURVIVAL" ]
  AllowedGameModesReceive: [ "SURVIVAL" ]
  # List of worlds where players can't receive gifts
  BlacklistedWorlds: [ evento ]
  # If this option is enabled the partner has to accept the gift.
  RequireConfirmation: false
  ItemFilter:
    # Enables the item filter. Make sure to define items to be filtered.
    Enabled: false
    # Changes the filter mode, either blacklist (only unlisted materials are allowed) or whitelist (only listed materials are allowed)
    Mode: blacklist
    # Filter lists bellow. An item will be blocked (in blacklist mode) or allowed (in whitelist mode) if it matches on of the given filters.
    # List of materials that should be filtered. Can be name or id (id only for MC versions older than 1.13!).
    Materials: [  ]
    # List of names that should be filtered. Must match the display name of the item exactly. & color codes will be converted automatically.
    Names: [  ]
    # List of lore that should be filtered. Can be a single line or all lines of the lore.
    Lore: [  ]

Kiss:
  # Enables the kiss command
  Enable: true
  # Enables kissing by sneak + right click
  EnableInteract: true
  # Time between two kisses in seconds, 0 to disable cooldown
  WaitTime: 5
  # How many hearths should be spawned
  HearthCount: 50

Hug:
  # Enables the hug command
  Enable: true
  # Time between two hugs in seconds, 0 to disable cooldown
  WaitTime: 10

List:
  UseFooter: true
  EntriesPerPage: 8

PvP:
  AllowBlocking: false

BonusXp:
  Enable: true
  # Values less or equals 1 will disable the bonus xp, but still allows to split xp between players
  Multiplier: 2
  # If enabled the picked up xp will be split between both players. So each player will receive (xp * multiplier / 2) xp
  SplitXpOnPickup: true
  # If enabled the xp will be split with all partners that are in range. So each player will receive (xp * multiplier / count_partners_in_range) xp. Requires that SplitXpOnPickup is enabled.
  SplitWithAllPartnersInRange: false
  SkillAPI:
    Enable: false
    # List of sources that should be excluded from the xp boost. The command source is always excluded!
    ExcludeSources: []
    Multiplier: 2
    # If split is enabled the multiplied amount will be split between both partners. So each player will receive (xp * multiplier / 2) xp
    SplitXp: true
    # If enabled the xp will be split with all partners that are in range. So each player will receive (xp * multiplier / count_partners_in_range) xp. Requires that SplitXp is enabled.
    SplitWithAllPartnersInRange: false
  McMMO:
    Enable: false
    Multiplier: 2
    # If split is enabled the multiplied amount will be split between both partners. So each player will receive (xp * multiplier / 2) xp
    SplitXp: true
    # If enabled the xp will be split with all partners that are in range. So each player will receive (xp * multiplier / count_partners_in_range) xp. Requires that SplitXp is enabled.
    SplitWithAllPartnersInRange: false
    # List of sources that should be excluded from the xp boost.
    ExcludeSources: [ "COMMAND" ]
    # List of skills that should be excluded from the xp boost.
    ExcludeSkills: []

HealthRegain:
  Enable: false
  Multiplier: 2

Chat:
  Enabled: true
  AllowSurveillance: false

# Ranges for actions
# -1 no range limit and no world limit, 0 no range limit but in the same world, >= 1 range limit in meters/blocks
Range:
  Marry: -1
  Divorce: -1
  Backpack: 5
  Gift: 0
  Kiss: 5
  KissInteract: 5
  Hug: 5
  HearthVisible: 25
  BonusXP: 10
  Heal: 10

# These settings will be used for all teleports (home and to partner)
Teleport:
  Delay: true
  # Time in seconds
  DelayTime: 3
  # List of worlds where you can't teleport to
  BlacklistedWorlds: [ evento ]
  # This option controls whether a safety check is performed before the player is teleported.
  CheckSafety: true
  # If this option is enabled the partner has to accept the teleport request before the player will be teleported. Only applicable for teleporting to another player.
  RequireConfirmation: false

# Config options for sharing backpacks between partners
# Currently the only supported backpack plugin is Minepacks
BackpackShare:
  # Enables the backpack sharing feature (with supported plugins)
  Enable: false

Economy:
  Enable: true
  # Each of the two players will have to pay half of the amount. Example: cost=100 -> player_a has to pay 50 and player_b has to pay 50
  Marry: 200000.0
  # Each of the two players will have to pay half of the amount. Example: cost=100 -> player_a has to pay 50 and player_b has to pay 50
  Divorce: 0.0
  Tp: 10.0
  Gift: 10.0
  HomeTp: 10.0
  SetHome: 1000.0
  ChangeSurname: 0

# Allows the execution of commands on certain events related to the marriage
CommandExecutor:
  Enable: false
  # General information about the command executor:
  # The commands can contain placeholders in the format {PlaceholderName} (The {} is part of the name. The available placeholders are listed right about the event).
  # Every event can execute multiple commands in the list. Commands do not have to start with / !
  # Commands to be executed:
  # Will be executed when two players marry, without a priest
  # Allowed placeholders: {Player1}, {Player2}
  # OnMarry: [ "eco give {Player1} 100", "pex user {Player2} add example.perm" ]
  OnMarry: [ "essentials:broadcast &7[&cMarry&7] &e{Player1} &aacasou-se com &e{Player2}&a!" ]
  # Will be executed when two players marry by a priest
  # Allowed placeholders: {Player1}, {Player2}, {Priest}
  OnMarryWithPriest: [ "essentials:broadcast &7[&cMarry&7] &e{Priest} &arealizou o casamento entre {Player1} &ae &e{Player2}&a!" ]
  # Will be executed when two players get divorced, without a priest
  # Allowed placeholders: {Player1}, {Player2}
  OnDivorce: [ "essentials:broadcast &7[&cMarry&7] &e{Player1} &adivorciou-se de &e{Player2}&a!" ]
  # Will be executed when two players get divorced through a priest
  # Allowed placeholders: {Player1}, {Player2}, {Priest}
  OnDivorceWithPriest: [ "essentials:broadcast &7[&cMarry&7] &e{Priest} &arealizou o divorcio de {Player1} &ae &e{Player2}&a!" ]

# The command that should be used if no sub-command was used.
# Options: help (/marry help), custom_help (will display the messages defined in the language file in Language.Ingame.Help.CustomHelp)
DefaultCommand: "help"
# The marriage color is used for the magic/colored heart and is set to a random value by default.
AllowPlayersToChangeMarriageColor: false

Misc:
  AutoUpdate:
    # When auto update is disabled you still can use the build in update function manually with /marry update
    Enable: false
    Channel: Release
  # Enable this option if you are in a BungeeCord environment. Please also install the plugin on your BungeeCord server to allow the data to be synchronized across all your servers.
  UseBungeeCord: false

# Config File Version. Don't touch it!
Version: 106

Details

Description
Players with the marry.selfdivorce permission cannot divorce on command.

Steps to reproduce

  1. Give players marry.selfdivorce permission
  2. Add false on Marriage.DivorceRequiresPriest
    Marriage:
    # Defines if players need to get married by a priest or if they can marry each other on their own.
    RequirePriest: false
    # This option defines if a priest is needed to divorce 2 players or if they can divorce on their own.
    # Options: true, false, auto (auto will copy the RequirePriest value)
    DivorceRequiresPriest: false
  3. Use /marry divorce
  4. Player does not have permission
    lp verbose command ThiagoROX marry divorce
    [02:12:56 INFO]: [LP] Forcing ThiagoROX to execute command marry divorce and reporting all checks made....
    [02:12:56 INFO]: [LP] VB > thiagorox - marry.priest - false
    [02:12:56 INFO]: [LP] Command execution complete.

    Expected behavior
    Player divorces his current partner

SrBedrock commented 2 years ago

Problem solved with https://github.com/GeorgH93/MarriageMaster/commit/2da90df66d8894e3b6c43d43f290f06020bee21d