mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
Getting ready, protocol changes!
This commit is contained in:
parent
f2e2cec024
commit
b4a0afc2c8
@ -1843,6 +1843,40 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$this->startAction = -1;
|
$this->startAction = -1;
|
||||||
$this->setDataFlag(self::DATA_FLAGS, self::DATA_FLAG_ACTION, false);
|
$this->setDataFlag(self::DATA_FLAGS, self::DATA_FLAG_ACTION, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ProtocolInfo::RESPAWN_PACKET:
|
||||||
|
//TODO: Remove
|
||||||
|
if($this->spawned === false or $this->dead === false){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->craftingType = 0;
|
||||||
|
|
||||||
|
$this->server->getPluginManager()->callEvent($ev = new PlayerRespawnEvent($this, $this->getSpawn()));
|
||||||
|
|
||||||
|
$this->teleport($ev->getRespawnPosition());
|
||||||
|
|
||||||
|
$this->extinguish();
|
||||||
|
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, 300);
|
||||||
|
$this->deadTicks = 0;
|
||||||
|
$this->noDamageTicks = 60;
|
||||||
|
|
||||||
|
$this->setHealth(20);
|
||||||
|
$this->dead = false;
|
||||||
|
|
||||||
|
$this->removeAllEffects();
|
||||||
|
$this->sendData($this);
|
||||||
|
|
||||||
|
$this->sendSettings();
|
||||||
|
$this->inventory->sendContents($this);
|
||||||
|
$this->inventory->sendArmorContents($this);
|
||||||
|
|
||||||
|
$this->blocked = false;
|
||||||
|
|
||||||
|
$this->spawnToAll();
|
||||||
|
$this->scheduleUpdate();
|
||||||
|
break;
|
||||||
|
|
||||||
case ProtocolInfo::REMOVE_BLOCK_PACKET:
|
case ProtocolInfo::REMOVE_BLOCK_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true or $this->dead === true){
|
if($this->spawned === false or $this->blocked === true or $this->dead === true){
|
||||||
break;
|
break;
|
||||||
|
@ -37,6 +37,7 @@ class RespawnPacket extends DataPacket{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function decode(){
|
public function decode(){
|
||||||
|
$this->getLong(); //TODO: remove
|
||||||
$this->x = $this->getFloat();
|
$this->x = $this->getFloat();
|
||||||
$this->y = $this->getFloat();
|
$this->y = $this->getFloat();
|
||||||
$this->z = $this->getFloat();
|
$this->z = $this->getFloat();
|
||||||
@ -44,6 +45,7 @@ class RespawnPacket extends DataPacket{
|
|||||||
|
|
||||||
public function encode(){
|
public function encode(){
|
||||||
$this->reset();
|
$this->reset();
|
||||||
|
$this->putLong(0); //TODO: remove
|
||||||
$this->putFloat($this->x);
|
$this->putFloat($this->x);
|
||||||
$this->putFloat($this->y);
|
$this->putFloat($this->y);
|
||||||
$this->putFloat($this->z);
|
$this->putFloat($this->z);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user