diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 81176227c..e4356396b 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -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){ diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index 70e2a27b6..98b4e3302 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -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. diff --git a/src/pocketmine/block/Door.php b/src/pocketmine/block/Door.php index c8ac0e7f4..2f44366c6 100644 --- a/src/pocketmine/block/Door.php +++ b/src/pocketmine/block/Door.php @@ -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; diff --git a/src/pocketmine/command/defaults/ParticleCommand.php b/src/pocketmine/command/defaults/ParticleCommand.php index 25c2f0e11..34eb08997 100644 --- a/src/pocketmine/command/defaults/ParticleCommand.php +++ b/src/pocketmine/command/defaults/ParticleCommand.php @@ -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); } diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index dbf5e89a3..2136e309c 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -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); diff --git a/src/pocketmine/level/particle/AngryVillagerParticle.php b/src/pocketmine/level/particle/AngryVillagerParticle.php new file mode 100644 index 000000000..9722b40fa --- /dev/null +++ b/src/pocketmine/level/particle/AngryVillagerParticle.php @@ -0,0 +1,30 @@ +evid = 2001; + $pk->evid = LevelEventPacket::EVENT_PARTICLE_DESTROY; $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; diff --git a/src/pocketmine/level/particle/EnchantmentTableParticle.php b/src/pocketmine/level/particle/EnchantmentTableParticle.php new file mode 100644 index 000000000..3872fded9 --- /dev/null +++ b/src/pocketmine/level/particle/EnchantmentTableParticle.php @@ -0,0 +1,30 @@ +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; diff --git a/src/pocketmine/level/particle/HappyVillagerParticle.php b/src/pocketmine/level/particle/HappyVillagerParticle.php new file mode 100644 index 000000000..035ace6b2 --- /dev/null +++ b/src/pocketmine/level/particle/HappyVillagerParticle.php @@ -0,0 +1,30 @@ +evid = 2004; + $pk->evid = LevelEventPacket::EVENT_PARTICLE_SPAWN; $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; diff --git a/src/pocketmine/level/particle/RainSplashParticle.php b/src/pocketmine/level/particle/RainSplashParticle.php new file mode 100644 index 000000000..75ad4dba5 --- /dev/null +++ b/src/pocketmine/level/particle/RainSplashParticle.php @@ -0,0 +1,30 @@ +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; } } diff --git a/src/pocketmine/network/protocol/LevelEventPacket.php b/src/pocketmine/network/protocol/LevelEventPacket.php index d34bc3225..de8184563 100644 --- a/src/pocketmine/network/protocol/LevelEventPacket.php +++ b/src/pocketmine/network/protocol/LevelEventPacket.php @@ -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;