mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Block: rename isSameType() to hasSameTypeId()
this should remove any ambiguity about its behaviour.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user