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

@@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\entity;
use pocketmine\block\Block;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\BlockTypeIds;
use pocketmine\data\bedrock\EffectIdMap;
use pocketmine\entity\animation\DeathAnimation;
use pocketmine\entity\animation\HurtAnimation;
@@ -346,7 +346,7 @@ abstract class Living extends Entity{
new EntityLongFallSound($this) :
new EntityShortFallSound($this)
);
}elseif($fallBlock->getId() !== BlockLegacyIds::AIR){
}elseif($fallBlock->getTypeId() !== BlockTypeIds::AIR){
$this->broadcastSound(new EntityLandSound($this, $fallBlock));
}
return $newVerticalVelocity;
@@ -756,10 +756,10 @@ abstract class Living extends Entity{
--$nextIndex;
}
$id = $block->getId();
$id = $block->getTypeId();
if($transparent === null){
if($id !== BlockLegacyIds::AIR){
if($id !== BlockTypeIds::AIR){
break;
}
}else{

View File

@@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\entity\projectile;
use pocketmine\block\BlockLegacyIds;
use pocketmine\block\BlockTypeIds;
use pocketmine\block\VanillaBlocks;
use pocketmine\color\Color;
use pocketmine\data\bedrock\PotionTypeIdMap;
@@ -130,11 +130,11 @@ class SplashPotion extends Throwable{
}elseif($event instanceof ProjectileHitBlockEvent && $this->getPotionType()->equals(PotionType::WATER())){
$blockIn = $event->getBlockHit()->getSide($event->getRayTraceResult()->getHitFace());
if($blockIn->getId() === BlockLegacyIds::FIRE){
if($blockIn->getTypeId() === BlockTypeIds::FIRE){
$this->getWorld()->setBlock($blockIn->getPosition(), VanillaBlocks::AIR());
}
foreach($blockIn->getHorizontalSides() as $horizontalSide){
if($horizontalSide->getId() === BlockLegacyIds::FIRE){
if($horizontalSide->getTypeId() === BlockTypeIds::FIRE){
$this->getWorld()->setBlock($horizontalSide->getPosition(), VanillaBlocks::AIR());
}
}