mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
Merge branch 'stable' into next-minor
This commit is contained in:
commit
a94b88424e
@ -8,6 +8,9 @@
|
|||||||
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/pmmp/PocketMine-MP?label=release&sort=semver">
|
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/pmmp/PocketMine-MP?label=release&sort=semver">
|
||||||
<a href="https://hub.docker.com/r/pmmp/pocketmine-mp"><img src="https://img.shields.io/docker/v/pmmp/pocketmine-mp?logo=docker&label=image" alt="Docker image version (latest semver)" /></a>
|
<a href="https://hub.docker.com/r/pmmp/pocketmine-mp"><img src="https://img.shields.io/docker/v/pmmp/pocketmine-mp?logo=docker&label=image" alt="Docker image version (latest semver)" /></a>
|
||||||
<a href="https://discord.gg/bmSAZBG"><img src="https://img.shields.io/discord/373199722573201408?label=discord&color=7289DA&logo=discord" alt="Discord" /></a>
|
<a href="https://discord.gg/bmSAZBG"><img src="https://img.shields.io/discord/373199722573201408?label=discord&color=7289DA&logo=discord" alt="Discord" /></a>
|
||||||
|
<br>
|
||||||
|
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/pmmp/PocketMine-MP/total?label=downloads%40total">
|
||||||
|
<img alt="GitHub release (latest by SemVer)" src="https://img.shields.io/github/downloads/pmmp/PocketMine-MP/latest/total">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
@ -12,3 +12,12 @@ Plugin developers should **only** update their required API to this version if y
|
|||||||
|
|
||||||
# 3.26.1
|
# 3.26.1
|
||||||
- Fixed a bug in chunk sending that caused double chests to not be paired, signs to be blank, and various other issues.
|
- Fixed a bug in chunk sending that caused double chests to not be paired, signs to be blank, and various other issues.
|
||||||
|
|
||||||
|
# 3.26.2
|
||||||
|
- Improved error messages shown by `start.cmd`, `start.sh` and `start.ps1` when the PHP binary was not found.
|
||||||
|
- The value of PHPRC is now shown when erroring out due to unsatisfied PHP requirements.
|
||||||
|
- Removed restriction on the range of valid channels for `auto-updater.channel` in `pocketmine.yml`.
|
||||||
|
|
||||||
|
# 3.26.3
|
||||||
|
- `PlayerExperienceChangeEvent->setNewProgress()` now performs range checks. This fixes the root of a very old and confusing crash bug which took several years to identify the cause of.
|
||||||
|
- Note that the defective plugin(s) which caused this problem will still cause a server crash, but the plugin responsible will now get blamed correctly.
|
||||||
|
@ -1523,3 +1523,27 @@ Please note that this was not written with plugins in mind and its API may chang
|
|||||||
|
|
||||||
### Misc
|
### Misc
|
||||||
- Added support for emotes.
|
- Added support for emotes.
|
||||||
|
|
||||||
|
# 4.0.1
|
||||||
|
Released 9th December 2021.
|
||||||
|
|
||||||
|
## General
|
||||||
|
- Added a script `tools/ping-server.php`. This was sitting in my workspace for many years.
|
||||||
|
- `Minecraft network interface running` messages are no longer shown if RakLib was prevented from starting.
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
### Core
|
||||||
|
- Fixed server crash when `FallingBlock` has invalid block data that it can't understand.
|
||||||
|
- Fixed server crash when loading chunks containing tiles outside the world bounds.
|
||||||
|
- Fixed server crash when loading LevelDB chunks containing blockstates which are invalid or not yet supported - they are now treated as corrupted instead.
|
||||||
|
- Fixed `level.dat` becoming corrupted by world saves when the disk is full - now it will still fail to save, but it will leave the original data intact. Previously it would destroy the data and leave behind an empty file.
|
||||||
|
- Fixed configs becoming corrupted when saved when the disk is full - now they'll still fail to save, but the original file will remain intact.
|
||||||
|
|
||||||
|
### API
|
||||||
|
- Fixed mistakes in the 4.0.0 changelog:
|
||||||
|
- Removal of `Player->getLowerCaseName()` is now mentioned.
|
||||||
|
- `CreativeInventory::reset()` is the successor to `Item::initCreativeItems()`, not `CreativeInventory::init()`.
|
||||||
|
- Note that the changelog when viewing from the 4.0.0 GitHub release will remain the same; only the changelog in the current repo will be different.
|
||||||
|
- `Config->save()` will no longer write empty data to the file when using JSON and the data fails to encode - an exception will be thrown instead.
|
||||||
|
- `StringToItemParser` now returns the correct items for `bamboo`, `shulker_box`, `stone_slab`, `stone_stairs` and `tall_grass`.
|
||||||
|
- `StringToItemParser` now recognizes `slime` and `slime_block` (these were previously missing).
|
||||||
|
@ -213,6 +213,8 @@ JIT_WARNING
|
|||||||
}
|
}
|
||||||
critical_error("PHP binary used: " . $binary);
|
critical_error("PHP binary used: " . $binary);
|
||||||
critical_error("Loaded php.ini: " . (($file = php_ini_loaded_file()) !== false ? $file : "none"));
|
critical_error("Loaded php.ini: " . (($file = php_ini_loaded_file()) !== false ? $file : "none"));
|
||||||
|
$phprc = getenv("PHPRC");
|
||||||
|
critical_error("Value of PHPRC environment variable: " . ($phprc === false ? "" : $phprc));
|
||||||
critical_error("Please recompile PHP with the needed configuration, or refer to the installation instructions at http://pmmp.rtfd.io/en/rtfd/installation.html.");
|
critical_error("Please recompile PHP with the needed configuration, or refer to the installation instructions at http://pmmp.rtfd.io/en/rtfd/installation.html.");
|
||||||
echo PHP_EOL;
|
echo PHP_EOL;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -206,7 +206,7 @@ class SimpleCommandMap implements CommandMap{
|
|||||||
foreach($matches[0] as $k => $_){
|
foreach($matches[0] as $k => $_){
|
||||||
for($i = 1; $i <= 2; ++$i){
|
for($i = 1; $i <= 2; ++$i){
|
||||||
if($matches[$i][$k] !== ""){
|
if($matches[$i][$k] !== ""){
|
||||||
$args[$k] = stripslashes($matches[$i][$k]);
|
$args[$k] = $i === 1 ? stripslashes($matches[$i][$k]) : $matches[$i][$k];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ use pocketmine\entity\utils\ExperienceUtils;
|
|||||||
use pocketmine\event\player\PlayerExperienceChangeEvent;
|
use pocketmine\event\player\PlayerExperienceChangeEvent;
|
||||||
use pocketmine\item\Durable;
|
use pocketmine\item\Durable;
|
||||||
use pocketmine\item\enchantment\VanillaEnchantments;
|
use pocketmine\item\enchantment\VanillaEnchantments;
|
||||||
use pocketmine\utils\AssumptionFailedError;
|
|
||||||
use pocketmine\utils\Limits;
|
use pocketmine\utils\Limits;
|
||||||
use pocketmine\world\sound\XpCollectSound;
|
use pocketmine\world\sound\XpCollectSound;
|
||||||
use pocketmine\world\sound\XpLevelUpSound;
|
use pocketmine\world\sound\XpLevelUpSound;
|
||||||
@ -36,7 +35,6 @@ use function ceil;
|
|||||||
use function count;
|
use function count;
|
||||||
use function max;
|
use function max;
|
||||||
use function min;
|
use function min;
|
||||||
use function sprintf;
|
|
||||||
|
|
||||||
class ExperienceManager{
|
class ExperienceManager{
|
||||||
|
|
||||||
@ -146,9 +144,6 @@ class ExperienceManager{
|
|||||||
|
|
||||||
$xpLevel = (int) $newLevel;
|
$xpLevel = (int) $newLevel;
|
||||||
$xpProgress = $newLevel - (int) $newLevel;
|
$xpProgress = $newLevel - (int) $newLevel;
|
||||||
if($xpProgress > 1.0){
|
|
||||||
throw new AssumptionFailedError(sprintf("newLevel - (int) newLevel should never be bigger than 1, but have %.53f (newLevel=%.53f)", $xpProgress, $newLevel));
|
|
||||||
}
|
|
||||||
return $this->setXpAndProgress($xpLevel, $xpProgress);
|
return $this->setXpAndProgress($xpLevel, $xpProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class ItemEntity extends Entity{
|
|||||||
if($item->isNull()){
|
if($item->isNull()){
|
||||||
throw new \InvalidArgumentException("Item entity must have a non-air item with a count of at least 1");
|
throw new \InvalidArgumentException("Item entity must have a non-air item with a count of at least 1");
|
||||||
}
|
}
|
||||||
$this->item = $item;
|
$this->item = clone $item;
|
||||||
parent::__construct($location, $nbt);
|
parent::__construct($location, $nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +82,9 @@ class PlayerExperienceChangeEvent extends EntityEvent implements Cancellable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setNewProgress(?float $newProgress) : void{
|
public function setNewProgress(?float $newProgress) : void{
|
||||||
|
if($newProgress < 0.0 || $newProgress > 1.0){
|
||||||
|
throw new \InvalidArgumentException("XP progress must be in range 0-1");
|
||||||
|
}
|
||||||
$this->newProgress = $newProgress;
|
$this->newProgress = $newProgress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ use function array_push;
|
|||||||
use function array_slice;
|
use function array_slice;
|
||||||
use function array_values;
|
use function array_values;
|
||||||
use function count;
|
use function count;
|
||||||
|
use function mb_scrub;
|
||||||
|
|
||||||
abstract class WritableBookBase extends Item{
|
abstract class WritableBookBase extends Item{
|
||||||
public const TAG_PAGES = "pages"; //TAG_List<TAG_Compound>
|
public const TAG_PAGES = "pages"; //TAG_List<TAG_Compound>
|
||||||
@ -168,12 +169,12 @@ abstract class WritableBookBase extends Item{
|
|||||||
if($pages->getTagType() === NBT::TAG_Compound){ //PE format
|
if($pages->getTagType() === NBT::TAG_Compound){ //PE format
|
||||||
/** @var CompoundTag $page */
|
/** @var CompoundTag $page */
|
||||||
foreach($pages as $page){
|
foreach($pages as $page){
|
||||||
$this->pages[] = new WritableBookPage($page->getString(self::TAG_PAGE_TEXT), $page->getString(self::TAG_PAGE_PHOTONAME, ""));
|
$this->pages[] = new WritableBookPage(mb_scrub($page->getString(self::TAG_PAGE_TEXT), 'UTF-8'), $page->getString(self::TAG_PAGE_PHOTONAME, ""));
|
||||||
}
|
}
|
||||||
}elseif($pages->getTagType() === NBT::TAG_String){ //PC format
|
}elseif($pages->getTagType() === NBT::TAG_String){ //PC format
|
||||||
/** @var StringTag $page */
|
/** @var StringTag $page */
|
||||||
foreach($pages as $page){
|
foreach($pages as $page){
|
||||||
$this->pages[] = new WritableBookPage($page->getValue());
|
$this->pages[] = new WritableBookPage(mb_scrub($page->getValue(), 'UTF-8'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ use pocketmine\permission\PermissionParser;
|
|||||||
use pocketmine\permission\PermissionParserException;
|
use pocketmine\permission\PermissionParserException;
|
||||||
use function array_map;
|
use function array_map;
|
||||||
use function array_values;
|
use function array_values;
|
||||||
|
use function get_debug_type;
|
||||||
use function is_array;
|
use function is_array;
|
||||||
use function is_string;
|
use function is_string;
|
||||||
use function preg_match;
|
use function preg_match;
|
||||||
@ -85,7 +86,18 @@ class PluginDescription{
|
|||||||
* @param string|mixed[] $yamlString
|
* @param string|mixed[] $yamlString
|
||||||
*/
|
*/
|
||||||
public function __construct($yamlString){
|
public function __construct($yamlString){
|
||||||
$this->loadMap(!is_array($yamlString) ? yaml_parse($yamlString) : $yamlString);
|
if(is_string($yamlString)){
|
||||||
|
$map = yaml_parse($yamlString);
|
||||||
|
if($map === false){
|
||||||
|
throw new PluginDescriptionParseException("YAML parsing error in plugin manifest");
|
||||||
|
}
|
||||||
|
if(!is_array($map)){
|
||||||
|
throw new PluginDescriptionParseException("Invalid structure of plugin manifest, expected array but have " . get_debug_type($map));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$map = $yamlString;
|
||||||
|
}
|
||||||
|
$this->loadMap($map);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -153,6 +153,8 @@ class UpdateChecker{
|
|||||||
|
|
||||||
if($currentVersion->getBuild() > 0 && $currentVersion->compare($newVersion) > 0){
|
if($currentVersion->getBuild() > 0 && $currentVersion->compare($newVersion) > 0){
|
||||||
$this->updateInfo = $updateInfo;
|
$this->updateInfo = $updateInfo;
|
||||||
|
}else{
|
||||||
|
$this->logger->debug("API reported version is an older version or the same version (" . $newVersion->getFullVersion() . "), not showing notification");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,12 +162,7 @@ class UpdateChecker{
|
|||||||
* Returns the channel used for update checking (stable, beta, dev)
|
* Returns the channel used for update checking (stable, beta, dev)
|
||||||
*/
|
*/
|
||||||
public function getChannel() : string{
|
public function getChannel() : string{
|
||||||
$channel = strtolower($this->server->getConfigGroup()->getPropertyString("auto-updater.preferred-channel", "stable"));
|
return strtolower($this->server->getConfigGroup()->getPropertyString("auto-updater.preferred-channel", "stable"));
|
||||||
if($channel !== "stable" and $channel !== "beta" and $channel !== "alpha" and $channel !== "development"){
|
|
||||||
$channel = "stable";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $channel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user