mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Merge branch 'stable' into next-minor
This commit is contained in:
@ -31,7 +31,7 @@ use function str_repeat;
|
||||
|
||||
final class VersionInfo{
|
||||
public const NAME = "PocketMine-MP";
|
||||
public const BASE_VERSION = "4.10.1";
|
||||
public const BASE_VERSION = "4.10.2";
|
||||
public const IS_DEVELOPMENT_BUILD = true;
|
||||
public const BUILD_CHANNEL = "beta";
|
||||
|
||||
|
@ -356,7 +356,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
&& ($this->inventory->getItemInHand() instanceof Totem || $this->offHandInventory->getItem(0) instanceof Totem)){
|
||||
|
||||
$compensation = $this->getHealth() - $source->getFinalDamage() - 1;
|
||||
if($compensation < 0){
|
||||
if($compensation <= -1){
|
||||
$source->setModifier($compensation, EntityDamageEvent::MODIFIER_TOTEM);
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ use pocketmine\item\Item;
|
||||
use pocketmine\item\VanillaItems;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\utils\ObjectSet;
|
||||
use pocketmine\utils\Utils;
|
||||
use function array_slice;
|
||||
use function count;
|
||||
use function max;
|
||||
@ -85,6 +86,7 @@ abstract class BaseInventory implements Inventory{
|
||||
* @phpstan-param array<int, Item> $items
|
||||
*/
|
||||
public function setContents(array $items) : void{
|
||||
Utils::validateArrayValueType($items, function(Item $item) : void{});
|
||||
if(count($items) > $this->getSize()){
|
||||
$items = array_slice($items, 0, $this->getSize(), true);
|
||||
}
|
||||
|
@ -2784,8 +2784,8 @@ class World implements ChunkManager{
|
||||
if($this->getBlockAt($x, $y, $z)->isFullCube()){
|
||||
if($wasAir){
|
||||
$y++;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}else{
|
||||
$wasAir = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user