mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
commit
1eceb700c2
1 changed files with 16 additions and 15 deletions
|
|
@ -645,26 +645,27 @@ class BlockAPI{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId){
|
/**
|
||||||
if ($protocolId >= ProtocolInfo::CURRENT_PROTOCOL) {
|
* 方块/物品id转换,防止新版本影响旧版本视觉效果
|
||||||
|
*/
|
||||||
|
public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId) : int{
|
||||||
|
if ($protocolId >= ProtocolInfo12::CURRENT_PROTOCOL_12) {
|
||||||
return $itemId;
|
return $itemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
$idMap = [];
|
$idMap = [ //default for protocol < 12
|
||||||
|
LIT_PUMPKIN => MELON_BLOCK, //block
|
||||||
|
PUMPKIN_SEEDS => MELON_SEEDS, //item
|
||||||
|
PUMPKIN_PIE => BREAD, //item
|
||||||
|
BEETROOT => BREAD, //item
|
||||||
|
BEETROOT_SEEDS => SEEDS, //item
|
||||||
|
];
|
||||||
|
|
||||||
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) {
|
|
||||||
$idMap += [
|
|
||||||
91 => 103,
|
|
||||||
361 => 362,
|
|
||||||
400 => 297,
|
|
||||||
457 => 295,
|
|
||||||
458 => 297,
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue