Prisons
No funciona (falla al cargar) — Could not load plugin 'Prisons_2.1.0.phar': Invalid plugin manifest: Invalid Plugin "permissions": Nested permission declarations are no longer supported. Declare each permission separately. · Probado en PocketMine-MP 5.50.0 (PHP 8.4.27).
Prisons
A pocketmine plugin implementing the legacy prison rank up system in addition to a form of prestiging.
How to install
-
Download the phar here.
-
Add it to your servers 'plugins' directory.
-
Restart your server.
Features
-
Custom events for prestiging and ranking up.
-
Add permissions, remove permissions and run commands when ranking up and prestiging via the config.
-
Chat formatting via purechat.
-
A scorehud addon for the new version of scorehud.
-
Written in libasyncsql in order to improve performance.
-
Compatible with both sqlite3 and mysql.
Commands
- /prestige - Reset your rank and multiply your rank up price by a specified amount.
- /rankup - Rank up to the next rank.
Permissions
prisons.*: default: op description: Allows access to all prison commands. children: prisons.rankup: default: true description: Allows user to use /rankup. prisons.prestige: default: true description: Allows players to use /prestige. prisons.nomine.bypass: default: op description: Allows players to mine/place blocks in areas that are not mine areas.
Addons/Dependencies
Pureperms, Minereset and EconomyAPI are required for this plugin to operate.
Scorehud and PrisonScore and required if you wish to implement scorehud tags.
Purechat is required if you wish to implement a players rank and prestige into your chat format, use {PRISON_RANK} for the players prison rank and {PRISON_PRESTIGE} for their prestige.
API
-
Version 2.0 of prisons has been written in a libasyncsql in order to reduce lag and align with poggit standards hopefully reducing stress on the main thread.
-
Prisons now runs using custom player classes of some sort and also an event based system.
Here's an example of me getting and setting the prestige and rank of a player.
getPlayerManager()->getPlayer($player) jQuery3210171210030165728_1619076280935 null; } public function getPrisonRank(PrisonPlayer $player) : ?string { return $player->getPrisonRank() jQuery32109215162156046481_1619852217003 null; // returns the prison rank of a player e.g 'a'. } public function setPrisonRank(PrisonPlayer $player, string $rank) : void { $player->setPrisonRank($rank); // sets the prison rank to whatever '$rank' is } public function getPrestige(PrisonPlayer $player) : ?int { return $player->getPrestige() ?? null; // returns the prestige of a player, by default this is 0. } public function setPrestige(PrisonPlayer $player, int $prestige) : void { $player->setPrestige($prestige); // sets a players prestige to whatever '$prestige' is. } } Keep in mind that none of those functions are implemented into this plugin, you create them yourself. - In addition to that we have created some cancellable events you can listen for when players rank up and prestige. getPlayer(); // returns a 'Player' instance, not a 'PrisonPlayer' instance. $currentRank = $event->getCurrentRank(); // returns a string representing the current rank of a player. $newRank = $event->getNewRank(); // returns a string representing what the players rank will be set to when the event executes. $addedperms = $event->getAddedPermissions(); // returns a string array representing all added permissions for the specific rankup. $removedperms = $event->getRemovedPermissions(); // returns a string array representing all removed permissions for the specific rankup. $commands = $event->getCommands(); // returns a string array of all commands ran during rankup. $event->setAddedPermissions(["prisons.*"]); // sets the added permissions for that specific players rankup to 'prisons.*', you can specify multiple. $event->setRemovedPermissions(["prisons.prestige"]); // sets the removed permissions for that specific players rankup to 'prisons.prestige'. $event->setCommands(["say {PLAYER} has ranked up to {$newRank!"}]); // within all commands use {PLAYER} to represent the player in the event. } public function onPrestige(PrisonPrestigeEvent $event) { $player = $event->getPlayer(); // returns a 'Player' instance, not a 'PrisonPlayer' instance. $currentPrestige = $event->getCurrentPrestige; // returns an int representing the current prestige of a player. $newPrestige = $event->getNewPrestige(); // returns an int representing what the players prestige will be set to when the event executes. $addedperms = $event->getAddedPermissions(); // returns a string array representing all added permissions for the specific prestige. $removedperms = $event->getRemovedPermissions(); // returns a string array representing all removed permissions for the specific prestige. $commands = $event->getCommands(); // returns a string array of all commands ran during prestige. $event->setAddedPermissions(["prisons.*"]); // sets the added permissions for that specific players prestige to 'prisons.*', you can specify multiple. $event->setRemovedPermissions(["prisons.prestige"]); // sets the removed permissions for that specific players prestige to 'prisons.prestige'. $event->setCommands(["say {PLAYER} has prestiged to {$newPrestige!"}]); // within all commands use {PLAYER} to represent the player in the event. } } Support Contact me on discord TPE#1061 if you have any further queries related to this plugin.