mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Teleport command
This commit is contained in:
parent
c15f8cfda6
commit
cd6ce17c78
2 changed files with 58 additions and 0 deletions
|
|
@ -91,6 +91,25 @@ class Session{
|
|||
$this->server->trigger("onPlayerDeath", array("name" => $this->username, "cause" => $data["cause"]));
|
||||
}
|
||||
break;
|
||||
case "onTeleport":
|
||||
if($data["eid"] !== $this->eid){
|
||||
break;
|
||||
}
|
||||
$this->send(0x84, array(
|
||||
$this->counter[0],
|
||||
0x00,
|
||||
array(
|
||||
"id" => MC_MOVE_PLAYER,
|
||||
"eid" => $data["eid"],
|
||||
"x" => $data["x"],
|
||||
"y" => $data["y"],
|
||||
"z" => $data["z"],
|
||||
"yaw" => 0,
|
||||
"pitch" => 0,
|
||||
),
|
||||
));
|
||||
++$this->counter[0];
|
||||
break;
|
||||
case "onEntityMove":
|
||||
if($data === $this->eid){
|
||||
break;
|
||||
|
|
@ -271,6 +290,7 @@ class Session{
|
|||
$this->evid[] = array("onHealthChange", $this->server->event("onHealthChange", array($this, "eventHandler")));
|
||||
$this->evid[] = array("onHealthRegeneration", $this->server->event("onHealthRegeneration", array($this, "eventHandler")));
|
||||
$this->evid[] = array("onAnimate", $this->server->event("onAnimate", array($this, "eventHandler")));
|
||||
$this->evid[] = array("onTeleport", $this->server->event("onTeleport", array($this, "eventHandler")));
|
||||
$this->send(0x84, array(
|
||||
$this->counter[0],
|
||||
0x00,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue