mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Conver High ItemID to Old ItemId
This commit is contained in:
parent
6b7563d8ea
commit
fd23ba04ec
9 changed files with 36 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue