Zrips / Jobs

Jobs
Apache License 2.0
172 stars 213 forks source link

Built-in JobsReborn ranks & permissions #1373

Open ProfessionalBoatDrifter opened 2 years ago

ProfessionalBoatDrifter commented 2 years ago

Description of new idea or improvement on existing one

Add the ability to create custom profession ranks with permission nodes.

Detailed information what should do

We should be able to arbitrarily define various ranks within professions (e.g. "Novice" is Levels 1-20) that allow us to assign them permissions.

The premise is similar to TownyAdvanced where you can assign permission nodes to ranks. The difference is that Jobs would work on a level basis (based on what we configure) and allow players to unlock new crafting recipes or other perks as they level up.

This way, Jobs can become an integral part in unlocking or improving certain in-game actions, such as unlocking new crafting recipes.

Reference and config example

https://github.com/TownyAdvanced/Towny/wiki/Default-Townyperms.yml

As you can see in this reference, TownyAdvanced allows you to add or remove permissions from town ranks. Jobs and Towny are of course different plugins with different goals so the actual config would look a little different.

Here's my example of what a Jobs ranks config could look like using "jobRanks.yml":

ranks:
  settings: # QoL settings
    # inheritPermissions is optional to this feature request. If it comes down to a default system, I personally prefer making it so you need to define permissions for each rank. 
    inheritPermissions: false # Do higher level ranks inherit lower rank permissions? True = take into consideration all lower permissions. False = only return player's current rank permissions.
  Brewer:
    Novice:
      Level: 1-10 # Supports level range
      Permission: [] # Requires a plugin that can handle permissions, such as LuckPerms.
    Apprentice:
      Level: 11-20
      Permission:
      - jobs.boost.brewer.exp.0.05
    Initiate:
      Level: 21-40
      Permission:
      - jobs.boost.brewer.exp.0.075
    Journeyman:
      Level: 41-60
      Permission:
      - jobs.boost.brewer.exp.0.1
      - new.recipe.permission
    Adept:
      Level: 61-80
      Permission:
      - jobs.boost.brewer.exp.0.125
    Master:
      Level: 81-99
      Permission:
      - jobs.boost.brewer.exp.0.15
    Grandmaster:
      Level: 100 # Also supports single levels
      Permission:
      - jobs.boost.brewer.money.0.25
      - -new.recipe.permission # Supports denied permissions. Not sure how this works in LuckPerms with true/false settings.
      - anothernew.recipe.permission
Zrips commented 2 years ago

You do have option to set titles based on jobs level while at same time there is option to trigger commands when player reaches specific levels, so you could give access to those permission nodes when player reaches level

ProfessionalBoatDrifter commented 2 years ago

While running commands based on titles are nice for announcements (which we have set) I think having a configurable, built-in permission manager is better to manage different profession levels. It's a lot more tedious work to run commands for setting and unsetting permissions (especially if players can drop levels and if permissions change).

I fully believe that this change is beneficial for the vast majority of servers running Jobs and are looking for a dynamic way of unlocking content by progression :)