Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/stable' into minor-next
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Feb 12, 2024
2 parents 6bb84bc + eaab1a8 commit d211392
Show file tree
Hide file tree
Showing 32 changed files with 396 additions and 232 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: shivammathur/[email protected]
with:
php-version: 8.2
tools: php-cs-fixer:3.38
tools: php-cs-fixer:3.49
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
11 changes: 7 additions & 4 deletions build/generate-build-info-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

declare(strict_types=1);

use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\VersionInfo;

require dirname(__DIR__) . '/vendor/autoload.php';

if(count($argv) !== 7){
Expand All @@ -30,12 +33,12 @@

echo json_encode([
"php_version" => sprintf("%d.%d", PHP_MAJOR_VERSION, PHP_MINOR_VERSION), //deprecated
"base_version" => \pocketmine\VersionInfo::BASE_VERSION,
"base_version" => VersionInfo::BASE_VERSION,
"build" => (int) $argv[4],
"is_dev" => \pocketmine\VersionInfo::IS_DEVELOPMENT_BUILD,
"channel" => \pocketmine\VersionInfo::BUILD_CHANNEL,
"is_dev" => VersionInfo::IS_DEVELOPMENT_BUILD,
"channel" => VersionInfo::BUILD_CHANNEL,
"git_commit" => $argv[1],
"mcpe_version" => \pocketmine\network\mcpe\protocol\ProtocolInfo::MINECRAFT_VERSION_NETWORK,
"mcpe_version" => ProtocolInfo::MINECRAFT_VERSION_NETWORK,
"date" => time(), //TODO: maybe we should embed this in VersionInfo?
"details_url" => "https://github.com/$argv[3]/releases/tag/$argv[2]",
"download_url" => "https://github.com/$argv[3]/releases/download/$argv[2]/PocketMine-MP.phar",
Expand Down
26 changes: 26 additions & 0 deletions changelogs/5.11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 5.11.0
Released 7th February 2024.

**For Minecraft: Bedrock Edition 1.20.60**

This is a support release for Minecraft: Bedrock Edition 1.20.60.

**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
- Added support for Minecraft: Bedrock Edition 1.20.60.
- Removed support for earlier versions.

## Fixes
- Fixed `tools/generate-item-upgrade-schema.php` not correctly handling items whose IDs were changed multiple times.
- Fixed `ServerKiller` not working correctly in some cases (incorrectly handled wake-up conditions).
- `ItemBlock`s of `Air` blocks are now always considered as "null" items regardless of count, and don't occupy inventory slots.

## Internals
- Restructured GitHub Actions CI workflows to make them easier to maintain (no need to update PHP versions in multiple places anymore).
- GitHub Actions CodeStyle workflow now uses php-cs-fixer 3.49.x.
- Dependabot updates are now processed weekly instead of daily.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"composer-runtime-api": "^2.0",
"adhocore/json-comment": "~1.2.0",
"pocketmine/netresearch-jsonmapper": "~v4.2.1000",
"pocketmine/bedrock-block-upgrade-schema": "~3.4.0+bedrock-1.20.50",
"pocketmine/bedrock-data": "~2.7.0+bedrock-1.20.50",
"pocketmine/bedrock-item-upgrade-schema": "~1.6.0+bedrock-1.20.50",
"pocketmine/bedrock-protocol": "~26.0.0+bedrock-1.20.50",
"pocketmine/bedrock-block-upgrade-schema": "~3.5.0+bedrock-1.20.60",
"pocketmine/bedrock-data": "~2.8.0+bedrock-1.20.60",
"pocketmine/bedrock-item-upgrade-schema": "~1.7.0+bedrock-1.20.60",
"pocketmine/bedrock-protocol": "~27.0.0+bedrock-1.20.60",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/color": "^0.3.0",
Expand Down
50 changes: 25 additions & 25 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 22 additions & 13 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
use pocketmine\network\mcpe\PacketBroadcaster;
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializerContext;
use pocketmine\network\mcpe\protocol\types\CompressionAlgorithm;
use pocketmine\network\mcpe\raklib\RakLibInterface;
use pocketmine\network\mcpe\StandardEntityEventBroadcaster;
use pocketmine\network\mcpe\StandardPacketBroadcaster;
Expand Down Expand Up @@ -125,6 +126,7 @@
use function array_fill;
use function array_sum;
use function base64_encode;
use function chr;
use function cli_set_process_title;
use function copy;
use function count;
Expand Down Expand Up @@ -737,7 +739,7 @@ public function getOps() : Config{
* @return string[][]
*/
public function getCommandAliases() : array{
$section = $this->configGroup->getProperty(YmlServerProperties::ALIASES);
$section = $this->configGroup->getProperty(Yml::ALIASES);
$result = [];
if(is_array($section)){
foreach($section as $key => $value){
Expand Down Expand Up @@ -861,7 +863,7 @@ public function __construct(
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_server_devBuild_error1(VersionInfo::NAME)));
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_server_devBuild_error2()));
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_server_devBuild_error3()));
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_server_devBuild_error4(YmlServerProperties::SETTINGS_ENABLE_DEV_BUILDS)));
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_server_devBuild_error4(Yml::SETTINGS_ENABLE_DEV_BUILDS)));
$this->logger->emergency($this->language->translate(KnownTranslationFactory::pocketmine_server_devBuild_error5("https://github.com/pmmp/PocketMine-MP/releases")));
$this->forceShutdownExit();

