#luckperms-api
1 messages ยท Page 33 of 1
Vault is as simple as it gets
yes ik but the people showing me how to use it arnt
Brain wrote th code for you
Minecraft is not the place to learn Java
The simplest code he could've
you are proving my point
And you're not understanding it
The thing is we are not here to teach you how to program
The thing I posted is super easy to understand
im not asking for that
And you're not understanding it
all i was asking is to give me a simple way to under stand vault
Which means writing plugins is waaay too advanced for you right now
and we diddd ๐ฉ
There's not way to make it simpler except feed you the code
i had to figher that out
Yes because you should be able to do that on your own
And btw you did it wrong
It works but that's not the right way to do it
And that is the thing
You are so inexperienced that you are not even understanding what you're not understanding
I really want to help you
But you are not ready
Like you are currently learning to walk. And what you're trying to do is running a marathon
And installing vault would be the equivalent of tying your shoes
They are gone btw
I wonder how many more frustrating weeks it's gonna take them before they either understand that they actually need to learn java or give up
LuckPerms source isn't for beginners. There exist more simpler permission plugins which is easier to read and understand from.
oh that dude left :/
lmao like almost 12hs ago
my discord is just kinda delayed idk
ye always happens
Hi have a small question regarding the Java API.
I was wondering how one would retrieve the current active groups for a certain player.
With active I mean for the current context. What is the best way to retrieve those groups
!api
Learn how to use the LuckPerms API in your project.
The two links here should guide ya
Maybe I am overlooking something. If that's the case I'm sorry.
So when I do groupManager.getGroup(groupName) it will retrieve me the group. But I guess this is independent from the context?
I don't really know how to retrieve the currently active groups for a certain user. I saw something about using the user.getDistinctNodes() method. But not sure if this is the right direction to go in
And if I use getNodes() does it take the context into account?
I think you'll want to PermissionHolder#getInheritedGroups(QueryOptions), with the query options with contexts added
Defo take a look at the QueryOptions doc page
Something like this:
Collection<Group> groups = user.getInheritedGroups(user.getQueryOptions());
And the queryOptions are automatically build by LP based on the environment?
I think that would work, yes
Ok thanks! I'll try that
ok so with yesterdays help
i did a little figgling
and came up with this
public Chat chat;
@Override
public void onEnable() {
this.getServer().getPluginManager().registerEvents(this, this);
if (Bukkit.getOnlinePlayers().isEmpty())
for (Player online : Bukkit.getOnlinePlayers()) {
createBoard(online);
start(online);
setupChat();
}
}
@Override
public void onDisable() {
}
private boolean setupChat() {
RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
chat = rsp.getProvider();
return chat != null;
}
@EventHandler
public void onInventoryClick(final InventoryClickEvent e) {
String prefix = chat.getPlayerPrefix((Player) e.getWhoClicked());
}```
Score score4 = obj.getScore(ChatColor.GRAY+ ">> " + ChatColor.GOLD + "Rank: " + ChatColor.WHITE + chat.getPlayerPrefix(player));
score4.setScore(2);```
Welcome back
โค๏ธ
On mobile, but see a few issues
- Bukkit.getOnlinePlayers inside a .isEmpty of that seems pointless. Did you forget to invert that?
- checking if players are online in your onEnable seems pointless given that will only really fire during startup before the server is accepting connections
- main class also implementing listener is usually frowned upon
i have another class
but my bukkit
get online playres is for
Score score2 = obj.getScore(ChatColor.GRAY+ ">> " + ChatColor.GOLD + "Online Players: " + ChatColor.WHITE + Bukkit.getOnlinePlayers().size());
score2.setScore(4);```
@Override
public void onEnable() {
this.getServer().getPluginManager().registerEvents(this, this);
if (Bukkit.getOnlinePlayers().isEmpty())
for (Player online : Bukkit.getOnlinePlayers()) {
createBoard(online);
start(online);
setupChat();
}```
The code inside the if block will never run unless you are doing some really wierd things
Still doesn't change the fact that looping over a collection that is known to be empty makes zero sense
no
lmfao it was it
lol
bec of you i say my mistake
ty
score4.setScore(ChatColor.translateAlternateColorCodes('&', prefix)).setScore(2);```
i added this to the code
to get rid of the &4
and prefix is giving me a issue
si i need to put prefix in ""
wait no i just added
String prefix = chat.getPlayerPrefix(player);```
What does setupChat() do?
gets the prefix
score4.setScore(ChatColor.translateAlternateColorCodes('&', prefix)).getScore(2);```
i set it up like
and setScore is giving me a issue
What does
setupChat()do?
do i need to set it up at get score
for vault to get the prefix it needs to setupchat
I know what it does. I want to know if you understand it as well
Yes, but what does that method do?
And why are you calling it inside a loop?
its in the name
Well then what does it do?
sets up chat
Not quite
hmm
Frankly not even close
Or well depending on what you mean by chat
why do you have this
@EventHandler
public void onInventoryClick(final InventoryClickEvent e) {
String prefix = chat.getPlayerPrefix((Player) e.getWhoClicked());
}```
im a biggener
Exactly
I want you to look at the code and try to understand it
Then I want you to find a good place to put it in your onEnable
Because where it is currently is the wrong place
Sure
So would if I went to the store and back home for every single item I need
I would get everything
But it would take ages
And I mean that's where I take issue with your approach. You paste stuff until it "works" without trying to understand what it does
bec when i try to get help on google
the slap the "YUo nEED TO LeArn JaVA"
witch im trying to
but with out trying to help
and that is you rn
Yes. I'm not here to teach you java
You're currently learning to walk and you're asking for help with running a marathon. And meanwhile you're asking us to tie your shoes
And that's just not what we're here for
And unless you can demonstrate understanding of the code you're working with you will not get anything out of me other than "learn java", because that's the truth
Making plugins is not something you can copy paste together
I know that sucks
But that's the sad reality
Using LP dev api??? if not please ask in #support-1 or #support-2
oh ok
just wondering if i could get some help with this i am trying to create time based ranks within my server and cant find anything online about it has anyone done this and could lend a helping hand?
Using LP dev api??? if not please ask in #support-1 or #support-2
oh sorry
i finished
it
lmfao
took a while
but its done
and it updates every time a player joins
or your rank
Did you make sure it updates when a player leaves
yes
but after a reload
the scoreboard wont load :p
it wont even show up in /plugins
its giving me
Ambiguous plugin name ServerSelector' for files plugins\SS.jar' and plugins\HS.jar' in plugins'
Try changing the plugin name
yes
that is what i did
from
HS
to HubScoreboard
it works
๐
i want to fix this issue but i cant resolve how
when a player clicks on the server selector
it is fine
but when the player
clicks on the compass
it runns the command
@EventHandler (priority=EventPriority.HIGH)
public void onPlayerUse(PlayerInteractEvent event) {
Player player = (Player) event.getPlayer();
if(event.getItem().getType() == Material.COMPASS)
player.performCommand("server");
}
```
and gets rid of the compass
Show the server command
changed it to this
@EventHandler (priority=EventPriority.HIGH)
public void onPlayerUse(PlayerInteractEvent event) {
Player player = (Player) event.getPlayer();
if(event.getItem().getType() == Material.COMPASS)
player.performCommand("server");
}
@EventHandler
public void onPlayerUse2(PlayerInteractEvent event) {
Player player = (Player) event.getPlayer();
ItemStack selector = new ItemStack(Material.COMPASS); //Creates the stack
ItemMeta meta = selector.getItemMeta();
ArrayList<String> lore = new ArrayList<String>();
lore.add(ChatColor.GRAY + "Click to select server");
meta.setLore(lore);
meta.setDisplayName(ChatColor.DARK_GRAY + "[" + ChatColor.RED + "Server Selector" + ChatColor.DARK_GRAY + "]");
selector.setItemMeta(meta);
player.getInventory().setItem(0, selector);
if(event.getItem().getType() == Material.COMPASS)
player.performCommand("server");
}
}
wait
that should be
a invitory on click event
you shouldnt be running /reload on minecraft servers anywyas
also, do fix your indentation...
Would probably be copying from intelliJ or other IDEs to discord. It fucks with the indentations
Sometimes
๐คทโโ๏ธ even his hastebins have weird indentation
Truth
the first and last line sure.... but look at the if condition, and the method onPlayerUse2 has lines with indentation so random lol
Ohhh I know what you mean yeah
Huh
the message was delete
ppl smh
always delete mesage and then make helper/mod look like we are talking to ourselves lol
Lol
Hello
i have an issue with luckperms bungee
when i set a prefix it says %vault_prefix%
No need to post in multiple channels, and this isn't about the developer API anyhow
What is the simplest way to set a group for a player as parent...
I watched they API but i dont get it ...
Remove all other inheritance nodes and add the new one
This example might help
So this
user.data().clear(NodeType.INHERITANCE::matches);
removes all inheritance ?
And how can i check if he has the group allready ?
Why would you post it in the dev api channel
huh
This is the dev api channel
what is that
what does that mean
And how can i check if he has the group allready ?
๐ฆ
Learn how to use the LuckPerms API in your project.
So you call user.data() and you can get all the nodes, right?
What does it return? What does data() return?
?
What does it return? What does
data()return?
@nocturne elbow NodeMap
Hey Julian! Please don't tag helpful/staff members directly.
Wait i will get a "permission" with the group name ?
Everything is a node
Different types of nodes, but everything is a node, and as far as Bukkit is concerned, everything is a permission node
yea
user.data().clear(NodeType.INHERITANCE::matches);
That will clear all inheritance correct ?
Yes
So basicly
public void giveUserRankOrMoney(Player player, RewardModel boosterModel) {
String groupName = String.valueOf(boosterModel.getCustomProperties().get("value"));
if(player.hasPermission("group." + groupName)){
this.getEconomyAPI().addMoney(player.getUniqueId(), this.filterNumber(String.valueOf(boosterModel.getCustomProperties().get("money"))));
return;
}
this.luckPerms.getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
user.data().clear(NodeType.INHERITANCE::matches);
user.data().add(InheritanceNode.builder(groupName).build());
});
}
This will give the user the rank and when he already is a parent he will get money correct ?
should
Okay ^^ Thanks
Could someone help me, when I put the plugin on the server it does not turn on
^
Learn how to use the LuckPerms API in your project.
There's a section in there called "Listening to events" or something like that
@nocturne elbow
The very last section in that Usage link
Does luckperms support multiple groups? All I see in user is "getPrimaryGroup"
!api the javadocs are linked pretty far up. Also check the inherited methods
Learn how to use the LuckPerms API in your project.
wait nvm
With the api?
Yes
!api if so
Learn how to use the LuckPerms API in your project.
I already looked inside of the User class and I can't seem to find it.
Hello there! Can someone help me with my issue? Seems that my BungeeCord plugin doesn't see LuckPerms' API and I don't get why bc it seems that I did everything like in guide... Pic is what's inside my Jar. I use gradle in my project.
https://sourceb.in/eed5dcd6b1 (BungeeCord's stacktrace)
https://srcb.in/42bb2a44f5 (Bungee.yml)
@jaunty valley why are the LP packages in your jar?
That's shading
Don't shade plugin APIs
Shouldn't it be?
No it shouldn't. In fact it mustn't!
Do you know how to cancel shading in gradle? Im kinda new to gradle. Here is my project's build.gradle https://sourceb.in/90a718c087
APIs should be compileOnly
Ah, ok
How you configured it everything that's a compile dependency is shaded in
Only shade external libraries
Not APIs
Thank you.
You're welcome
When should implementation be used then if not when using APIs? ๐ค
When you're using the modern notation
compile and compileOnly are the old notation
O
How can I change the Prefix of a user?
Hey how do i get the prefix from a group (plugin)?
I only find the displayname but i need the prefix
thanks
!usage
Here's a guide to help users understand and use LuckPerms for the first time.
whats the code for letting people warp in essentials
What does that have to do with the LP API?
Also the code is Open Source @willow thistle
nonono im in luckperms editor and i need to know the code so people in default group can warp to all the warps but i dont know the permissions code
how?
bcu luckperms isnt a permission node encyclopaedia... look at your plugin documentation that handle warps for the relevant perm nodes
What is it
Everyone might be able to help
Even Tim
And we can't help if you don't explain your problem
What is it?
lol
lol
wow
That way nobody will ever be able to help you, bud :\
Riperino
So I am trying to Hook into LuckPerms in my spigot plugin
But the Registration is null and therefore i am unable to get the API
The plugin is enabled (i have a check for it and it doesn't trigger).
Can anyone help me with this?
I can share what I have done so far if you want.
I have tried static access too but that throws IllegalStateException (as mentioned in the docs).
I do have LuckPerms as a depend in my plugin.yml
!paste Mind sharing the plugin.yml and the whole class that gets the LP instance?
Seeing a paste of the problem makes everything so much easier! Use https://bytebin.lucko.me/ for easy pasting!
Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!
Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!
I asked for the whole class, not only the method.
When does loadLuckPerms() get called? On onEnable or onLoad?
In the onEnable()
could you just send the whole class?
ok...
(I tried using static access there btw)
https://bytebin.lucko.me/hq05F6mlIz using ServiceProvider
try { ... } catch(Exception ignored) {return false;} is almost never a good idea
which line are you talking about?
This is a silly question but just making sure... LP is installed on the server you're testing this, right?
around LuckPermsProvider.get()
This is a silly question but just making sure... LP is installed on the server you're testing this, right?
@nocturne elbow yes it is
Hey ThEditor! Please don't tag helpful/staff members directly.
uh sorry
around
LuckPermsProvider.get()
the exception only says that the API was not loaded yet
that sounds more like a bukkit thing...
nope LP side
I mean, the issue
Is there a way I can wait for the API to get loaded?
You could listen to PluginEnableEvent
computers smh
@junior jay @nocturne elbow this error is commonly caused by shading the API. Or on other words having the LP API classes in the plugin jar.
They must not be in the plugin jar
hey so some of my plugins permissions are enabled but it still syas no permission when i try then
them*
No need to ask in several channels
For some reason when I add luckperms to my pom.xml I can't use it... anyone know why?
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.1</version>
<scope>provided</scope>
</dependency>
Are you syncing your maven project? ๐ค
well I'm reloading it
Hi guys. Is there event that is triggered when a player has a new parent group?
Does luck perms support fetching perms for offline players?
You need to load the user first through the user manager, and then do all the queries you want
and to be clear, users can be loaded offline?
I think you have to use their UUID?
I think
Yes, that's why you load them, online users have their data already loaded.
And yes you need to use the UUID
Hi! Is there an event that is triggered when a player requests for a web editor link?
You can always just make a onCommand event listener and filter it from there
Yeah PlayerCommandPreprocessEvent will do more than okay
hey. Is there something like a UserUpdateRankEvent or should i use a combination of UserPromoteEvent and UserDemoteEvent.
If you're using tracks, those are the ones you want to listen to
If you're using tracks
and if not?
If not, you should listen to NodeAddEvent and NodeRemoveEvent
ok. There is no singe UserChangeRankEvent
I wonder why sth like UserChangeGroupEvent#getOldGroup and UserChangeGroupEvent#getNewGroup won't exist
Because with NodeAddEvent and NodeRemoveEvent you can do that
GroupAddEvent?
Is that a thing?
Oh yeah
GroupAddEvent?
what if a player already has a group?
because group.<group>
what if a player already has a group?
???
itll still trigger the listener Im sure
Edit: I stand corrected
If they already have it, nothing will happen
Is that a thing?
no it's not
represents a Node a group? Or how do i have to understand you?
Everything is a node
A permission is a permission node, an inherited group is an inheritance node, a prefix/suffix is a chat node
youd just have to get the node and check what it is in your listener
If not, you should listen to NodeAddEvent and NodeRemoveEvent
Youcanhave to listen to those and check if the node.getType is of NodeType.INHERITANCE
ok. Luckperms will define groups over permissions? I thought it works with sql entries?
You say a Node is instance of PermissionNode
When a user is added to a group, they get the node group.<groupname>
No, I say a permission is a node of type permission node
A permission is a permission node
Not "A node is a permission node"
A permission is a node
lol
does someone has the docs link for Node to me?
It's on the javadocs
rly... On github docs is no package name for Node...
so why do you say ๐ฅ
i just asked for a docs link -,-
you just said something ^ ๐ค
compact mode is disgusting
you cant tell whos talking
like imagine having to read
get out of dev api if u cant dev
After you told me about Node i found NodeMutateEvent. Why should i use a combi of NodeAddEvent and NodeRemoveEvent if there is a NodeMutateEvent that is exactly what i need.
I guess we don't all know all the ins and outs of the API
, sorry about that
Because NodeMutateEvent isn't an event that gets called at any time, but rather the subclasses that extend it
It's like trying to listen to Event on bukkit
it'll do nothing
because Event per se doesn't get called at any time
but rather the subclasses that extend it
UFFF I see my mistake.... I havn't seen extends NodeMutateEvent
Hi folks, there is any Event to when the player change the main group?
Nope, you should listen to a combination of NodeAddEvent and NodeRemoveEvent (maybe NodeClearEvent instead of Remove, unsure how that one works)
what is the equivalent of bukkit's Permissible#isPermissionSet() for LP's User object?
@errant ermine you can either call PermissionHolder#data() and NodeMap#contains(Node, NodeEqualityPredicate) or you can PermissionHolder#resolveInheritedNodes(QueryOptions) and check if the returned collection contains a node with the key you need
Ty
It seems that resolveInheritedNodes doesn't pick up inherited nodes that are set to false, whereas Permissible#isPermissionSet does, is there a way to workaround this?
Actually nvm it seems using PermissionHolder#getCachedData() in tandem with getPermissionMap() gets all the user's nodes regardless of value
So does NodeMap#contains with the proper equality predicate :)
It seems that
resolveInheritedNodesdoesn't pick up inherited nodes that are set tofalse, whereasPermissible#isPermissionSetdoes, is there a way to workaround this?
And that should work for any node regardless of value ๐ค
I mean, if it didn't, I'm sure LP would be 100% broken
I printed the backing map and the inherited nodes that were set to false didn't appear but the ones that were true were in the map
hey
Hello
For getPermissionMap()#contains it returns UNDEFINED but I'm pretty sure thats because the nodes I'm looking for are inherited, and not part of the user itself
ignore my previous comments it seems to be working now, I must've borked something beforehand
How do I get or prefix the player?
Vault is your best bet
So LP gives you the prefix you actually want to see, it'll sort all the stacking, weights and stuff
Hey @jaunty pecan sorry to pin you but currently I'm working on a project of scripting with Kotlin and I need to relocate the script dependencies, I was thinking in use jar-relocator, to problem is that RElocatingClassVisitor and RelocatingRemapper is not public, I want to know if could make it all public or if you give me permission to make a PULL REQUEST with this feature
Hey DevSrSouza! Please don't tag helpful/staff members directly.
because, currently I basicly coping pasting from jar-relocator
https://pastebin.com/8cpZt6HN
https://pastebin.com/sCV2yyfp
for some reason the lp instance is null when getting it on server started
it worked fine when I got it every chat message but it's not too efficient
I want to know if could make it all public or if you give me permission to make a PULL REQUEST with this feature
@solemn condor isn't it open source?
I mean, you can do pretty much anything you'd like without consulting at all as long as it complies with the license
How do I get or prefix the player?
Vault is your best bet
So LP gives you the prefix you actually want to see, it'll sort all the stacking, weights and stuff
@untold cloud Make sure that your plugin at least softdepends on LuckPerms
wdym?
plugin.yml
In your plugins.yml you can declare dependencies
And not only should you do that but since this affects loading order sometimes you need to
ah ok ty, didn't think it affected anything except stopping the server and not loading
for sponge i'd just declare it in the Plugin annotation right?
I'm new to making plugins... I'm trying to make a plugin that is a global list command (displays a list of everyone online), and I was using LP api for that. It's just, now that I added it into my command, the command doesn't seem to get registered. I still have it in the PluginManager portion of my main onEnable. Thanks for any help.
Okay, uhm, two things:
(displays a list of everyone online), and I was using LP api for that
??????
the command doesn't seem to get registered
getCommand("mycommand").setExecutor(commandExecutor)?
why do you need LP api to display players online?
why do you need LP api to display players online?
basically: I want it to look cool. i don't just want a list like "here's players on the server" I want a list of who is on which server divided by role.
If you're looking to list players by specific permissions, use a for loop
Well... Yeah. The thing is... my command isn't getting registered.
You dont need lp api
on which server
That screams bungeecord plugin
getCommand("mycommand").setExecutor(commandClassName())
yes. It is a bungee plugin.
Oh true
I already have that...
And your command class how does it look like?
idk bungeecord API so i will leave this conversation
It's a mess of spaghetti code, but do you want me to send it here?
hastebin
okay
Question, why don't you start with the spigotAPI instead of diving right into making bungeecord plugins?
Question, why don't you start with the spigotAPI instead of diving right into making bungeecord plugins?
It's not harder, it's just different
Thats why I asked
I tried that... It gave an error.
public ProxiedPlayer FindByPermission(String permission) {
for (ProxiedPlayer p : ProxyServer.getInstance().getPlayers() ) {
if (p.hasPermission("group.group") return p;
}
return null;
} ```
wat
how would it give an error
send your code and error message then
no it doesn't "just does"
'ey look at that. it doesn't error.
@Override
public void execute(CommandSender sender, String[] args) {
//blah blah
}
It used to.
k cool now try compiling and running the command
For some odd reason.
you loop through the same thing in two different for loops which is just like why?
huh?
for (ProxiedPlayer player : players){
playerServers.put(player, player.getServer());
}
for (ProxiedPlayer player : players){
playerGroup.put(player, api.getUserManager().getUser(player.getName()).getPrimaryGroup().toLowerCase());
}```
Still doesn't think it is a command.
Where did that come from
compileList methods
This may help
you loop through the same thing in two different for loops which is just like why?
I don't use Java much so it is a learning curve. Plus, I was trying to get past the limitations of just Bungee API.
I expect my code will be a LOT less "spaghetti" once I actually get LP API to work.
okay
why is it split in two if the code is exactly the same?
both are CommandSender
both have sendMessage
one for console one for player
you only need the one
I didnt see them send the code here. I was wondering where it was all coming from ๐คฆโโ๏ธ
Check to see if it is an instanceof a player
Then use else
lol
This may help
The thing is... I don't need something like that...
I am trying to make a per-rank global list. Which won't work with Bungee API due to the fact that player.getPermissions doesn't show the LP group permissions. (Or any LP permission... for that matter...)
So, I need LP API.
I don't even think he needs to, doesn't seem like he's using any player specific methods
Would just have to change player.sendMessage to sender.sendMessage
Guys... The problem isn't my code being spaghetti. I know that. I will fix it myself when I figure out why the command isn't registering.
You can ditch half of your code Nitrate and simplify it
Might help you better understand whats going on
on the commands
I might have an idea
No. I understand that it isn't my GlobalListCommand command.
I put it in after sending.
Okay
:/
I just want my command to actually register. Is there anywhere I need to instantiate the LuckPerms api thing in my Main class?
I might have an idea
remove the aliases containing
:
I've had this working. I just need to change it because it wasn't working like I wanted.
send your main class?
And when I added LP api, it now won't register my command.
No errors or anything.
ok one sec.
What do you need LP API for?
did you add it as a softdepend or depend
I still dont get it
to get the primary group
But you could just check permissions cant you? Or is that not a bungeecord api thing?
if they don't use lp api they'd need to know all the groups ahead of time
Thanks jordan. I'm tired and don't know how to explain stuff.
do any of the other commands register?
how do I add "softdepends" I saw it on another API set up but I didn't know how to do it for this one. (Someone should add that to the wiki.)
bungee.yml
Well... duh. :P
okay.
at the "root" level of the yml
yep
dumb question
but have you tried without the (this)
I mean, you'll want it to be depends instead of softdepends
because your plugin won't run without LP
why doesn't bungee support arrays for authors ๐
getProxy().getPluginManager().registerCommand(this, new StreamCommand()); instead of getProxy().getPluginManager().registerCommand(this, new StreamCommand(this));
public class GlobalOnlineCommand extends Command {
Again, idk if im being stupid or not because bungee.. but isnt it implements CommandExecutor
nope, extends
huh
it's abstract class, not interface
it has its own implementations
See. I've never used class inheritance because I'm a C# person and I've never needed to use it. Java has it used a lot more...
do any of the other commands register?
but that one
Yeah.
console clean of errors
Yep.
comment out everything LP related from that class alone and see if it registers
๐คทโโ๏ธ
fun
oh wait... I'm blind...
one sec
[00:00:40 WARN]: Exception encountered when loading plugin: StreamLine java.lang.NoClassDefFoundError: net/luckperms/api/LuckPermsProvider at main.net.plasmere.commands.staff.GlobalOnlineCommand.<init>(GlobalOnlineCommand.java:21) ~[?:?] at main.net.plasmere.StreamLine.onEnable(StreamLine.java:48) ~[?:?] at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:300) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:297) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ~[travertine.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:11b0fea:157]
I said everything lp related
wait
did you
did you uninstall LP from bungee...?
nope
comment this too
It won't compile if I do that, though.
comment out everything LP related from that class alone and see if it registers
comment out everything LP related
COMMENT OUT everything
EVERYTHING
no errors
Yes.
What version of LP do you have in proxy?
You're most probably using 5.1 api, right?
yeah
btw. Y'all should fork LP to Fabric.
Not up to me
I think someone was making a pr for it but it hasn't been merged
There's one person working on that
Is it i509?
I know he's doing something for that.
hey. It registers now guys. fancy that. it's almost like I could've spared myself coming here and your guys' time being wasted.
it's okay ;d
:D
okay. That's all I needed. Time to clean up my code and get it working correctly.
Thanks!
"satiating"?
Look idk I looked up complicated sentences
I think it means satisfying
Lmfao
It does
I am adept because I had a great pedagogia.
No you didn't
I utilized a q-tip to emaculate my auditory perceivers.
LOLL
Sorry I will move from dev api
Hello there. Can someone help? I'm trying programmatically add permission to group but API doesn't provides me any group but default. For an example:
LuckPerms perms = LuckPermsProvider.get();
GroupManager manager = perms.getGroupManager();
scheduler.runAsync(plugin, () -> {
manager.loadAllGroups().get();
manager.getLoadedGroups().forEach(it -> System.out.println(it));
});
//Returns only defualt group but I have about 10 groups besides default
Any ideas??
And besides that I can't execute any command of my plugin if it require permission even if i have admin group with * permission
you prob didnt register your commands properly then
I use a popular Aikar's ACF api for making commands. I can show some code how I registered it (i followed the guide i mean). Commands working properly but if they only doesn't require permissions to be executed
So maybe you're not checking permissions properly?
Can you send code for the commands that aren't working?
@jaunty valley run the forEach on the get()
And what does /lp listgroups show on the server?
get() returns Void type
Very odd
Here is my command. Tab completion sees it.
But when i try to execute it
info of my user instance
tab completion != have permission
info of admin group permissions
tab completion != have permission
I know. I said it to demonstrate that my command is registered
My command requires "discordauth.admin" permission
I use Aikar's ACF api for commands
@CommandAlias("discordauth|dauth")
@CommandPermission("discordauth.admin")
public static class PluginCommands extends BaseCommand{...}
@CommandAlias("discordauth|dauth")
@CommandPermission("discordauth.admin")
public static class PluginCommands extends BaseCommand{
@Inject
private DataSource db;
@HelpCommand
public void onHelp(CommandSender sender, @NotNull CommandHelp help){
help.showHelp();
}
@Subcommand("get player")
@CommandCompletion("@players")
public void onGetPlayer(CommandSender sender, @NotNull ProxiedPlayer player){
String name = player.getName();
AuthPlayer authPlayer = db.getPlayer(name);
if(authPlayer == null){
sender.sendMessage(new TextComponent("Player \"" + name + "\" is not in database."));
return;
}
sender.sendMessage(new
TextComponent(authPlayer.toString()));
}
}
basically i need get player subcommand
it isnt working too
I hope that it is some kind of acf's problem idk
This api is very comfy
Their docs are pretty cheap and their helper said that it used to be some problem with luck perms
Have you tried giving the permission node?
But its just a common command of mine lol
Sometimes * can cause issues
maybe try verbose
info of admin group permissions
.
/lp verbose on
the run your /dauth command
i have tried
and the result?
welp idk its just spamming
!verbose
LuckPerms provides a verbose command to help you find out what permissions a command/plugin is checking.
try /lp verbose command <name> dauth
name of my player?
of the person running the command yes
it returned the unknown command on my local lang
Whats the translation
Its the side problem
"the unknown command"
I should investigate what returns "the unknown command" message. Need to ask my sys admin
Its some side think like some other plugin i think or BungeeCord
isnt /dauth the plugin you are coding?
Do you know how to code a command without aikar's api?
If so, do some testing using the normal methods you'd use to code the same command
If you don't know how to code a command without aikar's api I suggest you learn
Do you know how to code a command without aikar's api?
Yes
If so, do some testing using the normal methods you'd use to code the same command
Yeah, I thought about it
@jaunty valley is it a bungee plugin?
Yeap @turbid solar
/lpb verbose command <you> dauth
idk what happend with lpb but in all commands it returns only plugin's status
i have it installed
Most likely not on a database
!storage
LuckPerms allows you to store data in a variety of storage types, read about the benefits and drawbacks of each type on the wiki.
should it be on mysql?
To sync data between servers, you need to connect each LuckPerms plugin to the same database (for example MySQL) and set up a messaging service.
!network
If you run a Bungeecord network, learn how to correctly setup LuckPerms on all server instances (including Bungee).
Syncing data between servers
https://github.com/lucko/LuckPerms/wiki/Syncing-data-between-servers
oh thx
idk what happend with lpb but in all commands it returns only plugin's status
@jaunty valley You most likely dont have permission to use lpb.
That also ^
How foolish was I to assume LP was set up properly
haha oh welll
Hello everyone !
Sorry, I don't really understand the LuckPerms API ...
Actually, I'm trying to get the weight of the primary of an offline player...
How can I do this ?
what have you try? what are the specific issue you face with the api, else we can only link you to the api wiki and javadocs
!api
Learn how to use the LuckPerms API in your project.
@obtuse jolt Thank you for your answer.
Here my problem: I'm trying to dev a plugin with a ban/mute GUI. (because there are some staff who doesn't know how to use a sanction table and I'm sick of repeating myself)
To do that, I have built my GUI etc, everything works but i use:
Bukkit.dispatchCommand(console, sb.toString());
to execute a command.
But here is my problem: The command is executed by the console, so anyone can mute / ban anyone.
What I'm trying to do is get the weight of a player's primary group to know if it's bigger or smaller than the one they're trying to mute / ban ...
Here is the command:
"/ punishmentgui <nickname>"
I could have done this just with Bukkit's permission system, except the "nickname" player can be logged out!
And a disconnected player doesn't have permission, so can't check that!
Hey หหห! Please don't tag helpful/staff members directly.
Euh, sorry ... ๐คทโโ๏ธ
(because there are some staff who doesn't know how to use a sanction table and I'm sick of repeating myself)
100%
@undone forum You can get permissions with loadUser method provided by LuckPerms
Couldn't you also just check if the player hasPermission bangui.bypass or something? and if they do, send a message to the person using the GUI that they can't ban this player.
Docker
owo
I'll try, ty @short fossil
Tim the problem with that is Bukkit#hasPermission does not support offline players
True true
@undone forum with the user object you can easily get the primary group of a player
If you want to go that route
Even if the player if offline ? @crystal sonnet
Hey หหห! Please don't tag helpful/staff members directly.
Of course. Thatโs why youโre loading it
Mh...
I will try when I finish class, thank you
The NodeAddEvent only gots triggered, if the change was on the Same Server
Is there a way to trigger it on every Server?
did you sync LP of your servers to a common sql database
Yes
If i add a Node over the Bungee, the Event dont get triggered on the lobby
But the Node is added on the lobby
i think thats just how that event works, bcu luckperms on each server is independent of each other
maybe try NodeMutateEvent? it depends on your usage tbh
NodeMutateEvent doesn't get called directly, its extending classes do (such as NodeAddEvent or NodeRemoveEvent)
woop it's alive
https://github.com/lucko/LuckPerms/pull/2602 is ready for reviewing or not
Hello everyone !
BrainStone tried to help me, but here is my problem:
If you don't remember my initial problem, here is: https://discordapp.com/channels/241667244927483904/420538367986499585/750720007251427458
So I tried his solution, and I ran into a new problem, here it is:
at fr.ayuniz.staffutils.commands.TestCommand.onCommand(TestCommand.java:24) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
... 15 more```
When I try to use the command with a disconnected player, here is the error I get:
(The player exists and has already connected since using the plugin, but has not connected since the last reload ...)
I showed you my current code in picture at the bottom of the message (it seems to me more visible thanks to the colors)
Is there a possibility of retrieving the information via the databases?
Thank you to the one who accepts to help an apprentice developer in search of knowledge! ๐
You were told to use loadUser, not getUser
Oh, wait
So I made a plugin for spigot and Luckperms
I was wondering if someone was using LuckPerms on their Bungee server and my plugin on one of their spigot servers. Would my plugin be able to hook into LuckPerms?
Of course not
LuckPerms needs to be installed on the backend servers anyways if you want it to have any effect on them
hm ok thanks
Youโre welcome
I tried your way @crystal sonnet, but It returns the default group everytime, if player hasn't logged in ...
Hey หหห! Please don't tag helpful/staff members directly.
This message stresses me out, I don't know if I'm making a mistake ๐ฆ
You might want to take a look at this, loading offline user data can take a large amount of time (specially if you're connected to a remote database), you don't want to block the main server thread to load a user, do you? :q
https://luckperms.net/wiki/Developer-API#using-completablefutures
As for your main problem, I don't know, make sure the returned OfflinePlayer has joined before (OfflinePlayer#hasJoined I think it is).
@SuppressWarnings("deprecation") ๐
Even if, they can still have no LP data which will return default as parent group
@SuppressWarnings("deprecation")๐
Most probably thegetOfflinePlayer(String)lol
Oh yeah it's for sure that, notice it's crossed out
Oh, you'll also want to Bukkit#getOfflinePlayer(String) asynchronously as well, querying offline player data may be thread blocking too if they haven't joined before
Those are just tips so you don't lag the server every time you run a command.
This is what concerns you lol
As for your main problem, I don't know, make sure the returned OfflinePlayer has joined before (
OfflinePlayer#hasJoinedI think it is).
Even if, they can still have no LP data which will return default as parent group
@undone forum
also btw could you nick yourself something that is actually mentionable and not invisible?
Are the groups assigned per server? @undone forum
So much informations ... ><
@crystal sonnet There is only one server, I'm trying my plugin on a local server
Hey หหห! Please don't tag helpful/staff members directly.
Heya! what am I doing wrong here?
https://gist.github.com/02Miki/d636820798283dcbca0de0c431abebfb
changes are not applied ingame
no errors at all in console
Hey หหห! Please don't tag helpful/staff members directly.
@frank drift should not need to ask again @undone forum
@marsh matrix how do you know itโs not being applied?
yup
Are you removing the old node?
Wiki doesn't mention how to set specifically meta nodes, just how to create them and get the value
oh
nope nvm, yea it doesn't
Always has been
https://i.imgur.com/40OKgf9.png that's it, I'm dumdum
I did getNodes() instead of data()
thanks, and apologies!
Youโre welcome
How would I go about running a command with the clickEvent without checking perms?
just op and deop?
or give and remove perm?
or is there an easier way?
Make it run from console?
run it as console?
so for /rules for example
can you just run that from console?
not really cause it has to send a msg to the player
maybe you can do /rules player, i doubt it but worth a shot
yea no that wont work ;p
Why wouldn't a player have perms for reading the rules lmao
its an example
and im going with an interactable setup
so just clicking and not typing
this is how Citizens does it (if i read the code correctly)
PermissionAttachment attachment = player.addAttachment(CitizensAPI.getPlugin());
if (temporaryPermissions.size() > 0) {
for (String permission : temporaryPermissions) {
attachment.setPermission(permission, true);
}
}
command.run(npc, player);
attachment.remove();
prolly not idk
i have no clue
@remote sky how plugins usually do it is by having a helper command. Like /action <actionID>
You put a unique ID for every action
And verify that the user is allowed to run that action and what action it is
hey say i have in my groups
Owner
Co owner
MVP
Head Admin
How do i move MVP bellow Head Admin
give it a lesser weight than Head admin
@nocturne elbow wrong channel. Use #support-1 or #support-2
ok
Hi there, I have a question,
Is it possible to save all players that has * permission node in a stringList/hashSet ?
what?
Yes it is possible
I want to remove specific permissions like * from all players that have it with a command
Just loop or iterate through everyone (and load them) and check if they have the permission, then remove it if so
Could you please tell me whats the best way to loop between all online and offline players?
I couldn't check any method for this
For online players is easy but how for offline ones
I'll search more, thanks anyway.
I don't really recall how, tbh
๐คทโโ๏ธ
Hey that's pretty cool
That's probably what lp search uses too, since it also reports for offline players
yeah that would make sense
although it's @since 5.1 so maybe not?
or maybe the functionality has been there for a while and it just got added to the api recently
Wow
11
Look the method described right below
I mean that's what was used before most probably, how did you miss that one xD
ye
@crimson vector @nocturne elbow @wild whale @rustic laurel the UserManager has a method to load a players that have a specific permission and return them in a list
Much smarter than actually loading every player
did fefo not link just that?
Wasn't that what I linked?
lol is ok we're all human
eeh... you sure?
(except @frank drift and @severe bone )
I was thinking about the now deprecated getWithPermission
and @sudden umbra
owo TIL that's a thing
I learned it is thanks to @nocturne elbowothy
That's the old 5.0 method
What would be the smartest way of programatically add / remove a group from a player?
#luckperms-api message
@wild rune you'll use group node builder instead of meta
How would I get the instance of LuckPerms in a Bungeecord plugin?
Would I have to use the Singleton (static access) way?
LuckPerms api = LuckPermsProvider.get();
Learn how to use the LuckPerms API in your project.
How can i get all Players from a specific group. Threadsafe
What do you mean with threadsafe in that context? @uncut ice
That the Method dont let lag the server
How can i get all Players from a specific group
?
@crystal sonnet
Hey Blyrex! Please don't tag helpful/staff members directly.
is this what you are look for? ^
wait no
you want to opposite lol
Well for it to not lag, you need to run it async. No way around it
Yes
You cannot make data loading threadsafe in any ways other than running it async
I need all Players from a group. Not the groups from a player
Now the UserManager class has a method to get all players with certain nodes
Use that
Which method? I cant find any method for that
Hey
It's normal that luckperms projects (plugin and api) aren't at last version at the maven repository ?
Wdym? The API is one, v5.1, then the plugin itself implements the API and it changes every now and then but the API doesn't
i see
!api I think it explains in here how the versioning works
Learn how to use the LuckPerms API in your project.
thx
but i use maven repo and they are not 5.1 version of plugin
Read the link above
It's in maven central, I don't know what that is lol
it's what use maven/gradle to download dependencies
Official search of Maven Central Repository
oh it's not me.lucks now
... .-.
You didn't read the wiki
๐คฆโโ๏ธ
sorry and thx x)
I want to do so that when a player enters / exits a WorldGuard region, a parent is added / removed from the player
Would this cause lag?
The parent addition/removal wouldn't, you'd just need to modifyUser
Okay good - and just to be sure, using the API to do so wouldn't log in the in-game chat, would it?
Fingers crossed then
Yeah that's what I'm currently doing, I wasn't sure if bulk parent addition/removal would cause lag though
I'm having some trouble working out the LP API, I might come back later for help ๐
If you do it through modifyUser it won't, it runs async
UserManager#modifyUser(UUID, Consumer<User>) I think
Ahh, I was using 4.0 dependency
and awesome, thanks jordan!
Okay I have more questions hahah -- I'm reading the wiki, and it looks like a lot of code simply to add a parent to a user? or am I missing something?
What part exactly?
as far as I've understood so far, I'm to get the user data, and add a node - this is the roadblock I'm stuck at now
That's the important line, get's user, you can modify the user (add a node) and it saves the user.
If you want to do it the traditional way just save the user after adding the node (UserManager#saveUser)