From 742f86e022e2ae8881f59bc9157b6219cf4d4499 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 6 May 2021 18:33:18 +0100 Subject: [PATCH] Rename DestroyBlockParticle -> BlockBreakParticle closes #3461 literally every other particle/sound has the subject first, followed by the (optional) verb, and finally Particle (or Sound). In addition, we refer to breaking blocks as 'break' everywhere except here, where we refer to it as 'destroy'. --- changelogs/4.0-snapshot.md | 1 + src/entity/object/Painting.php | 4 ++-- src/world/World.php | 4 ++-- .../{DestroyBlockParticle.php => BlockBreakParticle.php} | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) rename src/world/particle/{DestroyBlockParticle.php => BlockBreakParticle.php} (96%) diff --git a/changelogs/4.0-snapshot.md b/changelogs/4.0-snapshot.md index 9bab171cb..86a39f10c 100644 --- a/changelogs/4.0-snapshot.md +++ b/changelogs/4.0-snapshot.md @@ -956,6 +956,7 @@ This version features substantial changes to the network system, improving coher - `Location` has been moved to `pocketmine\entity\Location`. #### Particles +- `DestroyBlockParticle` has been renamed to `BlockBreakParticle` for consistency. - `DustParticle->__construct()` now accepts a `pocketmine\utils\Color` object instead of `r, g, b, a`. - `pocketmine\world\particle\Particle` no longer extends `pocketmine\math\Vector3`, and has been converted to an interface. - Added the following `Particle` classes: diff --git a/src/entity/object/Painting.php b/src/entity/object/Painting.php index ab34e7aee..4769df15d 100644 --- a/src/entity/object/Painting.php +++ b/src/entity/object/Painting.php @@ -36,7 +36,7 @@ use pocketmine\nbt\tag\CompoundTag; use pocketmine\network\mcpe\protocol\AddPaintingPacket; use pocketmine\network\mcpe\protocol\types\entity\EntityIds; use pocketmine\player\Player; -use pocketmine\world\particle\DestroyBlockParticle; +use pocketmine\world\particle\BlockBreakParticle; use pocketmine\world\World; use function ceil; @@ -116,7 +116,7 @@ class Painting extends Entity{ //non-living entities don't have a way to create drops generically yet $this->getWorld()->dropItem($this->location, VanillaItems::PAINTING()); } - $this->getWorld()->addParticle($this->location->add(0.5, 0.5, 0.5), new DestroyBlockParticle(VanillaBlocks::OAK_PLANKS())); + $this->getWorld()->addParticle($this->location->add(0.5, 0.5, 0.5), new BlockBreakParticle(VanillaBlocks::OAK_PLANKS())); } protected function recalculateBoundingBox() : void{ diff --git a/src/world/World.php b/src/world/World.php index 081eb1cdb..dd76efde0 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -82,7 +82,7 @@ use pocketmine\world\generator\PopulationTask; use pocketmine\world\light\BlockLightUpdate; use pocketmine\world\light\LightPopulationTask; use pocketmine\world\light\SkyLightUpdate; -use pocketmine\world\particle\DestroyBlockParticle; +use pocketmine\world\particle\BlockBreakParticle; use pocketmine\world\particle\Particle; use pocketmine\world\sound\BlockPlaceSound; use pocketmine\world\sound\Sound; @@ -1699,7 +1699,7 @@ class World implements ChunkManager{ private function destroyBlockInternal(Block $target, Item $item, ?Player $player = null, bool $createParticles = false) : void{ if($createParticles){ - $this->addParticle($target->getPos()->add(0.5, 0.5, 0.5), new DestroyBlockParticle($target)); + $this->addParticle($target->getPos()->add(0.5, 0.5, 0.5), new BlockBreakParticle($target)); } $target->onBreak($item, $player); diff --git a/src/world/particle/DestroyBlockParticle.php b/src/world/particle/BlockBreakParticle.php similarity index 96% rename from src/world/particle/DestroyBlockParticle.php rename to src/world/particle/BlockBreakParticle.php index aeda3f484..bf3c23511 100644 --- a/src/world/particle/DestroyBlockParticle.php +++ b/src/world/particle/BlockBreakParticle.php @@ -28,7 +28,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\convert\RuntimeBlockMapping; use pocketmine\network\mcpe\protocol\LevelEventPacket; -class DestroyBlockParticle implements Particle{ +class BlockBreakParticle implements Particle{ /** @var Block */ private $block;