From fdad965db8251fce7dc9cc51db9b5a41d427d136 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 16 Mar 2018 10:41:00 +0000 Subject: [PATCH] Player: if command has aliases, add command name as alias if not found closes #2106 For some strange reason, using aliases overwrites the original command name instead of coexisting with it. This is rather astonishing behaviour, and probably a bug in the client. However, this workaround is the same thing vanilla does (see /tp in vanilla). --- src/pocketmine/Player.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index d8ff82203..ade6ccf9f 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -668,6 +668,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $aliases = $command->getAliases(); if(!empty($aliases)){ + if(!\in_array($data->commandName, $aliases, true)){ + //work around a client bug which makes the original name not show when aliases are used + $aliases[] = $data->commandName; + } $data->aliases = new CommandEnum(); $data->aliases->enumName = ucfirst($command->getName()) . "Aliases"; $data->aliases->enumValues = $aliases;