mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-04 02:52:25 +00:00
BlockStateUpgrader: fixed undefined array key when flattening a block whose new ID is the same as the old
this came up during 1.20.50 testing, where minecraft:stone[stone_type=stone] continues to have an ID minecraft:stone without the stone_type property. This could have appeared in other ways, such as with an invalid legacy blockstate.
This commit is contained in:
parent
8ccaf907d1
commit
5f3a2a5096
@ -86,7 +86,7 @@ final class BlockStateUpgrader{
|
||||
if(is_string($remap->newName)){
|
||||
$newName = $remap->newName;
|
||||
}else{
|
||||
$flattenedValue = $oldState[$remap->newName->flattenedProperty];
|
||||
$flattenedValue = $oldState[$remap->newName->flattenedProperty] ?? null;
|
||||
if($flattenedValue instanceof StringTag){
|
||||
$newName = sprintf("%s%s%s", $remap->newName->prefix, $flattenedValue->getValue(), $remap->newName->suffix);
|
||||
unset($oldState[$remap->newName->flattenedProperty]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user