#luckperms-api

1 messages · Page 27 of 1

steady jay
#

It's this line, its just in my WarpPlayer class

crystal sonnet
#

Isn't there a call that doesn't expect a world?

steady jay
#

I don't believe so.

#

It sometimes works, and sometime doesn't.

#

You have to specify the world if the player is offline, which half of the will be.

crystal sonnet
#

Can you try to just speficy any world?

steady jay
#

Err

#

What just the default world? Bukkit.getWorlds().get(0)?

inland storm
#

hello I have a problem, or I don't know if it is, when I create a role I put / lp group vip meta addprefix 1 "and 6VIP" the prefix does not appear to me

crystal sonnet
#

@steady jay yes

steady jay
#

Alright. I'll try that.

crystal sonnet
steady jay
#

Seems weird though.

#

I'll commit it to github tonight and see if my users are still having the issue, thanks!

crystal sonnet
#

In any case send a bug report over to GitHub. But make sure you're using the latest version of LuckPerms first @steady jay

#

!download

frank driftBOT
steady jay
#

Thanks, I'll make sure they're using the latest version

cold panther
#

@steady jay Just to check, are you doing this async? If you are not doing this async, luckperms determines it unsafe and will not load the data as a result. This issue covers it, and is still applicable to the newest api from what I can gather https://github.com/lucko/LuckPerms/issues/1150

steady jay
#

I am doing it async. Everything in my plugin is async.

cold panther
#

Hmmm, that's honestly the only thing I could think of as an issue. If the issue keeps happening, I'm sure luck would look into it when he's available

crystal sonnet
#

And just to be sure, providing a world is only to be seen as a temprorary fix and as a debugging measure.

misty hinge
#

!api

frank driftBOT
torpid sigil
#

For the listener does that need something in the main class of the plugin to register it?

#

nvm, I figured it out. I just registered it like other listeners

golden shore
#

Is there a way to loop through all users?

cold panther
#

You can get a set of loaded users (Those online), but you cannot get all users, no

golden shore
#

Sigh

cold panther
#

Actually, I just checked and UserManager#getUniqueUsers should provide you with a set of UUIDs, which you could then use to load all the users

golden shore
#

Yeah couldn't get that to work so just decided to do things differently.

steady jay
#

@crystal sonnet I'm still getting the errors from my uers.

frank driftBOT
#

Hey Olzie-12! Please don't tag helpful/staff members directly.

rugged hawk
#

Hi, can someone explain me how I can set the group of an offline player? I've figured out how to get an offline User object (using loadUser()) but I can't find how to add that player to a group

#

I've this now, but this cannot be right.

user.getNodes().stream()
    .filter(NodeType.INHERITANCE::matches)
    .map(NodeType.INHERITANCE::cast)
    .map(InheritanceNode::getGroupName)
    .collect(Collectors.toSet()).add(group.getName());
crystal sonnet
#

@rugged hawk add an inheritance node. It’s done the same way as with online users

rugged hawk
#

do you have any pseudo code? I don't know what you mean

crystal sonnet
#

@rugged hawk

rugged hawk
#

Yeah where do you think I got that piece of code from. I've already read the dev wiki and didn't find anything about adding a 'group node'. I know I can set a permission via the Node stuff but there isn't a Node like GroupNode or am I wrong?

crystal sonnet
#

It's InheritanceNode as I mentioned @rugged hawk

rugged hawk
#

Ow

crystal sonnet
#

Also that is not the dev wiki

#

That is the cooklbook

#

literally filled with nothing but examples

rugged hawk
#

Yes, but i've already read that page via the dev wiki

#

But I didn't knew I had to use the InheritanceNode

#

It would be easyer if you add a 'modify group' example in those example pages

crystal sonnet
#

Add a suggestion on GitHub 😉

rugged hawk
#

Last time I did that it was ignored completely

crystal sonnet
#

I mean on the cookbook

rugged hawk
#

But anyway thx for responding I'll try it out tomorrow

crystal sonnet
#

You're welcome

floral mesa
#

I am making a plugin and I need to check if player is inside a specific luckperms group
So I am checking for the permission
What is the permission?
Someone knows?

#

Someone?

#

pls

fervent reef
#

try it with checking the player's permission "group." + yourGroupName

dreamy pagoda
#

How can I find out which group a player is in?

marsh matrix
ripe token
#

If I want to format chat is it recommeneded to use Vault, PlayerholderAPI or LuckPermsAPI directly?

#

I have some issues using vault as it doesnt seem to retrieve the actual prefix but more just the group name.

oak badger
#

typically if you can use Vault, use Vault, because it works on the most servers

ripe token
#

Does Vault support Luckperms?

oak badger
#

LuckPerms supports Vault

ripe token
#

Hmm, weird that prefixes are just the group names then...

#

Is this just an issue I'm having or have others had this too?

oak badger
#

Vault has a separate method for getting group vs getting prefix

ripe token
#

Yes, thank you. I'm stupid 🙂

oak badger
#

you're not stupid, you're just learning 😆

ripe token
#

Are there any performance downsides of always getting the primary group of a player and then the prefix?

#

Or does Luckperms & Vault handle that all and cache it?

oak badger
#

don't see why it should be a problem

#

afaik LuckPerms provides to Vault, and LuckPerms should have a fairly efficient method of handling it

ripe token
#

Oke

oak badger
#

nothing you should personally have to worry about -- which is why it's an API 🙂

#

just use it, let others do the work for you

ripe token
#

This is a bit off topic for this channel but is it possible to format chat while the server is reloading or block messages during that

oak badger
ripe token
#

As during that (illegal) time the chat format returns back to vanilla.

oak badger
#

reloading isn't really supported by spigot or plugins generally

#

during that time i don't think you have any control

mint torrent
#

Question.... when i add t he plugin to my server will I have to enable perms for ervyone to be able to mine and such?

rustic laurel
#

Depends which plugin

crystal sonnet
#

@dreamy pagoda get the primary group from the user object

pliant linden
#

Anywhere where I can make a ticket?

obtuse jolt
#

Just ask your question

jovial saffron
#

How do I get a permission user with a username string? And how can I obtain that players primary group and obtain a track instance?

rustic laurel
#

!api (and the javadocs within) contain most if not all your answers

frank driftBOT
jovial saffron
#

I tried reading that, but I’m still confused on what to specifically do to get a player, would User permUser = (User) player; work?

rustic laurel
#

pls send what you're trying in a codeblock so Brain or Luck or someone with more knowledge than I can help easily

jovial saffron
#

I haven’t really done anything yet, but all I am trying to do is:
Get a User from a string that is a player’s username, then also get a certain track that has the name “default” on my server.

Then I want to get the primary group of said User and be able to set another group for that user.

rustic laurel
#

And you read through both the wiki and the javadocs?

#

And the API cookbook?

jovial saffron
#

All I am confused really is that on the online docs for the API, it says the variable luckPerms, which I’m not sure where that comes from. And I don’t know how to use a certain method such as “TrackManager#getTrack” in my class

rustic laurel
#

This might help ^

grim cape
#

I tried reading that, but I’m still confused on what to specifically do to get a player, would User permUser = (User) player; work?
@jovial saffron i believe you need to call getuser

#

api.getUserManager().getUser(player.getUniqueId());

#

maybe you can cast it

#

but i haven't tried

marsh matrix
light pecan
#

Hey, does someone of you know how to set the primary group of a player? I tried it for some time and didnt got this to work.

grim cape
#

It is on the wiki

crystal sonnet
#

@jovial saffron check the javadocs. The user manager has the appropriate methods

#

Do you know what setting the primary group means for LuckPerms?

