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:
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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)){
|
||||
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user