mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Added new sounds, events, particles
This commit is contained in:
parent
2b2a1b18e7
commit
522932d7c0
@ -1801,12 +1801,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->displayName = $this->username;
|
||||
$this->setNameTag($this->username);
|
||||
$this->iusername = strtolower($this->username);
|
||||
$this->randomClientId = $packet->clientId;
|
||||
$this->loginData = ["clientId" => $packet->clientId, "loginData" => null];
|
||||
|
||||
$this->uuid = $packet->clientUUID;
|
||||
$this->clientSecret = $packet->clientSecret;
|
||||
$this->rawUUID = $this->uuid->toBinary();
|
||||
|
||||
if(count($this->server->getOnlinePlayers()) > $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){
|
||||
break;
|
||||
@ -1831,6 +1825,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
break;
|
||||
}
|
||||
|
||||
$this->randomClientId = $packet->clientId;
|
||||
$this->loginData = ["clientId" => $packet->clientId, "loginData" => null];
|
||||
|
||||
$this->uuid = $packet->clientUUID;
|
||||
$this->rawUUID = $this->uuid->toBinary();
|
||||
$this->clientSecret = $packet->clientSecret;
|
||||
|
||||
$valid = true;
|
||||
$len = strlen($packet->username);
|
||||
if($len > 16 or $len < 3){
|
||||
|
@ -72,11 +72,11 @@ namespace pocketmine {
|
||||
use pocketmine\utils\Utils;
|
||||
use pocketmine\wizard\Installer;
|
||||
|
||||
const VERSION = "1.5dev";
|
||||
const API_VERSION = "1.12.0";
|
||||
const CODENAME = "活発(Kappatsu)フグ(Fugu)";
|
||||
const MINECRAFT_VERSION = "v0.11.0 alpha";
|
||||
const MINECRAFT_VERSION_NETWORK = "0.11.0";
|
||||
const VERSION = "1.6dev";
|
||||
const API_VERSION = "1.13.0";
|
||||
const CODENAME = "[REDACTED]";
|
||||
const MINECRAFT_VERSION = "v0.12.1 alpha";
|
||||
const MINECRAFT_VERSION_NETWORK = "0.12.1";
|
||||
|
||||
/*
|
||||
* Startup code. Do not look at it, it may harm you.
|
||||
|
@ -26,7 +26,6 @@ use pocketmine\level\Level;
|
||||
use pocketmine\level\sound\DoorSound;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\Server;
|
||||
|
||||
|
@ -25,19 +25,26 @@ use pocketmine\block\Block;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\event\TranslationContainer;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\level\particle\AngryVillagerParticle;
|
||||
use pocketmine\level\particle\BubbleParticle;
|
||||
use pocketmine\level\particle\CriticalParticle;
|
||||
use pocketmine\level\particle\DustParticle;
|
||||
use pocketmine\level\particle\EnchantmentTableParticle;
|
||||
use pocketmine\level\particle\EnchantParticle;
|
||||
use pocketmine\level\particle\ExplodeParticle;
|
||||
use pocketmine\level\particle\FlameParticle;
|
||||
use pocketmine\level\particle\HappyVillagerParticle;
|
||||
use pocketmine\level\particle\HeartParticle;
|
||||
use pocketmine\level\particle\HugeExplodeParticle;
|
||||
use pocketmine\level\particle\InkParticle;
|
||||
use pocketmine\level\particle\InstantEnchantParticle;
|
||||
use pocketmine\level\particle\ItemBreakParticle;
|
||||
use pocketmine\level\particle\LargeExplodeParticle;
|
||||
use pocketmine\level\particle\LavaDripParticle;
|
||||
use pocketmine\level\particle\LavaParticle;
|
||||
use pocketmine\level\particle\Particle;
|
||||
use pocketmine\level\particle\PortalParticle;
|
||||
use pocketmine\level\particle\RainSplashParticle;
|
||||
use pocketmine\level\particle\RedstoneParticle;
|
||||
use pocketmine\level\particle\SmokeParticle;
|
||||
use pocketmine\level\particle\SplashParticle;
|
||||
@ -123,6 +130,10 @@ class ParticleCommand extends VanillaCommand{
|
||||
switch($name){
|
||||
case "explode":
|
||||
return new ExplodeParticle($pos);
|
||||
case "largeexplode":
|
||||
return new LargeExplodeParticle($pos);
|
||||
case "hugeexplosion":
|
||||
return new HugeExplodeParticle($pos);
|
||||
case "bubble":
|
||||
return new BubbleParticle($pos);
|
||||
case "splash":
|
||||
@ -136,6 +147,8 @@ class ParticleCommand extends VanillaCommand{
|
||||
return new SmokeParticle($pos, $data !== null ? $data : 0);
|
||||
case "spell":
|
||||
return new EnchantParticle($pos);
|
||||
case "instantspell":
|
||||
return new InstantEnchantParticle($pos);
|
||||
case "dripwater":
|
||||
return new WaterDripParticle($pos);
|
||||
case "driplava":
|
||||
@ -153,6 +166,8 @@ class ParticleCommand extends VanillaCommand{
|
||||
return new RedstoneParticle($pos, $data !== null ? $data : 1);
|
||||
case "snowballpoof":
|
||||
return new ItemBreakParticle($pos, Item::get(Item::SNOWBALL));
|
||||
case "slime":
|
||||
return new ItemBreakParticle($pos, Item::get(Item::SLIMEBALL));
|
||||
case "itembreak":
|
||||
if($data !== null and $data !== 0){
|
||||
return new ItemBreakParticle($pos, $data);
|
||||
@ -167,6 +182,14 @@ class ParticleCommand extends VanillaCommand{
|
||||
return new HeartParticle($pos, $data !== null ? $data : 0);
|
||||
case "ink":
|
||||
return new InkParticle($pos, $data !== null ? $data : 0);
|
||||
case "droplet":
|
||||
return new RainSplashParticle($pos);
|
||||
case "enchantmenttable":
|
||||
return new EnchantmentTableParticle($pos);
|
||||
case "happyvillager":
|
||||
return new HappyVillagerParticle($pos);
|
||||
case "angryvillager":
|
||||
return new AngryVillagerParticle($pos);
|
||||
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,6 @@ use pocketmine\nbt\tag\String;
|
||||
use pocketmine\network\Network;
|
||||
use pocketmine\network\protocol\DataPacket;
|
||||
use pocketmine\network\protocol\FullChunkDataPacket;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
use pocketmine\network\protocol\MoveEntityPacket;
|
||||
use pocketmine\network\protocol\SetEntityMotionPacket;
|
||||
use pocketmine\network\protocol\SetTimePacket;
|
||||
@ -1553,13 +1552,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
unset($players[$player->getLoaderId()]);
|
||||
}
|
||||
|
||||
$pk = new LevelEventPacket();
|
||||
$pk->evid = 2001;
|
||||
$pk->x = $target->x + 0.5;
|
||||
$pk->y = $target->y + 0.5;
|
||||
$pk->z = $target->z + 0.5;
|
||||
$pk->data = $target->getId() + ($target->getDamage() << 12);
|
||||
Server::broadcastPacket($players, $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
$this->addParticle(new DestroyBlockParticle($target->add(0.5), $target), $players);
|
||||
}
|
||||
|
||||
$target->onBreak($item);
|
||||
|
30
src/pocketmine/level/particle/AngryVillagerParticle.php
Normal file
30
src/pocketmine/level/particle/AngryVillagerParticle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class AngryVillagerParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 29);
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ class DestroyBlockParticle extends Particle{
|
||||
|
||||
public function encode(){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = 2001;
|
||||
$pk->evid = LevelEventPacket::EVENT_PARTICLE_DESTROY;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
30
src/pocketmine/level/particle/EnchantmentTableParticle.php
Normal file
30
src/pocketmine/level/particle/EnchantmentTableParticle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class EnchantmentTableParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 31);
|
||||
}
|
||||
}
|
@ -37,7 +37,7 @@ class GenericParticle extends Particle{
|
||||
|
||||
public function encode(){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = 0x4000 | $this->id;
|
||||
$pk->evid = LevelEventPacket::EVENT_ADD_PARTICLE_MASK | $this->id;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
30
src/pocketmine/level/particle/HappyVillagerParticle.php
Normal file
30
src/pocketmine/level/particle/HappyVillagerParticle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class HappyVillagerParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 30);
|
||||
}
|
||||
}
|
30
src/pocketmine/level/particle/HugeExplodeParticle.php
Normal file
30
src/pocketmine/level/particle/HugeExplodeParticle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class HugeExplodeParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 12);
|
||||
}
|
||||
}
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class InkParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, $scale = 0){
|
||||
parent::__construct($pos, 25, $scale);
|
||||
parent::__construct($pos, 26, $scale);
|
||||
}
|
||||
}
|
||||
|
30
src/pocketmine/level/particle/InstantEnchantParticle.php
Normal file
30
src/pocketmine/level/particle/InstantEnchantParticle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class InstantEnchantParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 25);
|
||||
}
|
||||
}
|
30
src/pocketmine/level/particle/LargeExplodeParticle.php
Normal file
30
src/pocketmine/level/particle/LargeExplodeParticle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class LargeExplodeParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 11);
|
||||
}
|
||||
}
|
@ -37,7 +37,7 @@ class MobSpawnParticle extends Particle{
|
||||
|
||||
public function encode(){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = 2004;
|
||||
$pk->evid = LevelEventPacket::EVENT_PARTICLE_SPAWN;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
30
src/pocketmine/level/particle/RainSplashParticle.php
Normal file
30
src/pocketmine/level/particle/RainSplashParticle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class RainSplashParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 28);
|
||||
}
|
||||
}
|
31
src/pocketmine/level/sound/AnvilBreakSound.php
Normal file
31
src/pocketmine/level/sound/AnvilBreakSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class AnvilBreakSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ANVIL_BREAK, $pitch);
|
||||
}
|
||||
}
|
31
src/pocketmine/level/sound/AnvilFallSound.php
Normal file
31
src/pocketmine/level/sound/AnvilFallSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class AnvilFallSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ANVIL_FALL, $pitch);
|
||||
}
|
||||
}
|
31
src/pocketmine/level/sound/AnvilUseSound.php
Normal file
31
src/pocketmine/level/sound/AnvilUseSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class AnvilUseSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ANVIL_USE, $pitch);
|
||||
}
|
||||
}
|
@ -22,9 +22,10 @@
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class BatSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, 1015, $pitch);
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_BAT_FLY, $pitch);
|
||||
}
|
||||
}
|
||||
|
31
src/pocketmine/level/sound/BlazeShootSound.php
Normal file
31
src/pocketmine/level/sound/BlazeShootSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class BlazeShootSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_BLAZE_SHOOT, $pitch);
|
||||
}
|
||||
}
|
@ -22,9 +22,10 @@
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class ClickSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, 1000, $pitch);
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_CLICK, $pitch);
|
||||
}
|
||||
}
|
||||
|
31
src/pocketmine/level/sound/DoorBumpSound.php
Normal file
31
src/pocketmine/level/sound/DoorBumpSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class DoorBumpSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_DOOR_BUMP, $pitch);
|
||||
}
|
||||
}
|
31
src/pocketmine/level/sound/DoorCrashSound.php
Normal file
31
src/pocketmine/level/sound/DoorCrashSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class DoorCrashSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_DOOR_CRASH, $pitch);
|
||||
}
|
||||
}
|
@ -22,9 +22,10 @@
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class DoorSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, 1003, $pitch);
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_DOOR, $pitch);
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,10 @@
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class FizzSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, 1004, $pitch);
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_FIZZ, $pitch);
|
||||
}
|
||||
}
|
||||
|
31
src/pocketmine/level/sound/GhastShootSound.php
Normal file
31
src/pocketmine/level/sound/GhastShootSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class GhastShootSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_GHAST_SHOOT, $pitch);
|
||||
}
|
||||
}
|
31
src/pocketmine/level/sound/GhastSound.php
Normal file
31
src/pocketmine/level/sound/GhastSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class GhastSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_GHAST, $pitch);
|
||||
}
|
||||
}
|
@ -22,9 +22,10 @@
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class LaunchSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, 1002, $pitch);
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_SHOOT, $pitch);
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,10 @@
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class PopSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, 1001, $pitch);
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_CLICK_FAIL, $pitch);
|
||||
}
|
||||
}
|
||||
|
31
src/pocketmine/level/sound/ZombieHealSound.php
Normal file
31
src/pocketmine/level/sound/ZombieHealSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class ZombieHealSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ZOMBIE_HEAL, $pitch);
|
||||
}
|
||||
}
|
31
src/pocketmine/level/sound/ZombieInfectSound.php
Normal file
31
src/pocketmine/level/sound/ZombieInfectSound.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\level\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class ZombieInfectSound extends GenericSound{
|
||||
public function __construct(Vector3 $pos, $pitch = 0){
|
||||
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ZOMBIE_INFECT, $pitch);
|
||||
}
|
||||
}
|
@ -28,6 +28,7 @@ use pocketmine\utils\Binary;
|
||||
#endif
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\utils\Utils;
|
||||
use pocketmine\utils\UUID;
|
||||
|
||||
|
||||
@ -234,6 +235,17 @@ abstract class DataPacket extends \stdClass{
|
||||
}
|
||||
|
||||
public function __debugInfo(){
|
||||
return bin2hex($this->buffer);
|
||||
$data = [];
|
||||
foreach($this as $k => $v){
|
||||
if($k === "buffer"){
|
||||
$data[$k] = bin2hex($v);
|
||||
}elseif(is_string($v) or (is_object($v) and method_exists($v, "__toString"))){
|
||||
$data[$k] = Utils::printable((string) $v);
|
||||
}else{
|
||||
$data[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,44 @@ namespace pocketmine\network\protocol;
|
||||
class LevelEventPacket extends DataPacket{
|
||||
const NETWORK_ID = Info::LEVEL_EVENT_PACKET;
|
||||
|
||||
const EVENT_SOUND_CLICK = 1000;
|
||||
const EVENT_SOUND_CLICK_FAIL = 1001;
|
||||
const EVENT_SOUND_SHOOT = 1002;
|
||||
const EVENT_SOUND_DOOR = 1003;
|
||||
const EVENT_SOUND_FIZZ = 1004;
|
||||
|
||||
const EVENT_SOUND_GHAST = 1007;
|
||||
const EVENT_SOUND_GHAST_SHOOT = 1008;
|
||||
const EVENT_SOUND_BLAZE_SHOOT = 1009;
|
||||
|
||||
const EVENT_SOUND_DOOR_BUMP = 1010;
|
||||
const EVENT_SOUND_DOOR_CRASH = 1012;
|
||||
|
||||
const EVENT_SOUND_BAT_FLY = 1015;
|
||||
const EVENT_SOUND_ZOMBIE_INFECT = 1016;
|
||||
const EVENT_SOUND_ZOMBIE_HEAL = 1017;
|
||||
|
||||
const EVENT_SOUND_ANVIL_BREAK = 1020;
|
||||
const EVENT_SOUND_ANVIL_USE = 1021;
|
||||
const EVENT_SOUND_ANVIL_FALL = 1022;
|
||||
|
||||
const EVENT_PARTICLE_SHOOT = 2000;
|
||||
const EVENT_PARTICLE_DESTROY = 2001;
|
||||
const EVENT_PARTICLE_SPLASH = 2002;
|
||||
const EVENT_PARTICLE_EYE_DESPAWN = 2003;
|
||||
const EVENT_PARTICLE_SPAWN = 2004;
|
||||
|
||||
const EVENT_START_RAIN = 3001;
|
||||
const EVENT_START_THUNDER = 3002;
|
||||
const EVENT_STOP_RAIN = 3003;
|
||||
const EVENT_STOP_THUNDER = 3004;
|
||||
|
||||
const EVENT_SET_DATA = 4000;
|
||||
|
||||
const EVENT_PLAYERS_SLEEPING = 9800;
|
||||
|
||||
const EVENT_ADD_PARTICLE_MASK = 0x4000;
|
||||
|
||||
public $evid;
|
||||
public $x;
|
||||
public $y;
|
||||
|
Loading…
x
Reference in New Issue
Block a user