Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Awfully wonky workaround to #6 using LuckPerms#10

Open
QDoppie wants to merge 4 commits into
EmotionalLove:masterfrom
QDoppie:master
Open

Awfully wonky workaround to #6 using LuckPerms#10
QDoppie wants to merge 4 commits into
EmotionalLove:masterfrom
QDoppie:master

Conversation

@QDoppie
Copy link
Copy Markdown

@QDoppie QDoppie commented Feb 16, 2020

It more or less works, but:

  • only with LuckPerms
  • it may not work properly if player has more than one permission node

if (!perm.contains(".") || !perm.startsWith("matsuqueue")) continue;
String[] broken = perm.split("\\.");
if (broken.length != 3) continue;
Matsu.INSTANCE.getLogger().log(Level.INFO, perm + " - " + broken[0] + "." + broken[1] + "." + broken[2] + " - " + entry.getValue().getPermission());
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Useless line left from me logging things to make sure - can be deleted.

@EmotionalLove EmotionalLove added the help wanted Extra attention is needed label Feb 17, 2020
@EmotionalLove
Copy link
Copy Markdown
Owner

This shouldn't rely on the server owner to have luck perms. It should work with or without it.

@QDoppie
Copy link
Copy Markdown
Author

QDoppie commented Feb 17, 2020

This shouldn't rely on the server owner to have luck perms. It should work with or without it.

Putting it inside a try{} catch{} would most likely make it compatible. Make it first try LuckPerms and if the API doesn't load, it would report the permission plugin not being detected and go on as usual.

@QDoppie
Copy link
Copy Markdown
Author

QDoppie commented Feb 17, 2020

Added a check in config and made the default value to false to avoid any thrown exceptions unless someone wanted to. The plugin also logs which permission system it's using (BungeeCord / LuckPerms).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants