mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Revert "World: discard tiles on load if they aren't the correct type or no tile is expected"
This reverts commit 8f804f6f34
.
This change is too disruptive, since popular plugins like
ExtendedBlocks and ExtendedBlocksConverter relied on custom tiles.
Deleting them at this stage would prevent these plugins from working,
making it impossible to upgrade old data.
An alternative solution to this problem will need to be developed.
This commit is contained in:
@ -2873,15 +2873,7 @@ class World implements ChunkManager{
|
||||
}elseif($this->getTile($tilePosition) !== null){
|
||||
$logger->error("Cannot add tile at x=$tilePosition->x,y=$tilePosition->y,z=$tilePosition->z: Another tile is already at that position");
|
||||
}else{
|
||||
$block = $this->getBlockAt($tilePosition->getFloorX(), $tilePosition->getFloorY(), $tilePosition->getFloorZ());
|
||||
$expectedClass = $block->getIdInfo()->getTileClass();
|
||||
if($expectedClass === null){
|
||||
$logger->error("Cannot add tile at x=$tilePosition->x,y=$tilePosition->y,z=$tilePosition->z: Block at that position (" . $block->getName() . ") does not expect a tile");
|
||||
}elseif(!($tile instanceof $expectedClass)){
|
||||
$logger->error("Cannot add tile at x=$tilePosition->x,y=$tilePosition->y,z=$tilePosition->z: Tile is of wrong type (expected $expectedClass but have " . get_class($tile) . ")");
|
||||
}else{
|
||||
$this->addTile($tile);
|
||||
}
|
||||
$this->addTile($tile);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user