mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Mob spawning!
This commit is contained in:
@ -184,6 +184,27 @@ class CustomPacketHandler{
|
||||
$this->raw .= Utils::writeFloat($this->data["z"]);
|
||||
}
|
||||
break;
|
||||
case MC_ADD_MOB:
|
||||
if($this->c === false){
|
||||
$this->data["int"] = Utils::readInt($this->get(4));
|
||||
$this->data["type"] = Utils::readInt($this->get(4));
|
||||
$this->data["x"] = Utils::readFloat($this->get(4));
|
||||
$this->data["y"] = Utils::readFloat($this->get(4));
|
||||
$this->data["z"] = Utils::readFloat($this->get(4));
|
||||
$this->data["metadata"] = Utils::readMetadata($this->get(true));
|
||||
}else{
|
||||
$this->raw .= Utils::writeInt($this->data["eid"]);
|
||||
$this->raw .= Utils::writeInt($this->data["type"]);
|
||||
$this->raw .= Utils::writeFloat($this->data["x"]);
|
||||
$this->raw .= Utils::writeFloat($this->data["y"]);
|
||||
$this->raw .= Utils::writeFloat($this->data["z"]);
|
||||
$this->raw .= Utils::writeMetadata(array(
|
||||
1 => array("type" => 1, "value" => 300),
|
||||
16 => array("type" => 0, "value" => 0),
|
||||
17 => array("type" => 6, "value" => array(0, 0, 0)),
|
||||
));
|
||||
}
|
||||
break;
|
||||
case MC_ADD_PLAYER:
|
||||
if($this->c === false){
|
||||
$this->data["clientID"] = Utils::readLong($this->get(8));
|
||||
|
@ -351,14 +351,12 @@ class Session{
|
||||
$this->counter[0],
|
||||
0x00,
|
||||
array(
|
||||
"id" => MC_ADD_ITEM_ENTITY,
|
||||
"id" => MC_ADD_MOB,
|
||||
"eid" => $entity->eid,
|
||||
"type" => $entity->type,
|
||||
"x" => $entity->position["x"],
|
||||
"y" => $entity->position["y"],
|
||||
"z" => $entity->position["z"],
|
||||
"block" => 10,
|
||||
"meta" => 0,
|
||||
),
|
||||
));
|
||||
++$this->counter[0];
|
||||
|
Reference in New Issue
Block a user