From 5dd669e233d3d5d050db682ca06374cbc2a2db3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:15:56 +0000 Subject: [PATCH 1/3] Bump pocketmine/locale-data in the production-patch-updates group (#6827) --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index a556f1f34..0eb2f6d66 100644 --- a/composer.lock +++ b/composer.lock @@ -472,16 +472,16 @@ }, { "name": "pocketmine/locale-data", - "version": "2.25.1", + "version": "2.25.2", "source": { "type": "git", "url": "https://github.com/pmmp/Language.git", - "reference": "8e6514f5a9638e69cdc2219c775fc7d3bb4c9fdd" + "reference": "44727765ad43df5e2e24a54ae70a70607ec7d488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/Language/zipball/8e6514f5a9638e69cdc2219c775fc7d3bb4c9fdd", - "reference": "8e6514f5a9638e69cdc2219c775fc7d3bb4c9fdd", + "url": "https://api.github.com/repos/pmmp/Language/zipball/44727765ad43df5e2e24a54ae70a70607ec7d488", + "reference": "44727765ad43df5e2e24a54ae70a70607ec7d488", "shasum": "" }, "type": "library", @@ -489,9 +489,9 @@ "description": "Language resources used by PocketMine-MP", "support": { "issues": "https://github.com/pmmp/Language/issues", - "source": "https://github.com/pmmp/Language/tree/2.25.1" + "source": "https://github.com/pmmp/Language/tree/2.25.2" }, - "time": "2025-04-16T11:15:32+00:00" + "time": "2025-10-03T22:34:06+00:00" }, { "name": "pocketmine/log", From 5a4d820058b60f1ce98c875f954d84a18a4d89a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 13:14:50 +0000 Subject: [PATCH 2/3] Bump build/php from `8fe1873` to `2714034` (#6825) --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index 8fe187335..271403457 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit 8fe187335f666b8fb251927940f66ef372bfd3a6 +Subproject commit 2714034579b9b614df56da8f44cb5cbe067aa608 From 3ce1b2fdb13905e78f01ecd5f7f4bd0dd302b70f Mon Sep 17 00:00:00 2001 From: Wraith Date: Mon, 6 Oct 2025 17:05:52 +0100 Subject: [PATCH 3/3] Implement exposure calculation for explosions (#6826) Co-authored-by: Dylan T. --- src/world/Explosion.php | 53 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/src/world/Explosion.php b/src/world/Explosion.php index 9e83d06be..88968a77e 100644 --- a/src/world/Explosion.php +++ b/src/world/Explosion.php @@ -38,6 +38,7 @@ use pocketmine\item\VanillaItems; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; +use pocketmine\math\VoxelRayTrace; use pocketmine\utils\AssumptionFailedError; use pocketmine\utils\Utils; use pocketmine\world\format\SubChunk; @@ -218,8 +219,9 @@ class Explosion{ if($distance <= 1){ $motion = $entityPos->subtractVector($this->source)->normalize(); + $exposure = $this->getExposure($this->source, $entity); - $impact = (1 - $distance) * ($exposure = 1); + $impact = (1 - $distance) * $exposure; $damage = (int) ((($impact * $impact + $impact) / 2) * 8 * $explosionSize + 1); @@ -269,6 +271,51 @@ class Explosion{ return true; } + /** + * Returns the explosion exposure of an entity, used to calculate explosion impact. + */ + private function getExposure(Vector3 $origin, Entity $entity) : float{ + $bb = $entity->getBoundingBox(); + + $diff = (new Vector3($bb->getXLength(), $bb->getYLength(), $bb->getZLength()))->multiply(2)->add(1, 1, 1); + $step = new Vector3(1.0 / $diff->x, 1.0 / $diff->y, 1.0 / $diff->z); + + $xOffset = (1.0 - (floor($diff->x) / $diff->x)) / 2.0; + $zOffset = (1.0 - (floor($diff->z) / $diff->z)) / 2.0; + + $checks = 0.0; + $hits = 0.0; + + for($x = 0.0; $x <= 1.0; $x += $step->x){ + for($y = 0.0; $y <= 1.0; $y += $step->y){ + for($z = 0.0; $z <= 1.0; $z += $step->z){ + $point = new Vector3( + self::lerp($x, $bb->minX, $bb->maxX) + $xOffset, + self::lerp($y, $bb->minY, $bb->maxY), + self::lerp($z, $bb->minZ, $bb->maxZ) + $zOffset + ); + + $intercepted = false; + + foreach(VoxelRayTrace::betweenPoints($origin, $point) as $pos){ + $block = $this->world->getBlock($pos); + if($block->calculateIntercept($origin, $point) !== null){ + $intercepted = true; + break; + } + } + + if(!$intercepted){ + $hits++; + } + $checks++; + } + } + } + + return $checks > 0.0 ? $hits / $checks : 0.0; + } + /** * Sets a chance between 0 and 1 of creating a fire. * For example, if the chance is 1/3, then that amount of affected blocks will be ignited. @@ -282,4 +329,8 @@ class Explosion{ } $this->fireChance = $fireChance; } + + private static function lerp(float $scale, float $a, float $b) : float{ + return $a + $scale * ($b - $a); + } }