SimpleClans

SimpleClans

467k Downloads

Request: Supporting GriefPrevention

TomLewis opened this issue ยท 31 comments

commented

Can you please support GriefPrevention, to trust/untrust/accesstrust your entire clan to a claim.
it would literally just need to send the list of people in your clan to GriefPrevention with the corresponding parameter.

commented

GP support giving trust to permissions groups, and simpleclans gives every clan member a permission. Therefore you can use "/trust clan.TAG", tag being the tag of the clan you want to give trust. Then everyone in that clan will have trust.

commented

I fully understand the technically, what you are not understanding is this is not straight forward for players, this is not intuitive. I do not call my "clans" clans, mine are called crews, using the word "crew" does not make sence at all on my server. Since its already supported, it would be very simple to have an INTUITIVE EASY TO UNDERSTAND method for PLAYERS to trust their crews. players should not have to understand how permission nodes work, the whole reason griefprevetion works is that its incredibly simple, start trying to explain using permission nodes makes it complex, as I have already said, please read the message I already wrote; It would be very easy to implement a PROPER use of this already working feature, one that does not require a player to understand permission nodes, one that does not require a user to use a word that has nothing to do with the server "clan". we do not use that word.

commented

Alright,
So your problem is pretty much that you want to change clan to crew. The "/trust clan/crew.TAG" works really well and make sense for players that know GP. I know because I use this on my own server. People can for instance give trust to allied clans as long as they know the TAG.

