elBukkit / PreciousStones

Self-service protection for Minecraft servers
http://dev.bukkit.org/server-mods/preciousstones/
10 stars 10 forks source link

Add "untoggleable" flags #140

Open FireController1847 opened 2 years ago

FireController1847 commented 2 years ago

It'd be really nice to specify which flags the user is allowed to toggle and which ones they aren't, so I was wondering if it would be possible to add "untoggleable" flags. Similar to how "toggleable" flags work by adding a "?" in front of the flag name, I was thinking if we made it so putting a "+" in front of the flag name, it would prevent the user from being able to toggle that flag (meaning it'd either always be enabled or disabled).

An example of how the + modifier could work:

my-block:
- block: redstone_block
  radius: 10
  prevent-fire: true
  prevent-flow: true
  prevent-place: true
  prevent-destroy: true
  +welcome-message: true
  +farewell-message: true

And then if a player tried this:

Command: /ps toggle welcome-message
Response: "Sorry, you don't have permission to toggle this flag!"

I may take a shot at adding this at some point in the future if I get time, but if anyone is able to get to it before me, go for it! :)

xtomyserrax commented 2 years ago

Hey, how are you? It seems to be a really nice idea in case it doesnt exist actually. If anyone has the time and is willing to add it, great!

What if instead of a "+" its a "!" ??

FireController1847 commented 2 years ago

I'm totally down for the exclamation mark! I was just choosing a character at random to be honest, I think your suggestion represents it very well