Skip to content

Commit

Permalink
Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into minor…
Browse files Browse the repository at this point in the history
…-next
  • Loading branch information
dktapps committed Jan 22, 2025
2 parents b3f1543 + f7b5cd7 commit ec60777
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build/php
Submodule php updated from 56cec1 to ae9469
10 changes: 10 additions & 0 deletions changelogs/5.23.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,13 @@ Released 9th December 2024.

## Internals
- Removed legacy `build/make-release.php` script. This script is no longer used, as all releases should now follow the PR workflow.

# 5.23.3
Released 22nd January 2025.

## Fixes
- Fixed crashes with PHP internal stack frames being flagged as plugin crashes.
- Fixed note block instrument sounds in 1.21.50.

## Internals
- Updated GitHub issue templates to use issue forms.
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.23.3";
public const BASE_VERSION = "5.23.4";
public const IS_DEVELOPMENT_BUILD = true;
public const BUILD_CHANNEL = "stable";

Expand Down
8 changes: 4 additions & 4 deletions src/data/bedrock/NoteInstrumentIdMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ private function __construct(){
NoteInstrument::SNARE => 2,
NoteInstrument::CLICKS_AND_STICKS => 3,
NoteInstrument::DOUBLE_BASS => 4,
NoteInstrument::BELL => 5,
NoteInstrument::FLUTE => 6,
NoteInstrument::CHIME => 7,
NoteInstrument::GUITAR => 8,
NoteInstrument::FLUTE => 5,
NoteInstrument::BELL => 6,
NoteInstrument::GUITAR => 7,
NoteInstrument::CHIME => 8,
NoteInstrument::XYLOPHONE => 9,
NoteInstrument::IRON_XYLOPHONE => 10,
NoteInstrument::COW_BELL => 11,
Expand Down
3 changes: 1 addition & 2 deletions src/network/mcpe/NetworkSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,7 @@ public function syncAbilities(Player $for) : void{
];

$layers = [
//TODO: dynamic flying speed! FINALLY!!!!!!!!!!!!!!!!!
new AbilitiesLayer(AbilitiesLayer::LAYER_BASE, $boolAbilities, 0.05, 0.1),
new AbilitiesLayer(AbilitiesLayer::LAYER_BASE, $boolAbilities, $for->getFlightSpeedMultiplier(), 0.1),
];
if(!$for->hasBlockCollision()){
//TODO: HACK! In 1.19.80, the client starts falling in our faux spectator mode when it clips into a
Expand Down
39 changes: 39 additions & 0 deletions src/player/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
private const MAX_REACH_DISTANCE_SURVIVAL = 7;
private const MAX_REACH_DISTANCE_ENTITY_INTERACTION = 8;

public const DEFAULT_FLIGHT_SPEED_MULTIPLIER = 0.05;

public const TAG_FIRST_PLAYED = "firstPlayed"; //TAG_Long
public const TAG_LAST_PLAYED = "lastPlayed"; //TAG_Long
private const TAG_GAME_MODE = "playerGameType"; //TAG_Int
Expand Down Expand Up @@ -285,6 +287,8 @@ public static function isValidUserName(?string $name) : bool{
protected bool $blockCollision = true;
protected bool $flying = false;

protected float $flightSpeedMultiplier = self::DEFAULT_FLIGHT_SPEED_MULTIPLIER;

/** @phpstan-var positive-int|null */
protected ?int $lineHeight = null;
protected string $locale = "en_US";
Expand Down Expand Up @@ -518,6 +522,41 @@ public function isFlying() : bool{
return $this->flying;
}

/**
* Sets the player's flight speed multiplier.
*
* Normal flying speed in blocks-per-tick is (multiplier * 10) blocks per tick.
* When sprint-flying, this is doubled to 20.
*
* If set to zero, the player will not be able to move in the xz plane when flying.
* Negative values will invert the controls.
*
* Note: Movement speed attribute does not influence flight speed.
*
* @see Player::DEFAULT_FLIGHT_SPEED_MULTIPLIER
*/
public function setFlightSpeedMultiplier(float $flightSpeedMultiplier) : void{
if($this->flightSpeedMultiplier !== $flightSpeedMultiplier){
$this->flightSpeedMultiplier = $flightSpeedMultiplier;
$this->getNetworkSession()->syncAbilities($this);
}
}

/**
* Returns the player's flight speed multiplier.
*
* Normal flying speed in blocks-per-tick is (multiplier * 10) blocks per tick.
* When sprint-flying, this is doubled to 20.
*
* If set to zero, the player will not be able to move in the xz plane when flying.
* Negative values will invert the controls.
*
* @see Player::DEFAULT_FLIGHT_SPEED_MULTIPLIER
*/
public function getFlightSpeedMultiplier() : float{
return $this->flightSpeedMultiplier;
}

public function setAutoJump(bool $value) : void{
if($this->autoJump !== $value){
$this->autoJump = $value;
Expand Down

0 comments on commit ec60777

Please sign in to comment.