light pecan
#
        User user = userManager.getUser(uniqueId);

        if(user != null) {
            user.setPrimaryGroup("bewerber");
            userManager.saveUser(user);
        } ``` This wont work
crystal sonnet
#

Do they have the group bewerber already?

light pecan
#

Yes

#

Ehm no!

#

xD

crystal sonnet
#

Good. Then it can’t work

#

You can’t set the primary group to a group they don’t have

light pecan
#

Ah okay

#

how do i add the group then?

grim cape
#

wiki

crystal sonnet
#

That’s a very different thing

#

In short you need to add an inheritance node

#

!api

frank driftBOT
grim cape
#

add permission group.group

light pecan
#

Alright thank you! I got it know

#

now*

crystal sonnet
#

You’re welcome

dreamy pagoda
frank driftBOT
#

Hey !Angxstupst! Please don't tag helpful/staff members directly.

neat jackal
#

What is your LuckPerms version?

dreamy pagoda
#

5.0

crystal sonnet
#

@dreamy pagoda you need to install LuckPerms

upbeat oriole
#

@crystal sonnet can you please help me man my servere is supposed to go up today and I really need help with luck perms

frank driftBOT
#

Hey Ranily! Please don't tag helpful/staff members directly.

crystal sonnet
#

!ask @upbeat oriole

frank driftBOT
#
Please ask your question!

Please ask the question you have. Don't ask to ask, or ask to DM someone. There are people here to help you, but we need to know what to help you with, so please just ask the question you want to in as much detail as possible!

Why shouldn't I ask to ask?
upbeat oriole
#

!ask

frank driftBOT
#
Please ask your question!

Please ask the question you have. Don't ask to ask, or ask to DM someone. There are people here to help you, but we need to know what to help you with, so please just ask the question you want to in as much detail as possible!

Why shouldn't I ask to ask?
upbeat oriole
#

brain

#

wait

#

can I join a call with you

crystal sonnet
#

1 on 1 support is 30€/h

upbeat oriole
#

I just need 5 mins

#

: (

crystal sonnet
#

Though in any case you might already have your solution if you bothered to read the bot message

upbeat oriole
#

I did

#

!ask how do I install luckperms

frank driftBOT
#
Please ask your question!

Please ask the question you have. Don't ask to ask, or ask to DM someone. There are people here to help you, but we need to know what to help you with, so please just ask the question you want to in as much detail as possible!

Why shouldn't I ask to ask?
crystal sonnet
#

Now what does the bot say?

upbeat oriole
#

ok

crystal sonnet
#

It has a lovely message there for you

upbeat oriole
#

ok

#

Ik

#

i have already been there

#

its not really helping me to the full extent

crystal sonnet
#

Then you are blind

upbeat oriole
#

I just need to talk to someone for 5 mins about my server

crystal sonnet
#

But I'm utterly amazed that you still haven't understood the message

#

Do yourself a favor

upbeat oriole
#

buddy

crystal sonnet
#

Ignore the links

upbeat oriole
#

I asked aquestion

#

what do you mean

crystal sonnet
#

Read the bold message up top

upbeat oriole
#

brother

#

I asked

#

!ask

frank driftBOT
#
Please ask your question!

Please ask the question you have. Don't ask to ask, or ask to DM someone. There are people here to help you, but we need to know what to help you with, so please just ask the question you want to in as much detail as possible!

Why shouldn't I ask to ask?
crystal sonnet
#

Where?

upbeat oriole
#

How do I install luckperms?

crystal sonnet
#

!install

frank driftBOT
upbeat oriole
#

ok

#

yeah

#

I already am on the website

#

the server I am using doesn't reconize the luck perms plugin,

marsh matrix
crystal sonnet
upbeat oriole
#

I did

crystal sonnet
#

and b) elaborate your question

#

Oh so you're crossposting?

marsh matrix
#

lmao

upbeat oriole
#

and I wasn't able to find the information

marsh matrix
#

gottem

upbeat oriole
#

I joined this discord for further support

#

I would just like to talk to someone for 5-10 mins about the plugin

crystal sonnet
#

Then ask your question in the right channel with as much detail as possible and wait

upbeat oriole
#

I did

#

and I got an asnwer

crystal sonnet
#

Obviously not

upbeat oriole
#

it didnt help

#

buddy

crystal sonnet
#

Then explain yourself better

upbeat oriole
#

I am now asking just to talk for 5 mins because its easier that way

#

is it really that hard ???

#

come on bruh

crystal sonnet
#

I don't want to talk

marsh matrix
upbeat oriole
#

ok

#

cool

crystal sonnet
#

In any case please move to the right channel

upbeat oriole
#

ok

crystal sonnet
#

@marsh matrix what's the issue with the code again?

marsh matrix
#

Basically, I can't listed the onNodeRemoval event right, I'm probably doing something wrong

#

I tried to remove the node, or even just make it expire, and it the event doesn't fire; I also tried to add a thing that printed a message in chat, but it didn't even do that

#

ignore the random dumb gibberish like this:
kitArray = kitArray.toString();
I already changed it, it was kinda late lol

crystal sonnet
#

Alright. Looking again

#

@marsh matrix how did you try to remove the node?

marsh matrix
#

with the command (/lp u IGN unset etc) and by setting a temp node of 5 seconds and let it run out

#

both didn't work

crystal sonnet
#

And just to be sure, make sure the TestListener constructor is actually being called

marsh matrix
#

How would I call it? (sorry, really just used to sponge listeners)

crystal sonnet
#

It's a constructor

#

I feel like you should know how to call those

marsh matrix
#

oh

young epoch
#

I need some help. Where can I get fast help?

marsh matrix
#

yea I was just an absolute dumb, sorry and thank you

crystal sonnet
#

@marsh matrix you’re welcome

pulsar ore
#

Hello! This might be a dumb question but I can't seem to get permission removal to work for me. all I have to do is remove the node from the user and save and cleanup the user, correct?

crystal sonnet
#

Not sure what you mean with cleanup, but besides that, yes

pulsar ore
#

ah, so usermanager.cleanupUser(user) is not required after save(user)?

crystal sonnet
#

No

wise violet
#

How can I get the remaining time that the user will be in a parent temp?

rustic laurel
#

!api the javadocs and the wiki should show ya

frank driftBOT
fierce juniper
#

Yeah for me its throwing errors when try to return LuckPerms.getUserManager().getUser(player.getUniqueId());
--
Cannot make a static reference to the non-static method getUserManager() from the type LuckPerms

azure latch
#

You have to have an instance of LuckPerms first, you can't just pull non static methods from it like that

fierce juniper
#

How to make the instance for LuckPerms?

rustic laurel
#

!api i think it's one of the first things on here

frank driftBOT
fierce juniper
#

No its not

rustic laurel
#

It's one of the first things right there

#

If you're not gonna look when help is provided, don't ask for help

fierce juniper
#

How to get the Prefix of the Group?

#

the player is in

rustic laurel
#

also on the wiki

#

just scroll a little further

languid vale
#

Does someone know a good tablist plugin?

crystal sonnet
thick robin
#

http://paste.simonm.net/bilokivuta.java why is this called 6 times for 1 rank change? I have a discord syncing plugin and I am trying to make it so if the user if offline, it will still fix their ranks but this wants to fire 6 times

dense dawn
#

Is the Documentation not updated? I am not able to get a UserManager#loadUser

#
    public User getUser(UUID uuid) {
        UserManager userManager = Skyblock.luckAPI.getUserManager();
        CompletableFuture<User> u = userManager.loadUser(uuid);

        return u.join();
    }
#

loadUser isn't recognized and I cannot see any viable substitutes

astral vortex
#

Does LuckPerms support the default Bukkit implementation of Player#hasPermission()?

rustic laurel
#

what's the context for this question - like what are you doing with it and what are you expecting to happen - if you're not using the LPAPI at all you should try verbose too what LP is checking (and if verbose isn't checking anything, make sure you have nothing else doing the job of LP)

astral vortex
#
        // Check for permission
        if (command.getPermission() != null && !sender.hasPermission(command.getPermission())) {
            OChatMessage message = new OChatMessage(schemeHolder.getScheme(command, "no permission").getScheme());
            message.replace(getPlaceholdersForCommand(command));
            message.send(sender);
            return;
        }```
I don't use LPAPI I use Bukkit Player#hasPermission()
rustic laurel
#

okay and what context does this have with Luckperms?

#

just need as much info about your situation as possible please

astral vortex
#

I'm new with LP, how do I use verbose to print in chat?

rustic laurel
#

!verbose

frank driftBOT
astral vortex
#

I guess it doesn't check any permissions

#

Wait a second...

rustic laurel
#

then you're either using another perms plugin on top of LP, you aren't using verbose properly, or your own code is doing LP's job

astral vortex
#

I realized that I had another permissions plugin installed

rustic laurel
#

yep that'd do it lol

astral vortex
#

I feel so stupid sometimes 😄

rustic laurel
#

happens to all of us 😆

astral vortex
#

Anyways thanks for the help 😄

rustic laurel
#

np!

quartz iron
#

how can I do that the prefix is in the tablist ?

rustic laurel
stuck terrace
#

Hello guys! How I can get offline user info via api?

crystal sonnet
#

@stuck terrace check the user manager

stuck terrace
crystal sonnet
#

Almost

#

Read the javadocs of the available methods

steady jay
#

BrainStone I figured out with that error that was I was getting a while ago

#

Vault needed an offline player object, but in their method it just gets their name, and as some players haven’t logged onto the server yet the error was being thrown as OfflinePlayer#getName was returning null. So I’ve used my name method that returns their name no matter what if they’ve logged on or not.

stuck terrace
#

How to get offline player meta via api?

short fossil
#

load a user

#

then just access their data

#

!api

frank driftBOT
dreamy perch
#

does the api have an event when a user’s rank changes?

nimble depot
#

hello how can i add player to any gruop for example 30 days?

rustic laurel
#

With the API?

#

or just commands

brazen zephyr
#

Hi, how can I add a group to a user without settings it to primary?

neat jackal
#

Why do you want to not set it to primary?

brazen zephyr
#

I need to have two groups on one user. Is it possible?

neat jackal
#

Yes, just add the group

#

/ the InheritanceNode

brazen zephyr
#

With the API?

mortal horizon
#

hello

#

someone can help me?

dawn lava
#

!ask

frank driftBOT
#
Please ask your question!

Please ask the question you have. Don't ask to ask, or ask to DM someone. There are people here to help you, but we need to know what to help you with, so please just ask the question you want to in as much detail as possible!

Why shouldn't I ask to ask?
mortal horizon
#

!ask someone can help me? i have problems

frank driftBOT
#
Please ask your question!

Please ask the question you have. Don't ask to ask, or ask to DM someone. There are people here to help you, but we need to know what to help you with, so please just ask the question you want to in as much detail as possible!

Why shouldn't I ask to ask?
obtuse jolt
#

loll

#

dude just explain the issue you are facing

mortal horizon
#

prefixes and permissions with other plugins.

#

i create the rank with prefix but not showing on chat and tab

dawn lava
#

haha

#

you need a chat formatter i.e essXchat and also you need something like TAB plugin

mortal horizon
#

essentials X?

dawn lava
#

specifically chat yes, you need a chat formatter to enable prefixes in chat

mortal horizon
#

can you join my server and help there? beacuse discord is on my phone and my phone battery is dying

obtuse jolt
brazen zephyr
#

How to create user group inherts with LuckPerms API?

neat jackal
#

!api

frank driftBOT
brazen zephyr
#

I already found this InheritanceNode node = InheritanceNode.builder(group).build();
But how I can apply to a user instance?

neat jackal
#

Don't forget to save

brazen zephyr
#

Done. Thanks.

nocturne elbow
#

Is this correct?

#

Sry i am new to this Stuff

neat jackal
#

Remove the </dependencies><dependencies> in the middle

nocturne elbow
#

Ok

#

And When i paste the Import messages

#

It shows like this

nocturne elbow
#

oh

tender minnow
#

