mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Fixed being killed on teleport
This commit is contained in:
parent
304524f6d8
commit
ebe8a902e5
@ -2212,9 +2212,11 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
public function setHealth($amount){
|
||||
parent::setHealth($amount);
|
||||
$pk = new SetHealthPacket();
|
||||
$pk->health = $this->getHealth();
|
||||
$this->dataPacket($pk);
|
||||
if($this->spawned === true){
|
||||
$pk = new SetHealthPacket();
|
||||
$pk->health = $this->getHealth();
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
||||
public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){
|
||||
|
@ -1006,6 +1006,8 @@ abstract class Entity extends Position implements Metadatable{
|
||||
|
||||
$this->setMotion(new Vector3(0, 0, 0));
|
||||
if($this->setPositionAndRotation($pos, $yaw === null ? $this->yaw : $yaw, $pitch === null ? $this->pitch : $pitch, true) !== false){
|
||||
$this->fallDistance = 0;
|
||||
$this->onGround = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ class ChunkRequestTask extends AsyncTask{
|
||||
$this->levelId = $level->getID();
|
||||
$this->chunkX = $chunkX;
|
||||
$this->chunkZ = $chunkZ;
|
||||
$chunk = $level->getChunkAt($chunkX, $chunkZ);
|
||||
$chunk = $level->getChunkAt($chunkX, $chunkZ, true);
|
||||
$this->biomeIds = $chunk->getBiomeIdArray();
|
||||
$this->biomeColors = $chunk->getBiomeColorArray();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user