mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Tile: use phpstan-friendly way to pass block NBT
fixes 1 level 8 error
This commit is contained in:
parent
9484220bd5
commit
7e391a8123
@ -89,8 +89,8 @@ abstract class Tile{
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function copyDataFromItem(Item $item) : void{
|
||||
if($item->hasCustomBlockData()){ //TODO: check item root tag (MCPE doesn't use BlockEntityTag)
|
||||
$this->readSaveData($item->getCustomBlockData());
|
||||
if(($blockNbt = $item->getCustomBlockData()) !== null){ //TODO: check item root tag (MCPE doesn't use BlockEntityTag)
|
||||
$this->readSaveData($blockNbt);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,11 +45,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/block/tile/Chest.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$nbt of method pocketmine\\\\block\\\\tile\\\\Tile\\:\\:readSaveData\\(\\) expects pocketmine\\\\nbt\\\\tag\\\\CompoundTag, pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/block/tile/Tile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$replace of function str_replace expects array\\|string, string\\|null given\\.$#"
|
||||
count: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user