Описание
# RealPermissions
### *GUI Permission Management made easy.*
Ranks, permissions, timed ranks, tracks and rankups, managed from a GUI or with commands.
**[Discord](https://discord.gg/SK7M7f2YkV)** | **[Source Code](https://github.com/joserodpt/RealPermissions)** | **[Report a Bug](https://github.com/joserodpt/RealPermissions/issues)**
---
## What is RealPermissions?
**RealPermissions** is a permissions plugin you can run almost entirely from a GUI. Players get a **rank**, ranks get permissions and can inherit other ranks, and each rank has its own prefix and chat format. On top of that you can give a player permissions of their own, hand out ranks and permissions for a limited time, move players along rank tracks, and let players buy their next rank with `/rankup`.
## Features
- **GUI for everything**: players, ranks, permissions, rankups and settings
- **Permission inheritance** between ranks
- **Negated permissions** (a node starting with `-`) and **wildcards** (a node ending in `*`)
- **Per-player permissions**, on top of the player's rank
- **Timed ranks** and **timed player permissions** (e.g. `30m`, `12h`, `7d`, `1d12h`)
- **Prefix and chat format per rank**
- **Prefix in the tab list**, and the tab list **sorted by rank weight**
- **Tracks**: promote and demote players along an order of ranks, with a permission per track
- **Rankup**: players pay through Vault to move up a rankup path
- **`/rp check`** explains where a player's permission comes from (their own, their rank, an inherited rank, a wildcard, super user, op or another plugin)
- **Permissions of other plugins** are read from their `plugin.yml`, so you can pick them from a list instead of typing them
- **Native integration** with RealScoreboard, RealMines, RealRegions, RealSkywars, RealHoppers and RealLogin through the RealPermissions API
- **Vault permission and chat provider**, so other plugins see your ranks, permissions and prefixes
- **Import** from LuckPerms, PermissionsEx and GroupManager
- On 1.21.6+, **native dialogs** for typed input, settings and confirmations (uses chat on older versions)
- **SQLite and MySQL** storage for player data
- **PlaceholderAPI** placeholders
- Fully configurable **YAML** config, ranks, rankups and language files
## Ranks
Ranks live in `ranks.yml`. Each rank has an icon, a prefix, a chat format, the ranks it inherits from and its own permissions. New players get the `Default-Rank`.
Rank example and options
```yaml
Default-Rank: Player
Ranks:
VIP:
Icon: IRON_INGOT
Prefix: "&9VIP"
Chat: "%prefix% %player% &7- &f%message%"
Inheritance:
- Player
Permissions:
- essentials.afk
- -essentials.fly
```
| Option | What it does |
|---|---|
| `Chat` | The chat format, with `%prefix%`, `%player%` and `%message%`. Turn it off with `Chat-Formatting` in `config.yml`. |
| `Inheritance` | The rank gets every permission of the ranks listed here. |
| `Permissions` | A node starting with `-` is taken away; a node ending in `*` gives everything under it. |
| `Weight` (optional) | Higher sorts first in the tab list. Without one, the weight is how many ranks it inherits from. Set it with `/rp setweight`. |
## Tracks
A track is an order of ranks, lowest first, set in `ranks.yml` or with `/rp settrack`. `/rp promote ` and `/rp demote ` move a player one rank up or down it. Staff with `realpermissions.track.` can use these on that one track, without being able to hand out any other rank. A player with a timed rank can't be moved until it runs out or is cleared.
## Rankup
Rankups live in `rankup.yml` and need Vault with an economy plugin. A rankup is a path of ranks, each with a cost, and the first one costs 0. A player opens `/rankup`, picks a path and pays to move to the next rank on it. A rankup can have a `Permission`, so only some players see it. Rankups can also be added, edited and removed from the GUI.
Rankup example
```yaml
Rankups:
VIPRankup:
Display-Name: "&bVIP &bRankup"
Icon: FILLED_MAP
Permission: RealPermissions.Rankup.VIPRankup
Description:
- '&fThis is a rankup exclusive for &bVIPs'
Entries:
- VIP=0
- VIP+=100000
- VIPPro=3000000
```
## Super Users
A **super user** is a player set from the console with `/rp setsuper `. Super users get `realpermissions.admin` and are the only players who can run the commands that change ranks and permissions in game (set a rank, timed ranks, add or remove permissions, delete a rank, manage tracks, import). The console can always run them.
## Photos





## Getting Started
1. From the console, make yourself a super user: `/rp setsuper `.
2. Run `/rp` in game to open the GUI.
3. Open **Ranks** to add ranks, change their prefix and icon, and add permissions. Permissions from your other plugins can be picked from a list.
4. Give a player a rank with `/rp setrank `, or from **Players** in the GUI.
5. To let players buy ranks, install Vault and an economy plugin, and set up the paths in `rankup.yml` or in the GUI.
6. Coming from another permissions plugin? Run `/rp import ` to see what would be imported, then add `confirm`.
## Commands
Base commands: `/realpermissions`, `/rp`. All need `realpermissions.admin` unless said otherwise. "Super user" means a player must also be a super user; the console can always run it.
| Command | Alias | Description | Who |
|---|---|---|---|
| `/rp` | | Opens the GUI (in the console, shows plugin info) | Admin |
| `/rp reload` | `rl` | Reloads the config, language, ranks and rankups | Admin |
| `/rp setrank ` | `sr` | Sets a player's rank | Super user |
| `/rp permission ` | `perm` | Changes a rank's permissions | Super user |
| `/rp playerperm [duration]` | `pperm` | Changes a player's own permissions, for a time if a duration is given | Super user |
| `/rp check ` | `c` | Says whether the player has it, and why | Admin |
| `/rankup` | `/rk` | Opens the rankups | `realpermissions.rankup` |
All commands
| Command | Alias | Description | Who |
|---|---|---|---|
| `/rp settings` | | Opens the settings | Admin |
| `/rp rank ` | `r` | Opens a rank's editor | Admin |
| `/rp ranks` | | Opens the ranks list (in the console, lists the ranks) | Admin |
| `/rp players` | `plrs` | Opens the players list | Admin |
| `/rp player ` | `p` | Opens a player's permissions | Admin |
| `/rp setsuper ` | `setsu` | Turns super user on or off | Console only |
| `/rp settimedrank ` | `str` | Gives a rank for a time; the old one comes back when it runs out | Super user |
| `/rp cleartimedrank ` | `ctr` | Ends a timed rank | Super user |
| `/rp rename ` | `ren` | Renames a rank | Admin |
| `/rp delete ` | `del` | Deletes a rank, except the default one | Super user |
| `/rp setweight ` | `sw` | Sets the rank's tab list weight | Admin |
| `/rp tracks` | | Lists the tracks | Admin |
| `/rp settrack [rank...]` | `st` | Creates or replaces a track | Super user |
| `/rp deltrack ` | `dt` | Deletes a track | Super user |
| `/rp promote ` | | Moves a player one rank up a track | Super user or `realpermissions.track.` |
| `/rp demote ` | | Moves a player one rank down a track | Super user or `realpermissions.track.` |
| `/rp import [confirm]` | | Shows what would be imported, and imports it with `confirm`. For LuckPerms, run `/lp export` first | Super user |
| `/rp hooks` | `hks` | Shows the plugins whose permissions RealPermissions knows | Admin |
| `/rp hook ` | `hk` | Opens one plugin's permissions | Admin |
## Permissions
| Permission | Description |
|---|---|
| `realpermissions.admin` | The `/rp` commands and the GUI |
| `realpermissions.rankup` | The `/rankup` command |
| `realpermissions.track.` | `/rp promote` and `/rp demote` on that track |
| A rankup's own `Permission` from `rankup.yml` | Can see that rankup. Rankups made in the GUI use `realpermissions.rankup.`. |
## Placeholders
Requires [PlaceholderAPI](https://modrinth.com/plugin/placeholderapi).
| Placeholder | Value |
|---|---|
| `%realpermissions_rank_name%` | The player's rank name |
| `%realpermissions_rank_prefix%` | The player's rank prefix |
| `%realpermissions_rank_permission_count%` | Number of permissions the rank has |
| `%realpermissions_timed_rank_time_left%` | Seconds left on the timed rank, or `none` |
| `%realpermissions_player_permission_count%` | Number of permissions given to the player directly |
## Requirements
- Java **16+**
- *Optional:* [Vault](https://www.spigotmc.org/resources/34315/) (needed for rankup, together with an economy plugin, and to be Vault's permission and chat provider), [PlaceholderAPI](https://modrinth.com/plugin/placeholderapi)
## Installation
1. Put the jar in your `plugins` folder.
2. Restart the server.
3. Edit `plugins/RealPermissions/ranks.yml` (or use the GUI) and run `/rp reload`.
4. For MySQL, set it in `plugins/RealPermissions/sql.yml` and restart.
---
### Need help or found a bug?
Please don't use the comments for bug reports. Get in touch through:
**[Discord](https://discord.gg/SK7M7f2YkV)** | **[GitHub Issues](https://github.com/joserodpt/RealPermissions/issues)**
*This plugin uses bStats to collect anonymous usage statistics. You can turn this off in `plugins/bStats/config.yml`.*