Skip to content
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

introduce new player compare predicate #11

Merged

Conversation

Polymeta
Copy link

Hey there, first off. love the plugin, it's quite dynamic and powerful!

In the spirit of making it even better, I have came up with a new type of predicate that allows admins to specify a certain predicate that gets ran against source and target, and if they both return the same thing, the target is allowed to receive the message, this will allow for even more dynamic setups, like dynamic guild chats (or world chat written a different way). Below is an example:

  "channels": [
    {
      "name": "world",
      "enabled": true,
      "isStaff": false,
      "actionbar": "<dark_aqua>Chat Mode: <green>%world:name%",
      "prefix": "<dark_gray>[<aqua>%world:name%</aqua>]</dark_gray> ",
      "canSee": {
        "type": "advancedchat:compare",
        "compare_predicate": {
          "type": "placeholder",
          "placeholder": "world:name",
          "raw": false
        }
      }
    }
  ]

The compare predicate can be whatever predicate there is, whether builtin or mod provided, making this expression quite flexible. You could also use this to compare LP meta between users.

I tried this locally with 2 clients and it worked quite well.

@Wesley1808
Copy link
Owner

Looks good. Thanks for the PR!

@Wesley1808 Wesley1808 merged commit bb61581 into Wesley1808:ver/1.21 Jun 30, 2024
1 check passed
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.

2 participants