WIP: HurtArmor for MCPE 0.6.1

This commit is contained in:
yefengeeeeeeeeeee 2026-07-12 22:10:32 +08:00
parent d963e049a8
commit bec37f62f8
2 changed files with 5 additions and 1 deletions

View file

@ -1634,6 +1634,11 @@ class Entity extends Position
$part->hurtAndBreak($v2, $this->player, helditem: false);
if($part->count <= 0) $this->player->setArmor($slot, BlockAPI::getItem(0, 0, 0), send: false);
}
if($this->player->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_11 && $this->player->PROTOCOL > ProtocolInfo8::CURRENT_PROTOCOL_8){
$pk = new HurtArmorPacket();
$pk->health = $part->meta - $v2;
//$this->player->dataPacket($pk); //MCPE 0.6.0
}
$this->player->sendArmor();
}
}

View file

@ -938,7 +938,6 @@ class CraftingRecipes{
return true; //recipe might be found next time
}
if($protocol <= ProtocolInfo12::CURRENT_PROTOCOL_12 && $protocol >= ProtocolInfo12::CURRENT_PROTOCOL_11 && ($craftIndex === "5:0x4" || $craftIndex === "53:0x4" || $craftIndex === "158:0x6")){
console(2);
switch ($craftIndex){
case "5:0x4":
$arr[$craftIndex][][] = [WOOD, "?", 1];