Hi I'm pretty new to this API I recently switched from PEX to LuckPerms because of lack of 1.15 support.
I always did this to get a player's group specified.

                if (user.inGroup("RANK")) {

But I have no clue on how you can do the same thing in LuckPerms would be very appreciated if anybody could help me.

nocturne elbow
#

Can you give me the link to API?

tender minnow
nocturne elbow
#

Or i just need to add ```RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (provider != null) {
LuckPerms api = provider.getProvider();

}

neat jackal
#

chickenfricker: You can get the nodes, filter for the inheritance nodes and then there is a list or something of group names

#

I'll test if I can get a working example

tender minnow
#

Okay man thank you if you get me an example would be great ❤️

neat jackal
#

There's already an example on the wiki how to get a list of group names

tender minnow
#

I don't really know how I specifiy a rank with the API, I tried using an example I found on your Node site but I got this error.

neat jackal
#

You are trying to access the static method getGroupManager on the LuckPerms class, you need to use the api object you created

tender minnow
#

NVM

#

Thanks for the help @neat jackal 😄

frank driftBOT
#

Hey chickenfricker! Please don't tag helpful/staff members directly.

dire marsh
cold panther
#

Just to check, do you have LuckPerms as a dependency in your plugin.yml?

#

Also, you really shouldn't get an instance of the LuckPerms API whenever you're using it. It'd be best to get the API once in your onEnable method, and then pass the API as a parameter to the areas that need it

dire marsh
#

Okay I facepalmed myself and put LuckPerms as a dependency in the plugin.yml as shown here https://pastebin.com/niiDYfDa. However I'm still getting the same issue. I will modify to only get the API once in a sec.

cold panther
#

Could you show me the exact line the issue is occurring on? Since you're omitting the imports at the top of the class, the numbers shown in the stacktrace are off 🙂

dire marsh
#

Wow okay I now feel stupid the line that was causing the issue was: public static LuckPerms api = LuckPermsProvider.get();
All I needed to do was delete it. Apologies for wasting your time 😫

cold panther
#

It's all good 🙂

crystal sonnet
#

@tender minnow if you use the 5.1 API then there are loads of utility methods

#

Including getting the groups of a permission holder (which is either a user/player or a group itself)

stuck stone
#

Hello, I have a problem with the Error in the bungeecord console:

I think I have to use an older version of the bungeecord plugin (version 4.x).
I count on quick help.
Greetings!

cold panther
#

That code is exactly the same on version 4, and the method definitely exists in the latest version of redis bungee. Are you using an incredibly outdated version of redis bungee? That area of redis bungee hasn't been touched for years

pliant belfry
#

I dont mean to hijack this question, but how do i check if a group is temporary? I've read the api wiki but only found how to check a group, but not a way of knowing if its just temporary

stuck stone
#

The problem is that bungeeredis is no longer supported ;((

frank driftBOT
#

Hey MiłoszGG! Please don't tag helpful/staff members directly.

stuck stone
#

@refresh

stray wharf
#

That code is exactly the same on version 4, and the method definitely exists in the latest version of redis bungee. Are you using an incredibly outdated version of redis bungee? That area of redis bungee hasn't been touched for years
@cold panther We are using a redisfaker, because redis bungee isn't supported.

frank driftBOT
#

Hey MiłoszGG! Please don't tag helpful/staff members directly.

cold panther
#

@pliant belfry To be honest, you'd be better off getting the group as a Node and then using Node#isTemporary

pliant belfry
#

oh. I found another way that might work, not a proper way tho

private boolean isGroupTemporary(OfflinePlayer op, String group) {
        return !PlaceholderAPI.setPlaceholders(op, "%luckperms_group_expiry_time_%groupname%%".replace("%groupname%", group.toLowerCase())).isEmpty();
    }
``` XD
cold panther
#

oh, if it works, it works I suppose xD

pliant belfry
#

I havent tested it 😛

#

A node is a permission node, and the permission nodes define which group the player is in, right? Just want to make sure i got it correct

cold panther
#

A node is a permission node, yeah. A node that defines a group is an InheritanceNode, but since the inheritance node extends Node they're similar except in how they're processed

pliant belfry
#

Okay thank you

stray wharf
#

That's legal? xD

cold panther
#

It isn't supported anymore and it's open source 🤷

stray wharf
#

for developers?

cold panther
#

open source for everyone

stray wharf
#

Thanks 😄

cold panther
stuck stone
#

Dziękuje ❤️

stray wharf
#

Dzięki ❤️ From Poland 😄

stuck stone
#

No i git

cold panther
#

No problem 🙂

pliant belfry
#

First time in Minecraft dev stuff ive heard someone question if its legal 😮

stray wharf
#

We are a huge network and we cannot afford any offenses :/

#

Thanks again, bye!

cold panther
#

o/

wild whale
#

First time in Minecraft dev stuff ive heard someone question if its legal 😮
why?

pliant belfry
#

Why what? I think its a good thing, people usually grab everything they can without questioning it

cold panther
#

Have you tested that whacky solution, Bendix?

pliant belfry
#

Honestly, I've never used LuckPerms and just sent it off to the guy who wanted it saying that its not tested 🙃

cold panther
#

xD

pliant belfry
#

If i were to run an mc server, i would use LuckPerms tho, i think. But getting into it and understanding the commands to setup a temporary group and a bunch of stuff is just too much work for this tiny project

cold panther
#

fair enough, I don't run an mc server myself. I'm just here to provide support

pliant belfry
#

And im here to develop plugins XD

#

My solution did not work

cold panther
#

Ahhhh, looking at it now I see why. You're passing an offline player, and luckperms won't have any data available for them. One moment

pliant belfry
#

The player is online tho, usually

#

I dont mind learning the node thingy either

cold panther
#

Is the player always going to be online when that method is ran?

pliant belfry
#

Nope

#
    private CompletableFuture<Boolean> inheritsGroup(String group, UUID who) {
        return plugin.getLuckPerms().getUserManager().loadUser(who)
                .thenApplyAsync(user -> {
                    Set<Node> groups = user.getNodes().stream()
                            .filter(NodeType.INHERITANCE::matches)
                            .map(NodeType.INHERITANCE::cast)
//                            .map(InheritanceNode::getGroupName)
                            .collect(Collectors.toSet());

                    for(Node n : groups) {
                        
                        // Stuff
                        
                    }

                    return false;
                });
    }```
I got this tho, mostly copy/paste from wiki
rustic laurel
#

Then (I think) you'll have to load them to memory before you can do anything to them

#

Might be wrong, just learning this myself tbh

pliant belfry
#

Yeah, which is why im going away from Papi and into Luckperms to check Luckperms stuff XD

#
    private CompletableFuture<Boolean> isGroupTemporary(String group, UUID who) {
        return plugin.getLuckPerms().getUserManager().loadUser(who)
                .thenApplyAsync(user -> {
                    Set<Node> groups = user.getNodes().stream()
                            .filter(NodeType.INHERITANCE::matches)
                            .map(NodeType.INHERITANCE::cast)
                            .collect(Collectors.toSet());

                    for(Node n : groups) {

                        if(n instanceof InheritanceNode) {
                            InheritanceNode in = (InheritanceNode) n;
                            if(in.getGroupName().equalsIgnoreCase(group)) {
                                return in.hasExpiry();
                            }
                        }

                    }

                    return false;
                });
    }```
#

Ended up using that and it works 👍

cold panther
#

Awesome 🎆

nocturne elbow
#

Can someone help me with this?

#

i have added the depencency in the pom.xml

azure latch
#

The variable metaData doesnt exist

#

Read up a little bit on the wiki and it shows you how to get an instance of CachedMetaData

cold panther
#

@nocturne elbow I'd recommend upgrading to 5.1. It has some more convivence methods that may prove useful

#

But yes, as katsumag said, you need to get an instance of the player's CachedMetaData. If you're using 5.1, you can do this using the player adapter to reduce your workload.

CachedMetaData metaData = luckpermsApi.getPlayerAdapter(Player.class).getMetaData(player)
lucid rapids
#

hello. since I'm working on a premium plugin and planning to convert it to use Kotlin, it's not as helpful to shade kotlin inside, so I was thinking of making it similar to how LuckPerms downloads and relocates libraries at runtime. I've got it mostly to work (downloading the jars), though I have absolutely no idea how to fetch the checksum of kotlin's stdlib. any possible help?

jaunty pecan
#

try this

#

the way I find the checksums is to just run it using something invalid, and then copy the correct checksum from the error message

lucid rapids
#

I see, thanks a lot! but ultimately wouldn't that make the checksum comparing redundant?

nimble depot
#

hello, any help for create chat for group? for example /a text for admin chat etc? can i do it in or with luckyperms?

jaunty pecan
#

ultimately wouldn't that make the checksum comparing redundant
No, it'll ensure that your users end up with the same file as you

alpine ginkgo
#

Hi

#

I have a problem

#

I have a Minecraft server with MT Friends

#

My*

rustic laurel
#

Is this a problem with the LP developer api

#

If so continue

alpine ginkgo
#

Oh

#

I Will go to general so

rustic laurel
#

(channel topics ftw 🥳 )

alpine ginkgo
#

Si i go to general for my problem no?

nocturne elbow
#

Um Can someone help me with LuckPerms api?
i can't seem to figure out how to use it on InteliJ

rustic laurel
#

!api

frank driftBOT
nocturne elbow
#

Thanks

#

String suffix = metaData.getSuffix();

#

metaData.getSuffix() Gets RedLined

cold panther
nocturne elbow
#

oh this

#

i forgot about this

cold panther
#

S'all good :) If you have issues, be sure to message here again

#

The player adapter was added in 5.1, so to use that solution you'll need to update

nocturne elbow
cold panther
#

Yep, like I said you'll need to update to 5.1 to use that method. Change the version to 5.1 in your pom.xml, and then refresh

nocturne elbow
#

OO

#

Finally Worked

#

nvm

cold panther
#

Is that after reloading your pom.xml?

keen matrix
#

How do I get a player's group suffix ?

cold panther
#

just replace getPrefix() with getSuffix()

keen matrix
#

Thanks boss

#

@cold panther what should I initialize LuckPerms to?

frank driftBOT
#

Hey JBeastlyz! Please don't tag helpful/staff members directly.

keen matrix
#

Sorryy

cold panther
#

It's all good, it depends on your platform tbh. The easiest method isn't necessarily the most reliable, but it works if you ensure luckperms is always loaded before your plugin.

private LuckPerms luckperms;

// your enable method
this.luckPerms = getServer().getServicesManager().load(LuckPerms.class);

That also only works with bukkit. The more reliable methods for each platform can be found here: https://github.com/lucko/LuckPerms/wiki/Developer-API#obtaining-an-instance-of-the-api

In that example, the api instance is called luckperms whereas the documentation states it as api

keen matrix
#

thanks ❤️

blazing portal
#

is it possible to get a groups prefix using the api?

rustic laurel
#

yep

#

!api has how, i believe

frank driftBOT
blazing portal
#

like with the color

#

i have the api its okay

#

i jut cant find the method

#

for to get a users group prefix with thee color(not groups display name)

#

How does this work

String prefix = metaData.getPrefix();
String suffix = metaData.getSuffix();

how does i get this meta data

oak badger
#

show the entire code

#

no one is going to be able to help you with that snippet even if they wanted to

blazing portal
#

That is from the wiki

#

Not my code

#

This is what I am saying

#

I wanna get a groups prefix/suffix and that's all the API shows

azure latch
#

You need to scroll up a bit. The snippets right above that show how to get it

neat jackal
neat jackal
#

Pinning because it might be useful. Any other mod/Luck/Turbo can feel free to unpin if it isn't :)

rustic laurel
#

good idea

#

+1 from the guy that knows -1

oak badger
#

cookbook looks useful

#

javadoc im surprised isnt already linked here anywhere 😛

blazing portal
#
LuckPerms luckPerms = LuckPermsProvider.get();
CachedMetaData metaData 
 = luckPerms.getPlayerAdapter(Player.class).getMetaData(player);
``` i can find the getPlayerAdapterMethod
cold panther
#

Make sure you're on API 5.1

#

The wiki currently provides version 5.0

blazing portal
#

ooooppps hehe sorry

#

all working ty

cold panther
#

awesome

blazing portal
#

i spoke to soon
Error:

java.lang.NoSuchMethodError: net.luckperms.api.LuckPerms.getPlayerAdapter(Ljava/lang/Class;)Lnet/luckperms/api/platform/PlayerAdapter;

Code

LuckPerms luckPerms = LuckPermsProvider.get();
CachedMetaData metaData = luckPerms.getPlayerAdapter(Player.class).getMetaData(player);
String prefix = metaData.getPrefix();
player.sendMessage("Your Prefix: " + prefix);
oak badger
#

you should update luckperms on your server

blazing portal
#

yes sorry, i thought i had the latest version. I make silly mistakes at midnight XD

#

and yes it works ❤️

silk dove
#

What is the channel with which Lucky Perms works in Sponge

#

?

vernal plinth
#

Hey - does LP implement transient subject data for Sponge?

jaunty pecan
#

yes

vernal plinth
#

it doesn't seem to apply permissions or parents

#

same code with getTransientSubjectData() and getSubjectData() and the normal one works but transient doesn't

dusky shell
#

I'm using a plugin that's using luckperms API and I get this error

neat jackal
#

!upgrading

frank driftBOT
#

Sorry! I do not understand the command !upgrading
Type !help for a list of commands.

neat jackal
#

!upgrade

frank driftBOT
dusky shell
#

So I need to download that Jar?

#

I am not the developer of this plugin btw

neat jackal
#

Best to just tell the author to udate their plugin to the new api, but for now, the legacy-api extension should work

dusky shell
#

Alright 👍 thanks

bright badger
#

Question: Do I have to register permissions a particular way so that luckperms know about it? Or I can just use hasPermission("your.permission.here")? (I also need permissions for sub commands)

#

Does this work in plugin.yml?

permissions:
  plugin.subcommand:
     description: description if you'd like
oak badger
#

iirc it tries to collect data about what permissions exist as best it can

#

if you put it in the plugin.yml it will almost certainly know about them and suggest it in the editor

#

if you check for the permission anywhere in the plugin, it should suggest them in the editor at the very least after that check

slim willow
#

am i doing anything wrong?

slim willow
#

??

rich ferry
sharp timber
#

Oh fuck. I never use mavens 😂😂

rich ferry
#

lol

#

rip

cold panther
#

@slim willow Any reason you're not using API 5?

slim willow
#

mmm

rich ferry
#

Ok

slim willow
#

i liked the way i used to add player's to groups

#

and add perms to group

rich ferry
#

So did I write it wrong?

slim willow
#

now its not that easy :L

rich ferry
#

Sorry I havent used maven before

#

for a while

slim willow
#

i mean in ver 5.x.x

cold panther
#

No, the way you added lp as a dependency is fine, fxcilities. It just can't find the api in any of your repos

rich ferry
#

got it

#

wait no i didnt

cold panther
#

the setPrimaryGroup method doesn't actually give someone a group, it sets a group they already have as their primary group, muntder-I.Q. Even with the older API, you need to build an inheritance node and add it to the user

#

You should just need to add https://repo1.maven.org/maven2/ as a repo, fxc

rich ferry
#

ok

turbid solar
#
        <repository>
            <id>maven2-repo</id>
            <url>https://repo1.maven.org/maven2</url>
        </repository>
rich ferry
#

thanks

#

its still in red

cold panther
#

You may need to restart your IDE, or reset the cache

rich ferry
#

ok

#

it fixed

turbid solar
#

Doesn't intellij (if thats what you're using) have a button to reload maven?

rich ferry
#

thansk

#

Im not sure i have never used maven on IDEA before

river ridge
#

Hi, I want help with language Czech !

rich ferry
#

How would I get the prefix of a group

frank driftBOT
surreal harness
#

hello

#

i have depend: [LuckPerms] in my YML tho

#

is there like a method i should be checking for to make sure the API is loaded?

jaunty pecan
#

Move the call to LuckPermsProvider.get() into onEnable

surreal harness
#

yep

#

thanks!

quick granite
#

How would I set a users prefix with the luckperms API?

#

I can't figure it out

#

This is all I have

LuckPerms api = LuckPermsProvider.get();
User user = api.getUserManager().getUser(player.getUniqueId());

I've tried to google it but I can't really find a working method

#

Nothing is working

surreal harness
#

how do i lusten for events

#

listen*

#

like PlayerDataSaveEvent cuz i cant use a normal bungee event listener

cold panther
surreal harness
#

thanks

cold panther
#

The LuckPerms.getApi() method is also for API 4, hence why that method doesn't exist. You now use LuckPerms api = LuckPermsProvider.get();

quick granite
#

Thanks

#

I was so confused

cold panther
#

S'all good 🙂

karmic hill
#

Why this Code not Working :

public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equals("noprefix")) {
            if (sender instanceof Player) {
                Player player = (Player)sender;
                if (player.hasPermission("newdycraft.noprefix")) {
                    LuckPerms lp = NewdyCraft.getLuckPerms(Bukkit.getServer());
                    User user = lp.getUserManager().getUser(player.getUniqueId());
                    Group noPrefixGroup = lp.getGroupManager().getGroup("noprefix");
                    if (user.getPrimaryGroup().equalsIgnoreCase("noprefix")) {
                        user.getInheritedGroups(null).remove(noPrefixGroup);
                    } else {
                        user.getInheritedGroups(null).add(noPrefixGroup);
                    }
                }
            }
        }
        return false;
    }
#

The error is near getInheritedGroups

crystal sonnet
#

@karmic hill well....

#

What is the error

karmic hill
#

I'm not English, I'm French

crystal sonnet
#

So?

#

I'm not English either

#

I can only help you if manage to properly express yourself in the one language we both speak: English

karmic hill
#

Sorry failed

crystal sonnet
#

What is line 47?

karmic hill
#

that's all

crystal sonnet
#

Nevermind. I looked at the wrong one

#

You can't pass null for query options

karmic hill
#

What I pass ?

crystal sonnet
#

Just use the method without a parameter

karmic hill
#

ok Thanks

crystal sonnet
#

cough @jaunty pecan

#

Why is there a method that requires QueryOptions that has a clear user associated?

#

In any case get the QueryOptions like this:

ContextManager contextManager = lp.getContextManager();
QueryOptions queryOptions = contextManager.getQueryOptions(user).orElseGet(contextManager::getStaticQueryOptions);
#

Some method names may be slightly off. But that should fix it @karmic hill

karmic hill
#

ok I try that

#

But how do I apply this to my code ?
contextManager.getQueryOptions(user).orElseGet(contextManager::getStaticQueryOptions) doesn't have any add, remove or contains Methods

crystal sonnet
#

You then use the variable queryOptions instead of the null

karmic hill
crystal sonnet
#

Well you can't directly modify the group lists that are returned

#

You need to add or remove the group via an inheritance node

karmic hill
#

Can you explain ?

crystal sonnet
#

You add or remove groups a player (or another group) inherits from by adding or removing inheritance nodes

#

All data in LuckPerms is represented through nodes

#

!api

frank driftBOT
karmic hill
#

thanks

long tusk
#

Is there a way to get all users or their UUIDs who have a specific PermissionNode

crystal sonnet
#

Yes, Check the UserManager

long tusk
#

Thank you 🙂

cold panther
#

Regarding the QueryOptions, I believe there is now PermissionHolder#getQueryOptions, meaning you should be able to use user.getInheritedGroups(user.getQueryOptions()); to get their groups opposed to using the context manager

surreal harness
#

why would a player's primary group be null

cold panther
#

Could we see your handler please?

surreal harness
#

sure

#

give me a sec

#

there is mroe in the switch statement

#

and the syncrole method just sends a POST request to an APi

cold panther
#

Say you print user.getPrimaryGroup().getName() to console above the switch statement, is anything printed?

surreal harness
#

should getPrimaryGroup() already just return the string?

#

what would getName() even do in this case

cold panther
#

It does not, no. It returns the group object

surreal harness
#

autocomplete says it returns a string pog

cold panther
#

Oh yeah, whoops my bad. But yeah, does user.getPrimaryGroup() return anything when printed to console?

surreal harness
#

i just tried it

#

it isn't uhh

#

don't all users have a primary group whether it be default or something else?

cold panther
#

They should do, yeah. Is the person still online following the event?

surreal harness
#

not sure

#

i tried it without event

#

and it worked

#

just by iterating through every player

cold panther
#

The user being cleared from the LP cache is the only thing I can think of, and that only happens when they leave the server. Perhaps try changing api.getUserManager().getUser() to api.getUserManager().loadUser()

#

If that doesn't work, I'm out of ideas so we'll ping luck xD

surreal harness
#

ok

river ridge
#

@jaunty pecan Hi, can I translate to Czech ?

frank driftBOT
#

Hey LuKyN94! Please don't tag helpful/staff members directly.

surreal harness
#

lol

#

look

#

all i need is an event that runs pretty frequently

#

taht i can hook into real quick and call the API sync

cold panther
#

Oh, lemme see renai

surreal harness
#

alright gimme a sec

#

i just need this to run a bunch

cold panther
#

I don't see why the PlayerSaveDataEvent isn't working tbh, but perhaps you can try the UserDataRecalculateEvent

#

it has a getUser method

surreal harness
#

oh

#

i don't even need one with getUser

#

just needs to run a lot

cold panther
#

That event runs whenever a user's cache is refreshed, so it is ran a lot

surreal harness
#

alright

quick granite
#

Using the API how do I get a players current prefix?

cold panther
#

Are you using API 5.1?

quick granite
#

Yeah

cold panther
quick granite
#

Ok thanks

quick granite
#

Why is this giving me a null point exception?

#
Caused by: java.lang.NullPointerException
        at me.imedia.kingstona.listeners.PrefixGUIListener.onInventoryClick(PrefixGUIListener.java:46) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_231]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-db6de12-18fbb24]```
crystal sonnet
#

@quick granite what's line 46?

quick granite
#

this.luckPerms.getUserManager().modifyUser(Color.CMDEXE.getUniqueId(), (User user) -> {

#

]I'm trying different methods to get the player

#

Nothing is working

crystal sonnet
#

I'm not seeing that line in the code you provided

quick granite
#
Caused by: java.lang.NullPointerException
        at me.imedia.kingstona.listeners.PrefixGUIListener.onInventoryClick(PrefixGUIListener.java:48) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_231]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
crystal sonnet
#

My guess would be that the luckPerms variable is not initialized

#

You should do some basic debugging

quick granite
#

It is initialized

#

That's the full thing

#

It's so annoying how this isn't working

crystal sonnet
#

Did you check if it is null?

quick granite
#

Yeah

crystal sonnet
#

Why are you always excluding the line numbers in the screenshots?

quick granite
#

Oh I don't realise

#

There

crystal sonnet
#

Double check it's actually not null and that luckPerms.getUserManager() is not null either

quick granite
#

Ok let me try

#

NPE on luckPerms.getUserManager()

crystal sonnet
#

Then luckPerms is null

#

Like I told you

quick granite
#

I thought it wasn't

crystal sonnet
#

I wonder why I asked you to check it

quick granite
#

Then how would I not make it null? I thought it wasn't?

crystal sonnet
#

Don't initialize it to null

#

You're passing null in the constructor of the class

quick granite
#

But I'm not initializing it to null. I'm looking at the docs and I've done everything correct on there

crystal sonnet
#

Apparently not

#

How are you initializing it?

pseudo bramble
#

Also, has luckperms itself even initialized prior to you creating that listener?

quick granite
#

I'm not even sure it's my first time using this API

#

I've just been looking at the docs

crystal sonnet
#

Alright

#

Listen

#

I don't mind you not knowing stuff

#

I really don't

#

But I do have an issue when you say stuff like "I know it's properly initialized", when you don't even know how you initialize it

quick granite
#

I generally thought I did

crystal sonnet
#

Be honest and stop wasting my time

quick granite
#

Alright

crystal sonnet
#

Now how are you initializing it

quick granite
crystal sonnet
#

...

#

How are you calling that constructor

quick granite
crystal sonnet
#

How do you initialize the variable LuckPerms? and why are you casting it?

quick granite
#

It's the only way I find that worked

crystal sonnet
#

How do you initialize the variable LuckPerms?

quick granite
#

I don't I don't think

crystal sonnet
#

There's your problem

#

Also if you call it luckPerms you can actually use the type name LuckPerms instead of object

quick granite
#

I could be being stupid but it doesn't let me import it or anything

#

and yeah ik I'm stupid

crystal sonnet
#

And you really really should know Java programming before jumping into Minecraft plugins

#

Even more so working with the LuckPerms API

#

This is not a place to learn programming

quick granite
#

Yeah I know some java

#

This API is pretty hard

crystal sonnet
#

Yes

#

But that stuff isn't even API related

#

That's basic Java

quick granite
#

Yeah ik :/

crystal sonnet
#

And you need more than "some java"

#

You actually need some decent java knowledge if you don't want to spend 90% of your time debugging java "issues"

#

Only exception is if you are familiar with OOP programming already and just want to learn java on top of knowing similar languages. Then MC is a good place as it's the right difficulty I'd say

quick granite
#

Yeah when I was being taught in CS by school they did like 1 lesson on Java and the rest was python unfortunately

#

Anyway, I just tried it again and the same error

crystal sonnet
#

Did you initialize the luckPerms variable in your main class now?

#

Or are you expecting it to be initialized by some sort of magic?

quick granite
#

I did initialize it this time

crystal sonnet
#

How?

quick granite
crystal sonnet
#

I

#

I don't even know what to say anymore

#

I'm not here to teach you java

#

I mean I can tell you how to fix it

#

But then you'll get stuck on the very next tiny obstacle

#

And the one after that

#

etc

#

At this point it's not even basic Java anymore

#

This is basic programming

quick granite
#

I'll just figure it out and do some googling to find out how to initialize it and things

oak badger
#

what i found at my college was people who learned python had a lot of trouble grasping how assignments work in other languages

#

cause in python you just do something = whatever anywhere, and it just "works" which just isn't how it works for java/c/most other stuff

crystal sonnet
#

Phyton to Java (or any other C based language) is pretty hard. You practically need to start from 0

oak badger
#

correction: people who learned python first

#

yeah lol i didnt fall into that pitfall thankfully

#

i took C++ as my first course in college

#

as well as linux scripting

#

then moved on to java/python

crystal sonnet
#

Unscoped languages are one of the worst to learn first imho

oak badger
#

yeah python is a bit too loose i think, colleges are adopting it for their beginner courses because it is easier

#

but it's at a cost

crystal sonnet
#

It's not a difficult concept to learn unscoped variables. But learning scoped ones is difficult

oak badger
#

yep

crystal sonnet
#

But in this case there's no excuse. It's not even the same variable name

oak badger
#

going from python -> anything else and getting bonked on the head by type and scope

crystal sonnet
#

Also untyped languages are also a bad starting point

#

Because learning strict typing after the fact is also incredibly hard

#

So while Python does a great job at lowering the difficulty for entry into programming it raises the difficulty for learning C based languages tremendously

#

Because Python doesn't properly teach concepts

#

Just a watered down version of them

#

So you have to unlearn and relearn the properly

oak badger
#

yeah funny story is i actually didn't know any python until i actually took up a tutoring job at my college lol

#

learned it in a couple weeks and then started helping the beginners, even there i saw a lot of mistakes

crystal sonnet
#

I never made anything in it to this point

#

I just talk to a lot of people using it

oak badger
#

it's a useful tool but i wouldn't call it a go-to for a lot of things, despite being pretty easy

#

i mostly use it for scripts to automate/process things

#

not for a lot of full programs

crystal sonnet
#

I've come to the conclusion that anyone that considers it a good general purpose language and uses it as a first choice, frankly sucks at programming

#

Python is a scripting language

oak badger
#

yeah i dont think that's a terrible assumption to make

crystal sonnet
#

And that's what trips up most people

oak badger
#

of course if it's an experienced programmer and they justify why they chose python over other things, sure

crystal sonnet
#

I've yet to meet any

oak badger
#

but yeah a lot of the time it definitely feels like a lot of people "just use it" because thats what they know

crystal sonnet
#

Using Python as their go to scripting/glue language, sure

#

No problem

oak badger
#

ya

crystal sonnet
#

But not as a general purpose language

oak badger
#

as a scripting/tooling language it's great, it has a lot of nice stuff built in

#

i've used the http server module a few times, json parsing is great

#

(i wish java had built in json haha)

crystal sonnet
#

There are great libs

#

Not everything needs (or should for that matter) to be built in

oak badger
#

yeah but for scripts you dont want to build stuff from the ground up

wild whale
#

I started with java, and have started messing around with Javascript, and omg I miss inheritance and strict typing

oak badger
#

just use what is already there

#

lol js is a mess but we're stuck with it

wild whale
#

yeah fair enough lol

oak badger
#

i've tried to stay clear of it as much as possible

#

done a little web dev but i'm by no means good, at all

wild whale
#

if you want to do anything web-related though, you are pretty much forced into it

oak badger
#

ye

#

"we're stuck with it"

wild whale
#

yeah

crystal sonnet
#

I still can't believe anyone thought it was a good idea to put JS on the backend

oak badger
#

speaking of backend

#

doesnt dropbox use python for their backend

wild whale
#

what.

oak badger
#

xD

#

can't verify 100% but i heard it

crystal sonnet
#

I mean who could've seen it coming that it's a giant pile of shit made by beginners and and everything is riddled with security issues because, surprise doing backend development is actually difficult

wild whale
cold panther
#

Burn it

#

It's time to cancel dropbox

oak badger
#

hey they try to redeem themselves by saying words like "Go, TypeScript, Rust"

#

😅

crystal sonnet
#

Ah yes

#

TypeScript

#

A whole 5% more secure than pure JS

oak badger
#

of course for the 1% that isn't python, they use rust!

#

xD

cold panther
#

That was back in 2012, so they might have overhauled it since then

crystal sonnet
#

But only if everything in the project is TS

#

Else you lose that 5% right away

oak badger
#

iirc dropbox hired the designer of python?

#

if my memory is still correct

#

so idk i think they might just have a lot of python

neat jackal
#

I use JS as back-end actually, it works, I know, bad argument, but I don't need more. And what else should I use?

cold panther
#

Java, C#, etc

crystal sonnet
#

Heck even PHP is better

oak badger
#

ok so it looks like Guido left dropbox in october actually

#

he worked there for almost 7 years

#

so maybe dropbox will actually move away from python lol

wild whale
#

iirc dropbox hired the designer of python?
quick google, yes they did, until he retired in 2019

#

oop too slow

oak badger
#

yeah lol i googled it again too

crystal sonnet
#

I doubt they will

#

The language can be actual cancer

#

The cost of rewriting everything is significant

oak badger
#

hey 11 at least i didnt remember anything incorrectly

#

sometimes i just say things and they're wrong and i feel badly after

crystal sonnet
#

And that's why it's important to actually take time to pick the right tech stack when starting a project

oak badger
#

well Guido thought python was the right stack! 😛

wild whale
#

only thing I don't like about java is I can't add a eval command to my discord bot since it's a compiled lang

crystal sonnet
#

That is good

#

Believe me

oak badger
#

there's no reason you should need to do that anyway

wild whale
#

(yes, I know, eval commands are dangerous)

oak badger
#

11

crystal sonnet
#

They are not just dangerous, they are the best way to get your shit hacked

oak badger
#

you could probably still do something like make a class that gets loaded in with new commands or something

#

but yeah nothing on the fly like eval

wild whale
#

yeah that just sounds like a mess lol

crystal sonnet
#

There have been plenty of exploits where people have used evals to escape sandboxed environments

#

Just don't

neat jackal
#

There is a way I think, by doing something like parsing Java as JavaScript (here we are again) using Nashorn or something

crystal sonnet
#

Unless you want your stuff hacked

wild whale
#

tbh all I really use it for is sending messages elsewhere or dynamically querying some value

crystal sonnet
#

There's a Java interpreter

wild whale
#

also I did notice that my java bot was using considerably less ram then my clippy fork I was running for a bit, so it has that too

crystal sonnet
#

Reminds me

#

I need to make the bot for my server :/

#

My TODO list is waaaay to long xD

cold panther
#

Doesn't node use Google's V8 engine? That may explain the high ram usage xD

wild whale
#

I have a big trello list of todos and ideas lol

#

yup ryan

cold panther
#

oof

#

Though, I wouldn't be surprised if Oracle end up putting ads in Java consoles, or ask you to sign in to run an app...

wild whale
#

openjdk

crystal sonnet
#

Btw am I the only one that thinks the trend to render web sites client side is just ridiculous?

wild whale
#

I mean we're guilty of that lol

cold panther
#

If they end up putting ads/monetisation in java though, couldn't oracle just end the openjdk? I haven't really delved into the legality of openjdk

crystal sonnet
#

Here's a crazy idea: If your web stack needs to much resources instead of offloading the stuff onto the client, just use a stack that is actually resource efficient

neat jackal
#

all of luckperms.net is clientsided afaik

We try to change that, but... it takes time (and nerves, big nerves)

wild whale
#

I think turbo was looking into nuxt.js

crystal sonnet
#

@wild whale and there you have the reason why I haven't contributed a single line of actual website code, even though I made the editor v1.1

wild whale
#

LOL fair enough

crystal sonnet
#

And even if it's fully server side, I still won't

#

Because I have standards

neat jackal
#

And these standards are?

crystal sonnet
#

As little JS as possible

#

I've honestly considered working on a WASM version if the editor

#

That stuff is awesome

#

NGL

#

The only thing that makes me sad about it is that more people will start abusing the browser as their front end for things that should be actual programs

neat jackal
#

Hey, PWAs are coming too

crystal sonnet
#

RIP

wild whale
#

Why not just make the editor an electron app 😛

crystal sonnet
#

Do you want to get punched or something?

wild whale
#

lol sarcasm

crystal sonnet
#

Good

#

Btw this platform is a great example why electron apps suck

#

Before anyone asks:
You can easily shave off 95% of loading times and app size by turning this into a native app that's not 99% framework

jaunty pecan
#

yeah but where's the fun in that?!

neat jackal
#

The fun of spending hours because everything is @#$%€*&+ complicated

wicked kiln
#

How do i give a player permissions

neat jackal
#

!api explained there, with 5.1 there may be a better method, let me check

frank driftBOT
neat jackal
#

Nope, not really

wicked kiln
#

i can't find where i give them there permissions

rustic laurel
#

Are you wanting to do this with the developer API or just ingame

wicked kiln
#

Developer api

rustic laurel
#

Yeah it's definitely there

#

Second link

wicked kiln
#

Still don't see it

neat jackal
#

Modifying user/group data

wicked kiln
#

Do i need to save it?

neat jackal
#

Yes, UserManager#saveUser

wicked kiln
#

Wait do i need the begging part of it DataMutateResult result = user.data().add(Node.builder("Contie").build());

#

like DataMutateResult result

neat jackal
#

You can leave that out

wicked kiln
#

When would i use it?

neat jackal
#

You can also do like api.getUserManager().modifyUser(player.getUniqueId(), (User user) -> user.data().add(Node.builder("Contie").build())); in newer version

#

And you would want the result if you want to do something with the result

cunning zenith
#

Hello. I am currently trying to update a really old plugin of mine from Pex to LuckPerms. It basically gets the users from a called group (Admin for example) and displays all users of that rank a /staff list against that rank.

The old pex system had getUsersInGroup, What would be the best way to do this with LuckPerms? Would it be the obtaining a group instance and then list the members from that group?

wicked kiln
#

Tobi what would i do with it though

neat jackal
#

There's DataMutateResult#wasSuccessful, so I guess you can do check if it was successful

wicked kiln
#

hmm that sounds very intreasting

sharp birch
#

Hey,
How can I add/remove a Parent to a user ??

rustic laurel
#

with the Luckperms API?

#

It's explained here:

#

!api

frank driftBOT
sharp birch
#

sry but I can't find it

rustic laurel
sharp birch
#

and by your.node.here the group

rustic laurel
#

InheritanceNode i believe

sharp birch
#

thx

naive imp
#
public CompletableFuture<Boolean> isAdmin(UUID who) {
    return luckPerms.getUserManager().loadUser(who)
            .thenApplyAsync(user -> user.inheritsGroup("admin")); // again, inheritsGroup is not a real method, just used as an example
}```
Would user.getCachedData() work here if the player is offline?
naive imp
#

If not - how would I get the prefix of a player who is offline?

cold panther
#

@naive imp Yes that should work since UserManager#loadUser loads the user into the cache

naive imp
#

Alright cheers ryan.

slim willow
#

hello

#

anyone can help me ?

#

i made this litile thing

#

but the command is not working

#

how i can fix it ?

#

any help?

naive imp
#

There's no command with group, it's parent.

#

It's probably better practice to do this through the API also.

slim willow
#

can you help me do it ?

#

i just want 1 example

#

give player a temp rank with api .

#

tried but could'nt do it xd

polar walrus
#

I need help I want to display a players rank in the scoreboard on the right how do I do that?

slim willow
#

are you custom scoreboard?

polar walrus
#

making my own plugin

slim willow
#

oh

#

i used this

#

LuckPermsApi api = LuckPerms.getApi();
        User user = api.getUser(p.getUniqueId());
        Group owner = api.getGroup("owner");
        Group member = api.getGroup("member");
        Group gold = api.getGroup("gold");
        Group diamond = api.getGroup("diamond");
        Group war = api.getGroup("war");
        Group youtuber = api.getGroup("youtuber");
        Group fr = api.getGroup("friend");
        Group helper = api.getGroup("helper");
        Group ha = api.getGroup("ha");
        Group mod = api.getGroup("mod");
        Group srmod = api.getGroup("srmod");
        Group admin = api.getGroup("admin");
        Group co = api.getGroup("co");
polar walrus
#

so with this you get the online / local info about that group

#

/ rank

slim willow
#

yes

polar walrus
#

and how can I display there rank / prefix in the scoreboard

slim willow
#

i used it

#

in chat

#

idk about that ,-,

polar walrus
#

because I want it only to show that prefix

#

/ name of rank

slim willow
#

hmm idk xD

polar walrus
#

hahahah don't wurry

#

I am now working almost 3 days on this thing but nothing works

#

But do you know how to display the time and date on the scoreboard

rustic laurel
#

It's probably easiest to do everything you're looking to do, with PlaceholderAPI and a compatible scoreboard plugin - it's so much smoother and easier, and allows for a lot of options a lot quicker, without you having to add stuff to your own plugin

polar walrus
#

so you say just take that 2 plugins

#

and not making a own one

rustic laurel
#

pretty much yeah

#

especially when they're optimised and well made

#

the number of them matter less than the code

polar walrus
#

Well the server I am running has 41 plugins now and we want to optimise that plugin count so instat of 41 we want like 20. What we are doing now is putting plugins together only I don't know how to inport a luckperms prefix/rankname in a plugin. (And yea luckperms is added to the libbary)

#

beacose we are running les plugins and on a MySQL server and the performance will go up

#

well no one that can help me with this?

#

not about the plugin but about the luckperms prefix in TAB an scoreboard on the right baybe even in chat if that is possible

cold panther
#

Do you need help getting someone's prefix and primary group?

polar walrus
#

That I have

#

I am making a plugin that show a scoreboard on the right

#

There a a fuwe things that are cutom made that have to shown in that scoreboard becauso of this I can't use a existing plugin

#

and now I am stuch with the probem: How can I show the players rank in the scoreboard on the right

#

rank = prefix | prefix = rank

#

so they are both the same

cold panther
#

I personally can only help with the LuckPerms API rather than displaying it on the scoreboard. I've never used the scoreboard API, so you'd be better off asking on the spigot forums/spigot discord

polar walrus
#

well can you send me a invite to the discord server?

cold panther
slim willow
#

what about my problem?

#

its not working the command is not working .

cold panther
#

@slim willow If you're not using API 5, then I can't provide you with an example of how to add a temp group with the API since we nolonger support it. If you're using the command dispatcher, try "lp user " + p.getName() + " parent addtemp gold 5d"

#

if it doesn't work, you should at least see some output in console you can use to see why

polar walrus
#

But @obtuse jolt how do I get the prefix

frank driftBOT
#

Hey Greazi times around here! Please don't tag helpful/staff members directly.

polar walrus
#

Well that was not my intension to @ you

obtuse jolt
#

!api im also not familiar with the api side of lp

frank driftBOT
polar walrus
#

well than I will look in to it 🧐

#

I found it but Somhow it does not know metaData

cold panther
#

CachedMetaData metaData = this.luckPerms.getPlayerAdapter(Player.class).getMetaData(player);where player is a Player object

polar walrus
#

so with Player I don't have to do any thing

#

ore do I have to change it to my player so my Player player = object.

#

so to the player?

#

lol