mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Player under MCPE 0.7.4 will clean the armor state when death
This commit is contained in:
parent
8e24f49e8a
commit
e992aa4aff
2 changed files with 8 additions and 6 deletions
|
|
@ -1469,7 +1469,7 @@ class Player{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->isWorkBench && $this->PROTOCOL <= ProtocolInfo6::CURRENT_PROTOCOL_6 && $type === STONE_BRICK){
|
if($this->PROTOCOL <= ProtocolInfo6::CURRENT_PROTOCOL_6 && $type === STONE_BRICK){
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1629,14 +1629,14 @@ class Entity extends Position
|
||||||
if($this->isPlayer()){
|
if($this->isPlayer()){
|
||||||
$v2 = (int)($dmg / 4);
|
$v2 = (int)($dmg / 4);
|
||||||
if($v2 < 1) $v2 = 1;
|
if($v2 < 1) $v2 = 1;
|
||||||
|
|
||||||
foreach($this->player->armor as $slot => $part){
|
foreach($this->player->armor as $slot => $part){
|
||||||
$part->hurtAndBreak($v2, $this->player, helditem: false);
|
$part->hurtAndBreak($v2, $this->player, helditem: false);
|
||||||
if($part->count <= 0) $this->player->setArmor($slot, BlockAPI::getItem(0, 0, 0), send: false);
|
if($part->count <= 0) $this->player->setArmor($slot, BlockAPI::getItem(0, 0, 0), send: false);
|
||||||
}
|
}
|
||||||
if($this->player->getProtocol() < ProtocolInfo12::CURRENT_PROTOCOL_12 && $this->player->getProtocol() > ProtocolInfo8::CURRENT_PROTOCOL_8){
|
if($this->player->getProtocol() < ProtocolInfo12::CURRENT_PROTOCOL_12 && $this->player->getProtocol() > ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||||
$pk = new HurtArmorPacket();
|
$pk = new HurtArmorPacket();
|
||||||
$pk->health = $v2; //TODO: Verify the real attack health for it
|
$pk->health = $v2;
|
||||||
$this->player->entityQueueDataPacket($pk);
|
$this->player->entityQueueDataPacket($pk);
|
||||||
}
|
}
|
||||||
$this->player->sendArmor();
|
$this->player->sendArmor();
|
||||||
|
|
@ -1731,9 +1731,11 @@ class Entity extends Position
|
||||||
$pk->event = EntityEventPacket::ENTITY_DEAD;
|
$pk->event = EntityEventPacket::ENTITY_DEAD;
|
||||||
$this->player->entityQueueDataPacket($pk);
|
$this->player->entityQueueDataPacket($pk);
|
||||||
} elseif (isset($this->player->isOre[DIAMOND_HELMET])) {
|
} elseif (isset($this->player->isOre[DIAMOND_HELMET])) {
|
||||||
$pk = new HurtArmorPacket();
|
for($i = 0 ; $i < 19 ; $i++){
|
||||||
$pk->health = 900; //TODO Verify the real attack health for it
|
$pk = new HurtArmorPacket();
|
||||||
$this->player->entityQueueDataPacket($pk);
|
$pk->health = 127;
|
||||||
|
$this->player->entityQueueDataPacket($pk);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->player->isOre = [];
|
$this->player->isOre = [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue