Replace BlockLegacyIds usages with BlockTypeIds where possible

This commit is contained in:
Dylan K. Taylor
2022-06-05 21:17:10 +01:00
parent f97c22c341
commit d2613039ed
31 changed files with 65 additions and 64 deletions

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\command\defaults;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\BlockTypeIds;
use pocketmine\color\Color;
use pocketmine\command\CommandSender;
use pocketmine\command\utils\InvalidCommandSyntaxException;
@ -190,7 +190,7 @@ class ParticleCommand extends VanillaCommand{
case "terrain":
if($data !== null){
$block = StringToItemParser::getInstance()->parse($data)?->getBlock();
if($block !== null && $block->getId() !== BlockLegacyIds::AIR){
if($block !== null && $block->getTypeId() !== BlockTypeIds::AIR){
return new TerrainParticle($block);
}
}
@ -217,7 +217,7 @@ class ParticleCommand extends VanillaCommand{
}
break;
case "blockcrack":
if($data !== null && ($block = StringToItemParser::getInstance()->parse($data)?->getBlock()) !== null && $block->getId() !== BlockLegacyIds::AIR){
if($data !== null && ($block = StringToItemParser::getInstance()->parse($data)?->getBlock()) !== null && $block->getTypeId() !== BlockTypeIds::AIR){
return new TerrainParticle($block);
}
break;