Conver High ItemID to Old ItemId

This commit is contained in:
yefengeeeeeeeeeee 2025-04-25 17:19:22 +08:00
parent 6b7563d8ea
commit fd23ba04ec
9 changed files with 36 additions and 10 deletions

View file

@ -644,4 +644,30 @@ class BlockAPI{
}
}
}
public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId){
if ($protocolId >= ProtocolInfo::CURRENT_PROTOCOL) {
return $itemId;
}
$idMap = [];
if ($protocolId < ProtocolInfo9::CURRENT_PROTOCOL_9) {
$idMap += [
87 => 49,
405 => 336,
406 => 336,
];
}
if ($protocolId < ProtocolInfo12::CURRENT_PROTOCOL_12) {
$idMap += [
91 => 103,
361 => 362,
400 => 297,
457 => 295,
458 => 297,
];
}
return $idMap[$itemId] ?? $itemId;
}
}