Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2021-06-08 20:00:08 +01:00
19 changed files with 277 additions and 42 deletions

View File

@ -86,6 +86,10 @@ final class ItemTranslator{
if(!is_string($oldId) || !is_string($newId)){
throw new AssumptionFailedError("Invalid item table format");
}
if(!isset($legacyStringToIntMap[$oldId])){
//new item without a fixed legacy ID - we can't handle this right now
continue;
}
$simpleMappings[$newId] = $legacyStringToIntMap[$oldId];
}
foreach($legacyStringToIntMap as $stringId => $intId){
@ -129,8 +133,9 @@ final class ItemTranslator{
}elseif(isset($simpleMappings[$stringId])){
$this->simpleCoreToNetMapping[$simpleMappings[$stringId]] = $netId;
$this->simpleNetToCoreMapping[$netId] = $simpleMappings[$stringId];
}elseif($stringId !== "minecraft:unknown"){
throw new \InvalidArgumentException("Unmapped entry " . $stringId);
}else{
//not all items have a legacy mapping - for now, we only support the ones that do
continue;
}
}
}