Now back to the crew vs clan thing:
If you have any experience with programming I suppose you can make a fork and then search for ("clan.") (including the """) in this https://github.com/marcelo-mason/SimpleClans/blob/0f561ed0f265853dc7822adc80d859c6f5b89709/src/main/java/net/sacredlabyrinth/phaed/simpleclans/managers/PermissionsManager.java

It should look something like this:
permission.playerAddGroup(cp.toPlayer(), "clan." + cp.getTag());

and ether replace it with crew, or make a variable that get its information from wherever you replaced clan with crew.

commented

btw I think the function for getting the clan alias registered in the config is something like this;
getSettingsManager().getCommandClan()

If you or someone else make a fork that support this function then maybe the author would consider adding it to the project.

commented

Interesting, this would make it very easy to implement into SimpleClans then!
/trust clantag
or /clan trust /clan accesstrust

commented

I dont know if you understood me, this already work. I use it on my server.
If you check the permissions of a clan member you will see that he has a permission called clan.TAG.

So if your clan tag is called "RED", then you type "/trust clan.red", then everyone in that clan named red will have trust in that claim.

commented

Fantastic, thank you very much. my Java is terrible but I will pas this message on to a developer that knows what they are doing. The way I was thinking of seeing if I could do it with an alias in commands.yml probily no possible.

commented

Solution that does not involve forking:

@EventHandler
public void onCommand(PlayerCommandPreprocessEvent event) {
    if (event.getMessage().startsWith("/trust crew.")) {
        event.setMessage(event.getMessage().replace("crew", "clan"));
    }
}
commented

Is there no way to do this with just the crew/clan name? as opposed to players having to use a permission?
Im not sure what I would be using that code snippet for? seems like its just replacing /trust crew with trust clan? Im sure I could do that in chatcontrol wtih regex.
Could we not just get GriefPrevention support?
If not maybe I can just somehow prefix the clan. using regex in chatcontrol.

commented

Update, I just tried this with some players they did /trust clan.apple, the crew tag is apple. it did not work, but it displays that its trusted in GP by putting it in brackets.
I checked my config.yml and apple is listed under the permissions section

permissions:
  auto-group-groupname: false
  YourClanNameHere:
  - test.permission
  pr: []
  tdr: []
  poop: []
  tee: []
  cubi: []
  exi: []
  fire: []
  bros: []
  beer: []
  nova: []
  theh: []
  '14': []
  bbb: []
  chaos: []
  ae: []
  plyn: []
  night: []
  tiger: []
  pack: []
  ao: []
  ap: []
  seas: []
  rd: []
  solis: []
  grog: []
  re: []
  rf: []
  cove: []
  dawn: []
  orgn: []
  wind: []
  dean: []
  frej: []
  bd: []
  be: []
  bucks: []
  endkt: []
  nkc: []
  bl: []
  dead: []
  twp: []
  arson: []
  pent: []
  sd: []
  seb: []
  se: []
  sh: []
  silv: []
  gnd: []
  ire: []
  raids: []
  sp: []
  cb: []
  elves: []
  cc: []
  ce: []
  wolf: []
  cl: []
  union: []
  blood: []
  tc: []
  utror: []
  tg: []
  tm: []
  eka: []
  river: []
  god: []
  '42': []
  tr: []
  dc: []
  ts: []
  13c: []
  ace: []
  df: []
  kobo: []
  sum41: []
  tpbay: []
  ice: []
  apple: []
commented

I will look into it

commented

Im not sure what I would be using that code snippet for? seems like its just replacing /trust crew with trust clan?

You said you use "crew" instead of "clan".
So this would replace /trust crew.CLANTAG with /trust clan.CLANTAG
This way it would not confuse your players about the word "clan".

commented

Sadly, even just testing what @erik1988 said to do didn't work, players added the correct permission node and it didn't allow for others to build/break when trusted.
Which is a shame.

commented

settings.enable-auto-groups
Try enabling this

commented

Let me know if it works

commented

@RoinujNosde any luck with this? It would be awesome if a permission was auto given to each crew, I think the issue may be that there blank? cl: [] I assume that space is to auto set a permission to a crew? Im not even entirely sure the permission trust works with griefprevention?

commented

I enabled settings.enable-auto-groups, but im not sure whats its done/doing? I think I tracked it down to:


Is this adding a permission to each player? say into their luckperms?

I also enabled permissions.auto-group-groupname but I cant see that populating the permission into the config for each crew either?

commented

Is this adding a permission to each player? say into their luckperms?

No, it's adding the player to a group.
If the clan tag is "kol", the group name is "clan.kol".
You probably use groups on your server: admin, mod, member, etc.

So if you use /trust clan.kol, GP will allow access for players in that group.

I also enabled permissions.auto-group-groupname but I cant see that populating the permission into the config for each crew either?

This config works almost like the other one. But instead of adding the player to a group, it adds a permission "group.kol".

Neither option populates the config, that's a way to give permissions to clans. Example:

permissions:
    kol:
    - essentials.home
commented

gets super excited!

Edit:
wait, is this feature only available in the 1.13 build?

commented

@FrozenBeard Nope, you can still use it in the previous version. This was already implemented, the only thing I did was document it.

commented

oh awesome! so for 1.12.2 I need to use 2.7.23?

commented

Yes.

commented

When doing /trust group.tag, are you updating ALL of that players claims with trust?
Im at work and pushed this with the fixed SQL, and the user that was testing it reported that ALL her claims trusts were given to the crew she did! Quite a major bug there lol
Their crew tag is XD:
/Trust group.XD when she was doing /trustlist on her other claims she did not execute this trust in, all of them had this new crew trust! Is this how it was designed? if so the logic is broken here! It should only be for that specific claim they are trusting/access/container in.

commented

GriefPrevention handles the commands.
SimpleClans is only giving the permission node group.<tag>.

commented

I will do some testing myself.

commented

The player probably used the trust command outside her claim.

commented

I just tested this myself and it seems to work as intended, but Im wondering how she managed to get all her claims with that permission on them, I've never been aware of such mechanics, is that a thing? Adding a trust outside a claim does it on all claims? Now I have to test that!

commented

is that a thing?

Yep, I just checked GP's code.

commented

Jesus I've been using GP for about 5-6 years and never knew this mechanic existed! What! That explains so many things! Thanks man.
This is going to absolutely change how things work, this now means I can have a plugin like BattleArena put everyone in group.tag into one team and group.tag2 into another team, then award the winning team a claim =D

Im going to try and find as many ways to use this group.tag haha

commented

Have fun!

(Btw, I updated that timings issue you opened)