Refactored JSON-parsing NBT utilities into their own class

This commit is contained in:
Dylan K. Taylor
2017-05-19 20:02:43 +01:00
parent 2e480b5ea1
commit afd90adb1c
3 changed files with 261 additions and 195 deletions

View File

@ -25,7 +25,7 @@ use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\event\TranslationContainer;
use pocketmine\item\Item;
use pocketmine\nbt\NBT;
use pocketmine\nbt\JsonNBTParser;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\Player;
use pocketmine\utils\TextFormat;
@ -65,7 +65,7 @@ class GiveCommand extends VanillaCommand{
$tags = $exception = null;
$data = implode(" ", array_slice($args, 3));
try{
$tags = NBT::parseJSON($data);
$tags = JsonNBTParser::parseJSON($data);
}catch(\Throwable $ex){
$exception = $ex;
}