mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
Merge branch 'stable'
This commit is contained in:
@@ -48,7 +48,7 @@ class AttributeMap{
|
||||
* @return Attribute[]
|
||||
*/
|
||||
public function needSend() : array{
|
||||
return array_filter($this->attributes, function(Attribute $attribute){
|
||||
return array_filter($this->attributes, function(Attribute $attribute) : bool{
|
||||
return $attribute->isSyncable() and $attribute->isDesynchronized();
|
||||
});
|
||||
}
|
||||
|
@@ -265,9 +265,9 @@ final class EntityFactory{
|
||||
new DoubleTag($pos->z)
|
||||
]))
|
||||
->setTag("Motion", new ListTag([
|
||||
new DoubleTag($motion ? $motion->x : 0.0),
|
||||
new DoubleTag($motion ? $motion->y : 0.0),
|
||||
new DoubleTag($motion ? $motion->z : 0.0)
|
||||
new DoubleTag($motion !== null ? $motion->x : 0.0),
|
||||
new DoubleTag($motion !== null ? $motion->y : 0.0),
|
||||
new DoubleTag($motion !== null ? $motion->z : 0.0)
|
||||
]))
|
||||
->setTag("Rotation", new ListTag([
|
||||
new FloatTag($yaw),
|
||||
|
@@ -245,9 +245,9 @@ class ExperienceManager{
|
||||
$equipment[$mainHandIndex] = $item;
|
||||
}
|
||||
//TODO: check offhand
|
||||
foreach($this->entity->getArmorInventory()->getContents() as $k => $item){
|
||||
if($item instanceof Durable and $item->hasEnchantment(Enchantment::MENDING())){
|
||||
$equipment[$k] = $item;
|
||||
foreach($this->entity->getArmorInventory()->getContents() as $k => $armorItem){
|
||||
if($armorItem instanceof Durable and $armorItem->hasEnchantment(Enchantment::MENDING())){
|
||||
$equipment[$k] = $armorItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -182,7 +182,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
public function getXpDropAmount() : int{
|
||||
//this causes some XP to be lost on death when above level 1 (by design), dropping at most enough points for
|
||||
//about 7.5 levels of XP.
|
||||
return (int) min(100, 7 * $this->xpManager->getXpLevel());
|
||||
return min(100, 7 * $this->xpManager->getXpLevel());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -126,7 +126,7 @@ abstract class Living extends Entity{
|
||||
|
||||
$this->setAirSupplyTicks($nbt->getShort("Air", self::DEFAULT_BREATH_TICKS));
|
||||
|
||||
/** @var CompoundTag[]|ListTag $activeEffectsTag */
|
||||
/** @var CompoundTag[]|ListTag|null $activeEffectsTag */
|
||||
$activeEffectsTag = $nbt->getListTag("ActiveEffects");
|
||||
if($activeEffectsTag !== null){
|
||||
foreach($activeEffectsTag as $e){
|
||||
|
@@ -75,6 +75,6 @@ abstract class ExperienceUtils{
|
||||
|
||||
$x = Math::solveQuadratic($a, $b, $c - $xp);
|
||||
|
||||
return (float) max($x); //we're only interested in the positive solution
|
||||
return max($x); //we're only interested in the positive solution
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user