mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
tools/generate-item-upgrade-schema: filter old IDs that were already renamed by previous schemas
this caused weird outputs if an item was renamed multiple times.
This commit is contained in:
parent
e77cd39316
commit
d97c8e2fd2
@ -94,9 +94,14 @@ foreach($files as $file){
|
||||
$newDiff = [];
|
||||
|
||||
foreach($target["simple"] as $oldId => $newId){
|
||||
if(($merged["simple"][$oldId] ?? null) !== $newId){
|
||||
$newDiff["renamedIds"][$oldId] = $newId;
|
||||
$previousNewId = $merged["simple"][$oldId] ?? null;
|
||||
if(
|
||||
$previousNewId === $newId || //if previous schemas already accounted for this
|
||||
($previousNewId !== null && isset($target["simple"][$previousNewId])) //or the item's ID has been changed for a second time
|
||||
){
|
||||
continue;
|
||||
}
|
||||
$newDiff["renamedIds"][$oldId] = $newId;
|
||||
}
|
||||
if(isset($newDiff["renamedIds"])){
|
||||
ksort($newDiff["renamedIds"], SORT_STRING);
|
||||
|
Loading…
x
Reference in New Issue
Block a user