Merge branch 'stable' into minor-next

This commit is contained in:
Dylan K. Taylor 2023-06-26 16:08:22 +01:00
commit 2654fb294b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
9 changed files with 29 additions and 9 deletions

View File

@ -53,7 +53,7 @@ jobs:
run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT
- name: Build image for tag
uses: docker/build-push-action@v4.1.0
uses: docker/build-push-action@v4.1.1
with:
push: true
context: ./pocketmine-mp
@ -66,7 +66,7 @@ jobs:
- name: Build image for major tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v4.1.0
uses: docker/build-push-action@v4.1.1
with:
push: true
context: ./pocketmine-mp
@ -79,7 +79,7 @@ jobs:
- name: Build image for minor tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v4.1.0
uses: docker/build-push-action@v4.1.1
with:
push: true
context: ./pocketmine-mp
@ -92,7 +92,7 @@ jobs:
- name: Build image for latest tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v4.1.0
uses: docker/build-push-action@v4.1.1
with:
push: true
context: ./pocketmine-mp

@ -1 +1 @@
Subproject commit 8cb2a2b2181fd42192665985696ea157aa4f731e
Subproject commit 2a21c579007a8fd7244f9faad498cd1c8c33004c

View File

@ -467,7 +467,8 @@ class Block{
/**
* Do actions when interacted by Item. Returns if it has done anything
*
* @param Item[] &$returnedItems Items to be added to the target's inventory (or dropped, if the inventory is full)
* @param Vector3 $clickVector Exact position where the click occurred, relative to the block's integer position
* @param Item[] &$returnedItems Items to be added to the target's inventory (or dropped, if the inventory is full)
*/
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
return false;

View File

@ -64,7 +64,7 @@ class CakeWithCandle extends BaseCake{
}
public function getPickedItem(bool $addUserData = false) : Item{
return VanillaBlocks::CAKE()->getPickedItem($addUserData);
return VanillaBlocks::CAKE()->asItem();
}
public function getResidue() : Block{

View File

@ -40,6 +40,7 @@ final class BlockStateUpgradeSchemaModelBlockRemap{
/**
* @var BlockStateUpgradeSchemaModelTag[]|null
* @phpstan-var array<string, BlockStateUpgradeSchemaModelTag>|null
* @required
*/
public ?array $newState;

View File

@ -43,7 +43,12 @@ class BlockPlaceEvent extends Event implements Cancellable{
protected BlockTransaction $transaction,
protected Block $blockAgainst,
protected Item $item
){}
){
$world = $this->blockAgainst->getPosition()->getWorld();
foreach($this->transaction->getBlocks() as [$x, $y, $z, $block]){
$block->position($world, $x, $y, $z);
}
}
/**
* Returns the player who is placing the block.

View File

@ -1129,7 +1129,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
}
/**
* Sets the gamemode, and if needed, kicks the Player.
* Sets the provided gamemode.
*/
public function setGamemode(GameMode $gm) : bool{
if($this->gamemode->equals($gm)){

View File

@ -2032,6 +2032,12 @@ class World implements ChunkManager{
if($clickVector === null){
$clickVector = new Vector3(0.0, 0.0, 0.0);
}else{
$clickVector = new Vector3(
min(1.0, max(0.0, $clickVector->x)),
min(1.0, max(0.0, $clickVector->y)),
min(1.0, max(0.0, $clickVector->z))
);
}
if(!$this->isInWorld($blockReplace->getPosition()->x, $blockReplace->getPosition()->y, $blockReplace->getPosition()->z)){

View File

@ -43,6 +43,7 @@ use pocketmine\world\WorldCreationOptions;
use Symfony\Component\Filesystem\Path;
use function array_map;
use function file_put_contents;
use function sprintf;
use function strlen;
use function substr;
use function time;
@ -154,12 +155,18 @@ class BedrockWorldData extends BaseNbtWorldData{
}
$version = $worldData->getInt(self::TAG_STORAGE_VERSION, Limits::INT32_MAX);
if($version === Limits::INT32_MAX){
throw new CorruptedWorldException(sprintf("Missing '%s' tag in level.dat", self::TAG_STORAGE_VERSION));
}
if($version > self::CURRENT_STORAGE_VERSION){
throw new UnsupportedWorldFormatException("LevelDB world format version $version is currently unsupported");
}
//StorageVersion is rarely updated - instead, the game relies on the NetworkVersion tag, which is synced with
//the network protocol version for that version.
$protocolVersion = $worldData->getInt(self::TAG_NETWORK_VERSION, Limits::INT32_MAX);
if($protocolVersion === Limits::INT32_MAX){
throw new CorruptedWorldException(sprintf("Missing '%s' tag in level.dat", self::TAG_NETWORK_VERSION));
}
if($protocolVersion > self::CURRENT_STORAGE_NETWORK_VERSION){
throw new UnsupportedWorldFormatException("LevelDB world protocol version $protocolVersion is currently unsupported");
}