Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor
2022-11-12 17:01:58 +00:00
6 changed files with 11 additions and 15 deletions

View File

@ -38,6 +38,7 @@ use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection;
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
use pocketmine\player\Player;
use pocketmine\world\sound\ArrowHitSound;
use function ceil;
use function mt_rand;
use function sqrt;
@ -103,7 +104,7 @@ class Arrow extends Projectile{
}
public function getResultDamage() : int{
$base = parent::getResultDamage();
$base = (int) ceil($this->motion->length() * parent::getResultDamage());
if($this->isCritical()){
return ($base + mt_rand(0, (int) ($base / 2) + 1));
}else{

View File

@ -128,7 +128,7 @@ abstract class Projectile extends Entity{
* Returns the amount of damage this projectile will deal to the entity it hits.
*/
public function getResultDamage() : int{
return (int) ceil($this->motion->length() * $this->damage);
return (int) ceil($this->damage);
}
public function saveNBT() : CompoundTag{

View File

@ -2416,9 +2416,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
$this->ySize = 0;
}
/**
* {@inheritdoc}
*/
public function teleport(Vector3 $pos, ?float $yaw = null, ?float $pitch = null) : bool{
if(parent::teleport($pos, $yaw, $pitch)){

View File

@ -70,7 +70,7 @@ class Internet{
public static $online = true;
/**
* Gets the External IP using an external service, it is cached
* Lazily gets the External IP using an external service and caches the result
*
* @param bool $force default false, force IP check even when cached
*

View File

@ -208,7 +208,7 @@ abstract class Timezone{
//That's been a bug in PHP since 2008!
foreach(timezone_abbreviations_list() as $zones){
foreach($zones as $timezone){
if($timezone['offset'] == $offset){
if($timezone['timezone_id'] !== null && $timezone['offset'] == $offset){
return $timezone['timezone_id'];
}
}