diff --git a/src/CortexPE/Hierarchy/command/subcommand/InfoCommand.php b/src/CortexPE/Hierarchy/command/subcommand/InfoCommand.php index 4dbcc4c..daad3d5 100644 --- a/src/CortexPE/Hierarchy/command/subcommand/InfoCommand.php +++ b/src/CortexPE/Hierarchy/command/subcommand/InfoCommand.php @@ -78,7 +78,7 @@ function(Player $player, CustomFormResponse $response): void { $this->setCurrentSender($player); $this->onRun($player, $this->getName(), [ "targetType" => InfoTargetEnumArgument::TARGET_MEMBER, - "targetMember" => $this->memberFactory->getMember($response->getString("member")) + "targetMember" => [$this->memberFactory->getMember($response->getString("member"))] ]); } ], @@ -97,7 +97,7 @@ function(Player $player, CustomFormResponse $response) use ($roles, $roles_i): v $this->setCurrentSender($player); $this->onRun($player, $this->getName(), [ "targetType" => InfoTargetEnumArgument::TARGET_ROLE, - "targetRole" => $this->roleManager->getRole($roles_i[$response->getInt("roles")]) + "targetRole" => [$this->roleManager->getRole($roles_i[$response->getInt("roles")])] ]); } ], diff --git a/src/CortexPE/Hierarchy/data/role/IndexedRoleDS.php b/src/CortexPE/Hierarchy/data/role/IndexedRoleDS.php index 75f0bd0..304af95 100644 --- a/src/CortexPE/Hierarchy/data/role/IndexedRoleDS.php +++ b/src/CortexPE/Hierarchy/data/role/IndexedRoleDS.php @@ -114,12 +114,12 @@ public function removeRolePermission(Role $role, $permission): void { } public function createRoleOnStorage(string $name, int $id, int $position): void { - array_splice($this->roles, $position, 0, [ + array_splice($this->roles, $position, 0, [[ "ID" => $id, "Name" => $name, "isDefault" => false, "Permissions" => [] - ]); + ]]); $this->flush(); } diff --git a/src/CortexPE/Hierarchy/member/Member.php b/src/CortexPE/Hierarchy/member/Member.php index 41ba6f0..8afafa9 100644 --- a/src/CortexPE/Hierarchy/member/Member.php +++ b/src/CortexPE/Hierarchy/member/Member.php @@ -57,6 +57,7 @@ public function getAttachment(): ?PermissionAttachment { public function recalculatePermissions(): void { parent::recalculatePermissions(); + $this->attachment->clearPermissions(); $this->attachment->setPermissions($this->permissions); }