mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
Added permission for emoting
This commit is contained in:
parent
0bbd4af496
commit
ac1e70cd96
@ -91,6 +91,7 @@ final class DefaultPermissionNames{
|
||||
public const GAME_BLOCK_MINE = "pocketmine.game.block.mine";
|
||||
public const GAME_BLOCK_PLACE = "pocketmine.game.block.place";
|
||||
public const GAME_CHAT = "pocketmine.game.chat";
|
||||
public const GAME_EMOTE = "pocketmine.game.emote";
|
||||
public const GAME_ENTITY_ATTACK = "pocketmine.game.entity.attack";
|
||||
public const GAME_ENTITY_INTERACT = "pocketmine.game.entity.interact";
|
||||
public const GAME_FLIGHT = "pocketmine.game.flight";
|
||||
|
@ -116,6 +116,7 @@ abstract class DefaultPermissions{
|
||||
self::registerPermission(new Permission(Names::COMMAND_XP_SELF, l10n::pocketmine_permission_command_xp_self()), [$operatorRoot]);
|
||||
|
||||
self::registerPermission(new Permission(Names::GAME_CHAT, "Allows the user to chat"), [$everyoneRoot]);
|
||||
self::registerPermission(new Permission(Names::GAME_EMOTE, "Allows the user to emote"), [$everyoneRoot]);
|
||||
|
||||
$survivalRoot = self::registerPermission(new Permission(Names::GROUP_GAMEMODE_SURVIVAL));
|
||||
$creativeRoot = self::registerPermission(new Permission(Names::GROUP_GAMEMODE_CREATIVE));
|
||||
|
@ -2067,6 +2067,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
if($currentTick - $this->lastEmoteTick > 5){
|
||||
$this->lastEmoteTick = $currentTick;
|
||||
$event = new PlayerEmoteEvent($this, $emoteId);
|
||||
if(!$this->hasPermission(DefaultPermissionNames::GAME_EMOTE)){
|
||||
$event->cancel();
|
||||
}
|
||||
$event->call();
|
||||
if(!$event->isCancelled()){
|
||||
$emoteId = $event->getEmoteId();
|
||||
|
Loading…
x
Reference in New Issue
Block a user