Block: rename isSameType() to hasSameTypeId()

this should remove any ambiguity about its behaviour.
This commit is contained in:
Dylan K. Taylor
2023-04-21 20:25:21 +01:00
parent 769be8e140
commit 6c0ad9589b
15 changed files with 33 additions and 33 deletions

View File

@ -1922,7 +1922,7 @@ class World implements ChunkManager{
$itemParser = LegacyStringToItemParser::getInstance();
foreach($item->getCanDestroy() as $v){
$entry = $itemParser->parse($v);
if($entry->getBlock()->isSameType($target)){
if($entry->getBlock()->hasSameTypeId($target)){
$canBreak = true;
break;
}
@ -2077,7 +2077,7 @@ class World implements ChunkManager{
$itemParser = LegacyStringToItemParser::getInstance();
foreach($item->getCanPlaceOn() as $v){
$entry = $itemParser->parse($v);
if($entry->getBlock()->isSameType($blockClicked)){
if($entry->getBlock()->hasSameTypeId($blockClicked)){
$canPlace = true;
break;
}

View File

@ -40,7 +40,7 @@ class Ore{
}
public function canPlaceObject(ChunkManager $world, int $x, int $y, int $z) : bool{
return $world->getBlockAt($x, $y, $z)->isSameType($this->type->replaces);
return $world->getBlockAt($x, $y, $z)->hasSameTypeId($this->type->replaces);
}
public function placeObject(ChunkManager $world, int $x, int $y, int $z) : void{
@ -80,7 +80,7 @@ class Ore{
$sizeZ = ($zz + 0.5 - $seedZ) / $size;
$sizeZ *= $sizeZ;
if(($sizeX + $sizeY + $sizeZ) < 1 && $world->getBlockAt($xx, $yy, $zz)->isSameType($this->type->replaces)){
if(($sizeX + $sizeY + $sizeZ) < 1 && $world->getBlockAt($xx, $yy, $zz)->hasSameTypeId($this->type->replaces)){
$world->setBlockAt($xx, $yy, $zz, $this->type->material);
}
}