Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'pmmp-stable' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
SenseiTarzan committed Dec 17, 2023
2 parents 6f4026a + d0da371 commit 91370f7
Show file tree
Hide file tree
Showing 58 changed files with 694 additions and 275 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/discord-release-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup PHP and tools
uses: shivammathur/[email protected]
with:
php-version: 8.1
php-version: 8.2

- name: Restore Composer package cache
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [8.1]
php-version: [8.2]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
> build_info.json
- name: Upload release artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: release_artifacts
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- name: Setup PHP and tools
uses: shivammathur/[email protected]
with:
php-version: 8.1
tools: php-cs-fixer:3.17
php-version: 8.2
tools: php-cs-fixer:3.38
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Pre-requisites
- A bash shell (git bash is sufficient for Windows)
- [`git`](https://git-scm.com) available in your shell
- PHP 8.1 or newer available in your shell
- PHP 8.2 or newer available in your shell
- [`composer`](https://getcomposer.org) available in your shell

## Custom PHP binaries
Expand Down
2 changes: 1 addition & 1 deletion build/php
Submodule php updated from b0ffbd to 73e595
46 changes: 46 additions & 0 deletions changelogs/5.10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 5.10.0
Released 14th December 2023.

**For Minecraft: Bedrock Edition 1.20.50**

This is a minor feature release, including new gameplay features and minor performance improvements.

**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
Do not update plugin minimum API versions unless you need new features added in this release.

**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.

## General
- PHP 8.2 is now used by default. PHP 8.1 is still supported, but will be removed in a future 5.x release.
- Improved timings reports by removing `Breakdown` timings group. This group serves no purpose with tree timings and made for confusing reading.

## Performance
- Improved performance of `Block::encodeFullState()` in most conditions. This in turn improves performance of `World::setBlock()` and `World::setBlockAt()`.
- Improved network compression performance by avoiding unnecessary object allocations.
- Timings now report time spent in individual `Snooze` handlers, making it easier to debug performance issues.

## Gameplay
### Blocks
- Implemented crop growth speed modifiers.
- The following things now positively affect crop growth speed:
- Being planted on or being adjacent to farmland (hydrated farmland offers a larger benefit than dry farmland)
- Potential light level of at least 9
- Being planted in rows with space between them (or a different type of crop)
- The following things now negatively affect crop growth speed:
- Improper arrangement (e.g. the same crop on all sides)
- Insufficient light level (below 9)
- Poorly arranged crops will grow slower in this version. Past versions behaved as if crops were always planted in ideal conditions.
- Crops planted in ideal conditions will grow at the same speed as before.

### Items
- Added the following new items:
- All types of Smithing Template
- Pitcher Pod is now correctly registered. In previous versions, it was mapped to the Pitcher Crop block, causing incorrect name display in commands.

## Internals
- Cleaned up various getter usages where direct property access is possible.
- Avoided unnecessary repeated getter calls in some loops.
- `NetworkSession` may now track `string` instead of `CompressBatchPromise` when a batch was synchronously compressed. This significantly reduces object allocations and improves performance.
- `NetworkSession` now sends less information to clients on login validation failure. This avoids leaking potentially sensitive error information to clients.
- Clients can correlate their disconnects with server-side logs using the `Error ID` shown on the disconnect screen.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.40",
"phpstan/phpstan": "1.10.46",
"phpstan/phpstan": "1.10.50",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^10.5.0"
Expand Down
48 changes: 48 additions & 0 deletions src/BootstrapOptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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;

/**
* Constants for all the command-line options that PocketMine-MP supports.
* Other options not listed here can be used to override server.properties and pocketmine.yml values temporarily.
*
* @internal
*/
final class BootstrapOptions{

private function __construct(){
//NOOP
}

/** Disables the setup wizard on first startup */
public const NO_WIZARD = "no-wizard";
/** Force-disables console text colour and formatting */
public const DISABLE_ANSI = "disable-ansi";
/** Force-enables console text colour and formatting */
public const ENABLE_ANSI = "enable-ansi";
/** Path to look in for plugins */
public const PLUGINS = "plugins";
/** Path to store and load server data */
public const DATA = "data";
}
12 changes: 6 additions & 6 deletions src/PocketMine.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ function server(){
ErrorToExceptionHandler::set();

$cwd = Utils::assumeNotFalse(realpath(Utils::assumeNotFalse(getcwd())));
$dataPath = getopt_string("data") ?? $cwd;
$pluginPath = getopt_string("plugins") ?? $cwd . DIRECTORY_SEPARATOR . "plugins";
$dataPath = getopt_string(BootstrapOptions::DATA) ?? $cwd;
$pluginPath = getopt_string(BootstrapOptions::PLUGINS) ?? $cwd . DIRECTORY_SEPARATOR . "plugins";
Filesystem::addCleanedPath($pluginPath, Filesystem::CLEAN_PATH_PLUGINS_PREFIX);

if(!@mkdir($dataPath, 0777, true) && !is_dir($dataPath)){
Expand Down Expand Up @@ -308,10 +308,10 @@ function server(){
//Logger has a dependency on timezone
Timezone::init();

$opts = getopt("", ["no-wizard", "enable-ansi", "disable-ansi"]);
if(isset($opts["enable-ansi"])){
$opts = getopt("", [BootstrapOptions::NO_WIZARD, BootstrapOptions::ENABLE_ANSI, BootstrapOptions::DISABLE_ANSI]);
if(isset($opts[BootstrapOptions::ENABLE_ANSI])){
Terminal::init(true);
}elseif(isset($opts["disable-ansi"])){
}elseif(isset($opts[BootstrapOptions::DISABLE_ANSI])){
Terminal::init(false);
}else{
Terminal::init();
Expand All @@ -324,7 +324,7 @@ function server(){

$exitCode = 0;
do{
if(!file_exists(Path::join($dataPath, "server.properties")) && !isset($opts["no-wizard"])){
if(!file_exists(Path::join($dataPath, "server.properties")) && !isset($opts[BootstrapOptions::NO_WIZARD])){
$installer = new SetupWizard($dataPath);
if(!$installer->run()){
$exitCode = -1;
Expand Down
Loading

0 comments on commit 91370f7

Please sign in to comment.