Updated BedrockProtocol

This commit is contained in:
Dylan K. Taylor
2021-10-23 23:54:49 +01:00
parent 701a71a4ee
commit 04aedc6494
71 changed files with 175 additions and 104 deletions

View File

@ -27,6 +27,7 @@ use pocketmine\block\Block;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\convert\RuntimeBlockMapping;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\LevelEvent;
class BlockBreakParticle implements Particle{
@ -38,6 +39,6 @@ class BlockBreakParticle implements Particle{
}
public function encode(Vector3 $pos) : array{
return [LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_DESTROY, RuntimeBlockMapping::getInstance()->toRuntimeId($this->block->getFullId()), $pos)];
return [LevelEventPacket::create(LevelEvent::PARTICLE_DESTROY, RuntimeBlockMapping::getInstance()->toRuntimeId($this->block->getFullId()), $pos)];
}
}

View File

@ -27,6 +27,7 @@ use pocketmine\block\Block;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\convert\RuntimeBlockMapping;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\LevelEvent;
/**
* This particle appears when a player is attacking a block face in survival mode attempting to break it.
@ -44,6 +45,6 @@ class BlockPunchParticle implements Particle{
}
public function encode(Vector3 $pos) : array{
return [LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_PUNCH_BLOCK, RuntimeBlockMapping::getInstance()->toRuntimeId($this->block->getFullId()) | ($this->face << 24), $pos)];
return [LevelEventPacket::create(LevelEvent::PARTICLE_PUNCH_BLOCK, RuntimeBlockMapping::getInstance()->toRuntimeId($this->block->getFullId()) | ($this->face << 24), $pos)];
}
}

View File

@ -25,6 +25,7 @@ namespace pocketmine\world\particle;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\LevelEvent;
use function abs;
class DragonEggTeleportParticle implements Particle{
@ -57,6 +58,6 @@ class DragonEggTeleportParticle implements Particle{
(abs($this->yDiff) << 8) |
abs($this->zDiff);
return [LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_DRAGON_EGG_TELEPORT, $data, $pos)];
return [LevelEventPacket::create(LevelEvent::PARTICLE_DRAGON_EGG_TELEPORT, $data, $pos)];
}
}

View File

@ -25,10 +25,11 @@ namespace pocketmine\world\particle;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\LevelEvent;
class EndermanTeleportParticle implements Particle{
public function encode(Vector3 $pos) : array{
return [LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_ENDERMAN_TELEPORT, 0, $pos)];
return [LevelEventPacket::create(LevelEvent::PARTICLE_ENDERMAN_TELEPORT, 0, $pos)];
}
}

View File

@ -25,6 +25,7 @@ namespace pocketmine\world\particle;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\LevelEvent;
class MobSpawnParticle implements Particle{
/** @var int */
@ -39,6 +40,6 @@ class MobSpawnParticle implements Particle{
}
public function encode(Vector3 $pos) : array{
return [LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_SPAWN, ($this->width & 0xff) | (($this->height & 0xff) << 8), $pos)];
return [LevelEventPacket::create(LevelEvent::PARTICLE_SPAWN, ($this->width & 0xff) | (($this->height & 0xff) << 8), $pos)];
}
}

View File

@ -26,6 +26,7 @@ namespace pocketmine\world\particle;
use pocketmine\color\Color;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\LevelEvent;
class PotionSplashParticle implements Particle{
@ -50,6 +51,6 @@ class PotionSplashParticle implements Particle{
}
public function encode(Vector3 $pos) : array{
return [LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_SPLASH, $this->color->toARGB(), $pos)];
return [LevelEventPacket::create(LevelEvent::PARTICLE_SPLASH, $this->color->toARGB(), $pos)];
}
}