This commit is contained in:
Sunch 2025-04-27 19:53:50 +08:00
parent aad00314d7
commit f6ca62ff6c

View file

@ -645,7 +645,10 @@ class BlockAPI{
} }
} }
public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId){ /**
* 方块/物品id转换,防止新版本影响旧版本视觉效果
*/
public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId) : int{
if ($protocolId >= ProtocolInfo::CURRENT_PROTOCOL) { if ($protocolId >= ProtocolInfo::CURRENT_PROTOCOL) {
return $itemId; return $itemId;
} }
@ -653,18 +656,18 @@ class BlockAPI{
$idMap = []; $idMap = [];
if ($protocolId < ProtocolInfo9::CURRENT_PROTOCOL_9) { if ($protocolId < ProtocolInfo9::CURRENT_PROTOCOL_9) {
$idMap += [ $idMap += [
87 => 49, NETHERRACK => OBSIDIAN, //block
405 => 336, NETHER_BRICK => BRICK, //item
406 => 336, NETHER_QUARTZ => BRICK, //item
]; ];
} }
if ($protocolId < ProtocolInfo12::CURRENT_PROTOCOL_12) { if ($protocolId < ProtocolInfo12::CURRENT_PROTOCOL_12) {
$idMap += [ $idMap += [
91 => 103, LIT_PUMPKIN => MELON_BLOCK, //block
361 => 362, PUMPKIN_SEEDS => MELON_SEEDS, //item
400 => 297, PUMPKIN_PIE => BREAD, //item
457 => 295, BEETROOT => BREAD, //item
458 => 297, BEETROOT_SEEDS => SEEDS, //item
]; ];
} }