From 7dd3a70d2ea218d5e4f480697fcaa1426446f44e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 20 Oct 2023 10:16:49 +0100 Subject: [PATCH] Revert "World: discard tiles on load if they aren't the correct type or no tile is expected" This reverts commit 8f804f6f342e650156767372bac2d42b55297361. 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. --- src/world/World.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/world/World.php b/src/world/World.php index 1103ae8f9..903cc60e2 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -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); } }