Merge 'stable' into 'minor-next'

Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11802296296
This commit is contained in:
github-actions
2024-11-12 17:14:24 +00:00
5 changed files with 14 additions and 4 deletions

View File

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

View File

@ -42,7 +42,7 @@ class ArmorInventory extends SimpleInventory{
){
parent::__construct(4);
$this->validators->add(new CallbackSlotValidator($this->validate(...)));
$this->validators->add(new CallbackSlotValidator(self::validate(...)));
}
public function getHolder() : Living{
@ -81,7 +81,7 @@ class ArmorInventory extends SimpleInventory{
$this->setItem(self::SLOT_FEET, $boots);
}
private function validate(Inventory $inventory, Item $item, int $slot) : ?TransactionValidationException{
private static function validate(Inventory $inventory, Item $item, int $slot) : ?TransactionValidationException{
if($item instanceof Armor){
if($item->getArmorSlot() !== $slot){
return new TransactionValidationException("Armor item is in wrong slot");