Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2022-11-07 15:04:48 +00:00
commit 824ed0a56a
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
8 changed files with 33 additions and 7 deletions

View File

@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.21.2
uses: shivammathur/setup-php@2.22.0
with:
php-version: 8.0

View File

@ -18,7 +18,7 @@ jobs:
submodules: true
- name: Setup PHP
uses: shivammathur/setup-php@2.21.2
uses: shivammathur/setup-php@2.22.0
with:
php-version: 8.0

View File

@ -195,7 +195,7 @@ jobs:
- uses: actions/checkout@v3
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.21.2
uses: shivammathur/setup-php@2.22.0
with:
php-version: 8.0
tools: php-cs-fixer:3.11

View File

@ -11,4 +11,28 @@ Released 26th October 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.19.40.
- Removed support for older versions.
- Removed support for older versions.
## Fixes
- Fixed incorrect command descriptions showing in `/help` when multiple commands use the same name. Previously, the most recently registered command would show, even though it wouldn't actually be invoked.
- Fixed splash potions affecting players in spectator mode.
- Fixed `World->addParticle()` sending particles to players who couldn't possibly see them when a list of targets was used.
- Fixed `World->addSound()` sending sounds to players who couldn't possibly hear them when a list of targets was used.
## Documentation
- Improved type information available for various API methods in `World`.
# 4.10.1
Released 7th November 2022.
## Fixes
- Fixed spawning in the void if spawn terrain in a world is solid at the default spawn position.
- Fixed totems of undying activating when the player has 1 HP remaining.
- Fixed durable items such as tools becoming unbreakable when in stacks larger than 1. Now, the durability correctly resets when the tool breaks.
- TPS below 12 now correctly shows as red in `/status`. Previously, it showed as orange due to a condition ordering bug.
- Improved handling of missing arguments in user-defined `pocketmine.yml` command aliases. Previously, missing arguments would be filled with an empty string, which caused a variety of unexpected behaviour.
## Internals
- Added validation for the array given to `BaseInventory->setContents()` to ensure that it contains only `Item` instances.
- Silenced `PlayerAuthInputPacket` spam when the session is in the "spawn response" state.
- Updated to PHPStan 1.9.

View File

@ -31,7 +31,7 @@ use function str_repeat;
final class VersionInfo{
public const NAME = "PocketMine-MP";
public const BASE_VERSION = "4.10.1";
public const BASE_VERSION = "4.10.2";
public const IS_DEVELOPMENT_BUILD = true;
public const BUILD_CHANNEL = "beta";

View File

@ -356,7 +356,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
&& ($this->inventory->getItemInHand() instanceof Totem || $this->offHandInventory->getItem(0) instanceof Totem)){
$compensation = $this->getHealth() - $source->getFinalDamage() - 1;
if($compensation < 0){
if($compensation <= -1){
$source->setModifier($compensation, EntityDamageEvent::MODIFIER_TOTEM);
}
}

View File

@ -27,6 +27,7 @@ use pocketmine\item\Item;
use pocketmine\item\VanillaItems;
use pocketmine\player\Player;
use pocketmine\utils\ObjectSet;
use pocketmine\utils\Utils;
use function array_slice;
use function count;
use function max;
@ -85,6 +86,7 @@ abstract class BaseInventory implements Inventory{
* @phpstan-param array<int, Item> $items
*/
public function setContents(array $items) : void{
Utils::validateArrayValueType($items, function(Item $item) : void{});
if(count($items) > $this->getSize()){
$items = array_slice($items, 0, $this->getSize(), true);
}

View File

@ -2784,8 +2784,8 @@ class World implements ChunkManager{
if($this->getBlockAt($x, $y, $z)->isFullCube()){
if($wasAir){
$y++;
break;
}
break;
}else{
$wasAir = true;
}