mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Added Door sounds
This commit is contained in:
parent
e48126a0c9
commit
c11ee468a2
@ -1718,9 +1718,8 @@ class Player{
|
||||
$this->toCraft = array();
|
||||
if(isset($this->windows[$data["windowid"]])){
|
||||
if(is_array($this->windows[$data["windowid"]])){
|
||||
$all = $this->server->api->player->getAll($this->level);
|
||||
foreach($this->windows[$data["windowid"]] as $ob){
|
||||
$this->server->api->player->broadcastPacket($all, MC_TILE_EVENT, array(
|
||||
$this->server->api->player->broadcastPacket($this->level->players, MC_TILE_EVENT, array(
|
||||
"x" => $ob->x,
|
||||
"y" => $ob->y,
|
||||
"z" => $ob->z,
|
||||
|
@ -89,12 +89,30 @@ class DoorBlock extends TransparentBlock{
|
||||
if($down->getID() === $this->id){
|
||||
$meta = $down->getMetadata() ^ 0x04;
|
||||
$this->level->setBlock($down, BlockAPI::get($this->id, $meta), true, false, true);
|
||||
$players = ServerAPI::request()->api->player->getAll($this->level);
|
||||
unset($players[$player->CID]);
|
||||
ServerAPI::request()->api->player->broadcastPacket($players, MC_LEVEL_EVENT, array(
|
||||
"x" => $this->x,
|
||||
"y" => $this->y,
|
||||
"z" => $this->z,
|
||||
"evid" => 1003,
|
||||
"data" => 0
|
||||
));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}else{
|
||||
$this->meta ^= 0x04;
|
||||
$this->level->setBlock($this, $this, true, false, true);
|
||||
$players = ServerAPI::request()->api->player->getAll($this->level);
|
||||
unset($players[$player->CID]);
|
||||
ServerAPI::request()->api->player->broadcastPacket($players, MC_LEVEL_EVENT, array(
|
||||
"x" => $this->x,
|
||||
"y" => $this->y,
|
||||
"z" => $this->z,
|
||||
"evid" => 1003,
|
||||
"data" => 0
|
||||
));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -475,17 +475,17 @@ class CustomPacketHandler{
|
||||
break;
|
||||
case MC_LEVEL_EVENT:
|
||||
if($this->c === false){
|
||||
$this->data["unknown1"] = Utils::readShort($this->get(2));
|
||||
$this->data["unknown2"] = Utils::readShort($this->get(2));
|
||||
$this->data["unknown3"] = Utils::readShort($this->get(2));
|
||||
$this->data["unknown4"] = Utils::readShort($this->get(2));
|
||||
$this->data["unknown5"] = Utils::readInt($this->get(4));
|
||||
$this->data["evid"] = Utils::readShort($this->get(2));
|
||||
$this->data["x"] = Utils::readShort($this->get(2));
|
||||
$this->data["y"] = Utils::readShort($this->get(2));
|
||||
$this->data["z"] = Utils::readShort($this->get(2));
|
||||
$this->data["data"] = Utils::readInt($this->get(4));
|
||||
}else{
|
||||
$this->raw .= Utils::writeShort($this->data["unknown1"]);
|
||||
$this->raw .= Utils::writeShort($this->data["unknown2"]);
|
||||
$this->raw .= Utils::writeShort($this->data["unknown3"]);
|
||||
$this->raw .= Utils::writeShort($this->data["unknown4"]);
|
||||
$this->raw .= Utils::writeInt($this->data["unknown5"]);
|
||||
$this->raw .= Utils::writeShort($this->data["evid"]);
|
||||
$this->raw .= Utils::writeShort($this->data["x"]);
|
||||
$this->raw .= Utils::writeShort($this->data["y"]);
|
||||
$this->raw .= Utils::writeShort($this->data["z"]);
|
||||
$this->raw .= Utils::writeInt($this->data["data"]);
|
||||
}
|
||||
break;
|
||||
case MC_TILE_EVENT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user