Expand Down Expand Up @@ -1373,19 +1375,26 @@ public function prepareBatch(string $buffer, Compressor $compressor, ?bool $sync
try{
$timings->startTiming();

if($sync === null){
$threshold = $compressor->getCompressionThreshold();
$sync = !$this->networkCompressionAsync || $threshold === null || strlen($buffer) < $threshold;
}
$threshold = $compressor->getCompressionThreshold();
if($threshold === null || strlen($buffer) < $compressor->getCompressionThreshold()){
$compressionType = CompressionAlgorithm::NONE;
$compressed = $buffer;

}else{
$sync ??= !$this->networkCompressionAsync;

if(!$sync && strlen($buffer) >= $this->networkCompressionAsyncThreshold){
$promise = new CompressBatchPromise();
$task = new CompressBatchTask($buffer, $promise, $compressor);
$this->asyncPool->submitTask($task);
return $promise;
}

if(!$sync && strlen($buffer) >= $this->networkCompressionAsyncThreshold){
$promise = new CompressBatchPromise();
$task = new CompressBatchTask($buffer, $promise, $compressor);
$this->asyncPool->submitTask($task);
return $promise;
$compressionType = $compressor->getNetworkId();
$compressed = $compressor->compress($buffer);
}

return $compressor->compress($buffer);
return chr($compressionType) . $compressed;
}finally{
$timings->stopTiming();
}
Expand Down Expand Up @@ -1467,7 +1476,7 @@ public function forceShutdown() : void{
}

if(isset($this->network)){
$this->network->getSessionManager()->close($this->configGroup->getPropertyString(YmlServerProperties::SETTINGS_SHUTDOWN_MESSAGE, "Server closed"));
$this->network->getSessionManager()->close($this->configGroup->getPropertyString(Yml::SETTINGS_SHUTDOWN_MESSAGE, "Server closed"));
}

if(isset($this->worldManager)){
Expand Down
2 changes: 1 addition & 1 deletion src/VersionInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

final class VersionInfo{
public const NAME = "PocketMine-MP";
public const BASE_VERSION = "5.10.1";
public const BASE_VERSION = "5.11.1";
public const IS_DEVELOPMENT_BUILD = true;
public const BUILD_CHANNEL = "stable";

Expand Down
4 changes: 2 additions & 2 deletions src/block/VanillaBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public static function getAll() : array{
}

protected static function setup() : void{
$railBreakInfo = new Info(new BlockBreakInfo(0.7));
$railBreakInfo = new Info(new BreakInfo(0.7));
self::register("activator_rail", new ActivatorRail(new BID(Ids::ACTIVATOR_RAIL), "Activator Rail", $railBreakInfo));
self::register("air", new Air(new BID(Ids::AIR), "Air", new Info(BreakInfo::indestructible(-1.0))));
self::register("anvil", new Anvil(new BID(Ids::ANVIL), "Anvil", new Info(BreakInfo::pickaxe(5.0, ToolTier::WOOD, 6000.0))));
Expand Down Expand Up @@ -1638,7 +1638,7 @@ public function isAffectedBySilkTouch() : bool{

self::register("cave_vines", new CaveVines(new BID(Ids::CAVE_VINES), "Cave Vines", new Info(BreakInfo::instant())));

self::register("small_dripleaf", new SmallDripleaf(new BID(Ids::SMALL_DRIPLEAF), "Small Dripleaf", new Info(BreakInfo::instant(BlockToolType::SHEARS, toolHarvestLevel: 1))));
self::register("small_dripleaf", new SmallDripleaf(new BID(Ids::SMALL_DRIPLEAF), "Small Dripleaf", new Info(BreakInfo::instant(ToolType::SHEARS, toolHarvestLevel: 1))));
self::register("big_dripleaf_head", new BigDripleafHead(new BID(Ids::BIG_DRIPLEAF_HEAD), "Big Dripleaf", new Info(BreakInfo::instant())));
self::register("big_dripleaf_stem", new BigDripleafStem(new BID(Ids::BIG_DRIPLEAF_STEM), "Big Dripleaf Stem", new Info(BreakInfo::instant())));
}
Expand Down
12 changes: 6 additions & 6 deletions src/block/WoodLikeBlockIdHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static function getSignInfo(WoodType $treeType) : array{
};
}

public static function getTrapdoorIdentifier(WoodType $treeType) : BlockIdentifier{
public static function getTrapdoorIdentifier(WoodType $treeType) : BID{
return new BID(match($treeType){
WoodType::OAK => Ids::OAK_TRAPDOOR,
WoodType::SPRUCE => Ids::SPRUCE_TRAPDOOR,
Expand All @@ -186,7 +186,7 @@ public static function getTrapdoorIdentifier(WoodType $treeType) : BlockIdentifi
});
}

public static function getButtonIdentifier(WoodType $treeType) : BlockIdentifier{
public static function getButtonIdentifier(WoodType $treeType) : BID{
return new BID(match($treeType){
WoodType::OAK => Ids::OAK_BUTTON,
WoodType::SPRUCE => Ids::SPRUCE_BUTTON,
Expand All @@ -201,7 +201,7 @@ public static function getButtonIdentifier(WoodType $treeType) : BlockIdentifier
});
}

public static function getPressurePlateIdentifier(WoodType $treeType) : BlockIdentifier{
public static function getPressurePlateIdentifier(WoodType $treeType) : BID{
return new BID(match($treeType){
WoodType::OAK => Ids::OAK_PRESSURE_PLATE,
WoodType::SPRUCE => Ids::SPRUCE_PRESSURE_PLATE,
Expand All @@ -216,7 +216,7 @@ public static function getPressurePlateIdentifier(WoodType $treeType) : BlockIde
});
}

public static function getDoorIdentifier(WoodType $treeType) : BlockIdentifier{
public static function getDoorIdentifier(WoodType $treeType) : BID{
return new BID(match($treeType){
WoodType::OAK => Ids::OAK_DOOR,
WoodType::SPRUCE => Ids::SPRUCE_DOOR,
Expand All @@ -231,7 +231,7 @@ public static function getDoorIdentifier(WoodType $treeType) : BlockIdentifier{
});
}

public static function getFenceGateIdentifier(WoodType $treeType) : BlockIdentifier{
public static function getFenceGateIdentifier(WoodType $treeType) : BID{
return new BID(match($treeType){
WoodType::OAK => Ids::OAK_FENCE_GATE,
WoodType::SPRUCE => Ids::SPRUCE_FENCE_GATE,
Expand All @@ -246,7 +246,7 @@ public static function getFenceGateIdentifier(WoodType $treeType) : BlockIdentif
});
}

public static function getStairsIdentifier(WoodType $treeType) : BlockIdentifier{
public static function getStairsIdentifier(WoodType $treeType) : BID{
return new BID(match($treeType){
WoodType::OAK => Ids::OAK_STAIRS,
WoodType::SPRUCE => Ids::SPRUCE_STAIRS,
Expand Down
2 changes: 1 addition & 1 deletion src/data/bedrock/block/BlockStateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class BlockStateData{
public const CURRENT_VERSION =
(1 << 24) | //major
(20 << 16) | //minor
(50 << 8) | //patch
(60 << 8) | //patch
(1); //revision

public const TAG_NAME = "name";
Expand Down
2 changes: 1 addition & 1 deletion src/data/bedrock/block/BlockStateNames.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ private function __construct(){
public const CHEMISTRY_TABLE_TYPE = "chemistry_table_type";
public const CHISEL_TYPE = "chisel_type";
public const CLUSTER_COUNT = "cluster_count";
public const COLOR = "color";
public const COLOR_BIT = "color_bit";
public const COMPOSTER_FILL_LEVEL = "composter_fill_level";
public const CONDITIONAL_BIT = "conditional_bit";
Expand Down Expand Up @@ -145,6 +144,7 @@ private function __construct(){
public const TALL_GRASS_TYPE = "tall_grass_type";
public const TOGGLE_BIT = "toggle_bit";
public const TORCH_FACING_DIRECTION = "torch_facing_direction";
public const TRIAL_SPAWNER_STATE = "trial_spawner_state";
public const TRIGGERED_BIT = "triggered_bit";
public const TURTLE_EGG_COUNT = "turtle_egg_count";
public const TWISTING_VINES_AGE = "twisting_vines_age";
Expand Down
Loading

0 comments on commit d211392

Please sign in to comment.