mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 11:16:57 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
a8d5e8c5f6 | |||
089e62b44e | |||
f1cc168d26 | |||
f6e53f826b | |||
986b4e0651 | |||
dc07ac33d3 | |||
9c5cec77b1 |
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -272,10 +272,10 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP and tools
|
||||
uses: shivammathur/setup-php@2.12.0
|
||||
uses: shivammathur/setup-php@2.15.0
|
||||
with:
|
||||
php-version: 8.0
|
||||
tools: php-cs-fixer
|
||||
tools: php-cs-fixer:3.2
|
||||
|
||||
- name: Run PHP-CS-Fixer
|
||||
run: php-cs-fixer fix --dry-run --diff
|
||||
|
@ -62,6 +62,11 @@ return (new PhpCsFixer\Config)
|
||||
],
|
||||
'sort_algorithm' => 'alpha'
|
||||
],
|
||||
'phpdoc_line_span' => [
|
||||
'property' => 'single',
|
||||
'method' => null,
|
||||
'const' => null
|
||||
],
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_trim_consecutive_blank_line_separation' => true,
|
||||
'single_import_per_statement' => true,
|
||||
|
@ -9,3 +9,8 @@ Plugin developers should **only** update their required API to this version if y
|
||||
# 3.25.0
|
||||
- Added support for Minecraft: Bedrock Edition 1.17.40.
|
||||
- Removed compatibility with earlier versions.
|
||||
|
||||
# 3.25.1
|
||||
- Fixed autosave bug that caused unmodified chunks to be saved at least once (during the first autosave after they were loaded).
|
||||
- `Entity->spawnTo()` now has an additional sanity check for matching worlds (might expose a few new errors in plugins).
|
||||
- Fixed a missing field in `CraftRecipeAuto` item stack request type.
|
||||
|
@ -34,6 +34,9 @@ parameters:
|
||||
analyseAndScan:
|
||||
- build/php
|
||||
- build/preprocessor
|
||||
analyse:
|
||||
- src/pocketmine/block/StoneSlab.php #overrides STONE constant
|
||||
- src/pocketmine/item/Potion.php #overrides WATER constant
|
||||
dynamicConstantNames:
|
||||
- pocketmine\DEBUG
|
||||
- pocketmine\IS_DEVELOPMENT_BUILD
|
||||
|
@ -563,7 +563,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
}
|
||||
|
||||
public function spawnTo(Player $player) : void{
|
||||
if($this->spawned and $player->spawned and $this->isAlive() and $player->isAlive() and $player->getLevelNonNull() === $this->level and $player->canSee($this) and !$this->isSpectator()){
|
||||
if($this->spawned and $player->spawned and $this->isAlive() and $player->isAlive() and $player->canSee($this) and !$this->isSpectator()){
|
||||
parent::spawnTo($player);
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){
|
||||
const _VERSION_INFO_INCLUDED = true;
|
||||
|
||||
const NAME = "PocketMine-MP";
|
||||
const BASE_VERSION = "3.25.0";
|
||||
const BASE_VERSION = "3.25.1";
|
||||
const IS_DEVELOPMENT_BUILD = false;
|
||||
const BUILD_NUMBER = 0;
|
||||
const BUILD_CHANNEL = "stable";
|
||||
|
@ -1950,6 +1950,9 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
}
|
||||
|
||||
public function spawnTo(Player $player) : void{
|
||||
if($player->getLevelNonNull() !== $this->level){
|
||||
throw new \InvalidArgumentException("Player is not in the same world");
|
||||
}
|
||||
if(
|
||||
!isset($this->hasSpawned[$player->getLoaderId()]) and
|
||||
$this->chunk !== null and
|
||||
|
@ -135,6 +135,7 @@ class Anvil extends McRegion{
|
||||
$result->setLightPopulated($chunk->getByte("LightPopulated", 0) !== 0);
|
||||
$result->setPopulated($chunk->getByte("TerrainPopulated", 0) !== 0);
|
||||
$result->setGenerated();
|
||||
$result->setChanged(false);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -201,6 +201,7 @@ class McRegion extends BaseLevelProvider{
|
||||
$result->setLightPopulated($chunk->getByte("LightPopulated", 0) !== 0);
|
||||
$result->setPopulated($chunk->getByte("TerrainPopulated", 0) !== 0);
|
||||
$result->setGenerated(true);
|
||||
$result->setChanged(false);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -23,12 +23,38 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol\types\inventory\stackrequest;
|
||||
|
||||
use pocketmine\network\mcpe\NetworkBinaryStream;
|
||||
|
||||
/**
|
||||
* Tells that the current transaction crafted the specified recipe, using the recipe book. This is effectively the same
|
||||
* as the regular crafting result action.
|
||||
*/
|
||||
final class CraftRecipeAutoStackRequestAction extends ItemStackRequestAction{
|
||||
use CraftRecipeStackRequestActionTrait;
|
||||
|
||||
/** @var int */
|
||||
private $recipeId;
|
||||
/** @var int */
|
||||
private $repetitions;
|
||||
|
||||
final public function __construct(int $recipeId, int $repetitions){
|
||||
$this->recipeId = $recipeId;
|
||||
$this->repetitions = $repetitions;
|
||||
}
|
||||
|
||||
public function getRecipeId() : int{ return $this->recipeId; }
|
||||
|
||||
public function getRepetitions() : int{ return $this->repetitions; }
|
||||
|
||||
public static function getTypeId() : int{ return ItemStackRequestActionType::CRAFTING_RECIPE_AUTO; }
|
||||
|
||||
public static function read(NetworkBinaryStream $in) : self{
|
||||
$recipeId = $in->readGenericTypeNetworkId();
|
||||
$repetitions = $in->getByte();
|
||||
return new self($recipeId, $repetitions);
|
||||
}
|
||||
|
||||
public function write(NetworkBinaryStream $out) : void{
|
||||
$out->writeGenericTypeNetworkId($this->recipeId);
|
||||
$out->putByte($this->repetitions);
|
||||
}
|
||||
}
|
||||
|
@ -23,11 +23,30 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol\types\inventory\stackrequest;
|
||||
|
||||
use pocketmine\network\mcpe\NetworkBinaryStream;
|
||||
|
||||
/**
|
||||
* Tells that the current transaction crafted the specified recipe.
|
||||
*/
|
||||
final class CraftRecipeStackRequestAction extends ItemStackRequestAction{
|
||||
use CraftRecipeStackRequestActionTrait;
|
||||
|
||||
/** @var int */
|
||||
private $recipeId;
|
||||
|
||||
final public function __construct(int $recipeId){
|
||||
$this->recipeId = $recipeId;
|
||||
}
|
||||
|
||||
public function getRecipeId() : int{ return $this->recipeId; }
|
||||
|
||||
public static function getTypeId() : int{ return ItemStackRequestActionType::CRAFTING_RECIPE; }
|
||||
|
||||
public static function read(NetworkBinaryStream $in) : self{
|
||||
$recipeId = $in->readGenericTypeNetworkId();
|
||||
return new self($recipeId);
|
||||
}
|
||||
|
||||
public function write(NetworkBinaryStream $out) : void{
|
||||
$out->writeGenericTypeNetworkId($this->recipeId);
|
||||
}
|
||||
}
|
||||
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol\types\inventory\stackrequest;
|
||||
|
||||
use pocketmine\network\mcpe\NetworkBinaryStream;
|
||||
|
||||
trait CraftRecipeStackRequestActionTrait{
|
||||
|
||||
/** @var int */
|
||||
private $recipeId;
|
||||
|
||||
final public function __construct(int $recipeId){
|
||||
$this->recipeId = $recipeId;
|
||||
}
|
||||
|
||||
public function getRecipeId() : int{ return $this->recipeId; }
|
||||
|
||||
public static function read(NetworkBinaryStream $in) : self{
|
||||
$recipeId = $in->readGenericTypeNetworkId();
|
||||
return new self($recipeId);
|
||||
}
|
||||
|
||||
public function write(NetworkBinaryStream $out) : void{
|
||||
$out->writeGenericTypeNetworkId($this->recipeId);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user