From c8335f8c08241a73d729c6cebe4d364fdf03bbf7 Mon Sep 17 00:00:00 2001 From: Lu1ssD33V <167026544+Lu1ssD33V@users.noreply.github.com> Date: Mon, 22 Apr 2024 19:23:39 -0600 Subject: [PATCH 1/3] Create ItemArgument.php --- src/CortexPE/Commando/args/ItemArgument.php | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/CortexPE/Commando/args/ItemArgument.php diff --git a/src/CortexPE/Commando/args/ItemArgument.php b/src/CortexPE/Commando/args/ItemArgument.php new file mode 100644 index 0000000..03a01f6 --- /dev/null +++ b/src/CortexPE/Commando/args/ItemArgument.php @@ -0,0 +1,35 @@ +getValue($testString) instanceof Item; + } + + public function parse(string $argument, CommandSender $sender) : ?Rank { + return $this->getValue($argument); + } + + public function getValue(string $string) : ?Rank { + return StringToItemParser::getInstance()->parse($string); + } + + public function getEnumValues() : array { + return StringToItemParser::getInstance()->getKnownAliases(); + } + +} From d00d8ae43b59243bfbd0db44f6eff07fe938f483 Mon Sep 17 00:00:00 2001 From: Lu1ssD33V <167026544+Lu1ssD33V@users.noreply.github.com> Date: Mon, 22 Apr 2024 19:25:27 -0600 Subject: [PATCH 2/3] Update ItemArgument.php --- src/CortexPE/Commando/args/ItemArgument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CortexPE/Commando/args/ItemArgument.php b/src/CortexPE/Commando/args/ItemArgument.php index 03a01f6..72352c7 100644 --- a/src/CortexPE/Commando/args/ItemArgument.php +++ b/src/CortexPE/Commando/args/ItemArgument.php @@ -24,7 +24,7 @@ public function parse(string $argument, CommandSender $sender) : ?Rank { return $this->getValue($argument); } - public function getValue(string $string) : ?Rank { + public function getValue(string $string) : ?Item { return StringToItemParser::getInstance()->parse($string); } From 152062920a43ff36b0ee8cd4de6709129f489530 Mon Sep 17 00:00:00 2001 From: Lu1ssD33V <167026544+Lu1ssD33V@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:48:06 -0600 Subject: [PATCH 3/3] Update ItemArgument.php --- src/CortexPE/Commando/args/ItemArgument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CortexPE/Commando/args/ItemArgument.php b/src/CortexPE/Commando/args/ItemArgument.php index 72352c7..cd17a74 100644 --- a/src/CortexPE/Commando/args/ItemArgument.php +++ b/src/CortexPE/Commando/args/ItemArgument.php @@ -20,7 +20,7 @@ public function canParse(string $testString, CommandSender $sender) : bool { return $this->getValue($testString) instanceof Item; } - public function parse(string $argument, CommandSender $sender) : ?Rank { + public function parse(string $argument, CommandSender $sender) : ?Item { return $this->getValue($argument); }