Skip to content

ClickedTran/libRanks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libRanks

libRanks is a virion for easy support of multiple rank providers.
Take a look at the wiki to learn more about how virions work.

Supported Providers

Usage

Setup

libRanks::init()

Using Ranks Providers

libRanks::getProvider($providerInformation)

$providerInformation is an array with the key provider.

Give Rank To Player

RankProvider::giveRank(Player|string $player, string $rank, ?callable $callback = null)

Get Rank From Player

RankProvider::getRank(Player|string $player, ?callable $callback = null)

Remove Player's Rank

RankProvider::removeRank(Player|string $player, string $rank, ?callable $callback = null)

Get Rank In Data

RankProvider::getRankData(string $rank, ?callable $callback = null)

Get Player's Permission

RankProvider::getPlayerPermission(Player|string $player, ?callable $callback = null)

Set Permission For Player

RankProvider::setPlayerPermission(Player|string $player, string $permission, ?callable $callback = null)

Remove Permission From Player

RankProvider::unsetPlayerPermission(Player|string $player, string $permission, ?callable $callback = null)

Error Handling

There are several exceptions that can be thrown that you may want to handle in your plugin:

  • MissingProviderDependencyException
  • UnknownProviderException

Examples

config.yml

rank:
  provider: ranksystem

ExamplePlugin.php

class ExamplePlugin extends PluginBase{
    public $rankProvider;
    
    public function onEnable(): void{
        $this->saveDefaultConfig();
        libRanks::init();
        $this->rankProvider = libRanks::getProvider($this->getConfig()->get("rank"));
    }
}

If you usage poggit to build your repo, you can add it to .poggit.yml file

projects:
 YourPlugin:
  libs:
   - src: ClickedTran/libRanks/libRanks
     version: ^1.0.0

Plugins used:

NOTE

  • If you find this lib similar to a certain lib, then you are right, I made this lib based on DaPigGuy's libPiggyEconomy
  • Thank for you reading note

CONTACT

FACEBOOK DISCORD
discord

About

This is a virion that supports a variety of rank plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages