mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +00:00
tools/generate-blockstate-upgrade-schema: allow multi-ID remaps to be processed as regular states if their ID didn't change
this allows remappedStates to only deal with stuff that has a different ID, which reduced the size of the 1.12 -> 1.13 schema quite nicely.
This commit is contained in:
parent
a1d44de487
commit
728e0bc869
@ -358,6 +358,15 @@ function generateBlockStateUpgradeSchema(array $upgradeTable) : BlockStateUpgrad
|
|||||||
processState($mapping->old, $mapping->new, $result, $removedPropertiesCache, $remappedPropertyValuesCache);
|
processState($mapping->old, $mapping->new, $result, $removedPropertiesCache, $remappedPropertyValuesCache);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
if(isset($newNameFound[$oldName])){
|
||||||
|
//some of the states stayed under the same ID - we can process these as normal states
|
||||||
|
foreach($blockStateMappings as $k => $mapping){
|
||||||
|
if($mapping->new->getName() === $oldName){
|
||||||
|
processState($mapping->old, $mapping->new, $result, $removedPropertiesCache, $remappedPropertyValuesCache);
|
||||||
|
unset($blockStateMappings[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//block mapped to multiple different new IDs; we can't guess these, so we just do a plain old remap
|
//block mapped to multiple different new IDs; we can't guess these, so we just do a plain old remap
|
||||||
foreach($blockStateMappings as $mapping){
|
foreach($blockStateMappings as $mapping){
|
||||||
if(!$mapping->old->equals($mapping->new)){
|
if(!$mapping->old->equals($mapping->new)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user