mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
Add Restriction Interface
This commit is contained in:
parent
3e12a41a91
commit
c4ba06b58c
1 changed files with 9 additions and 2 deletions
|
|
@ -156,10 +156,17 @@ class PlayerPermissions implements ArrayAccess
|
||||||
//Thinking of doing $player->permissions[] = new EventRestriction("player.move");
|
//Thinking of doing $player->permissions[] = new EventRestriction("player.move");
|
||||||
//$player->permissions->apply(new EventRestriction("player.move"));
|
//$player->permissions->apply(new EventRestriction("player.move"));
|
||||||
|
|
||||||
|
interface Restriction
|
||||||
|
{
|
||||||
|
public function __construct($restriction);
|
||||||
|
|
||||||
|
public function __toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EventRestriction
|
* Class EventRestriction
|
||||||
*/
|
*/
|
||||||
class EventRestriction
|
class EventRestriction implements Restriction
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string $event
|
* @var string $event
|
||||||
|
|
@ -186,7 +193,7 @@ class EventRestriction
|
||||||
/**
|
/**
|
||||||
* Class CommandRestriction
|
* Class CommandRestriction
|
||||||
*/
|
*/
|
||||||
class CommandRestriction
|
class CommandRestriction implements Restriction
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string $command
|
* @var string $command
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue