mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11769186885
This commit is contained in:
@ -57,7 +57,7 @@ class EntityDamageByEntityEvent extends EntityDamageEvent{
|
||||
$this->setModifier($this->getBaseDamage() * 0.3 * $strength->getEffectLevel(), self::MODIFIER_STRENGTH);
|
||||
}
|
||||
|
||||
if(($weakness = $effects->get(VanillaEffects::WEAKNESS())) !== null){
|
||||
if(($weakness = $effects->get(VanillaEffects::WEAKNESS())) !== null && $this->getCause() === EntityDamageEvent::CAUSE_ENTITY_ATTACK){
|
||||
$this->setModifier(-($this->getBaseDamage() * 0.2 * $weakness->getEffectLevel()), self::MODIFIER_WEAKNESS);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class GoldenAppleEnchanted extends GoldenApple{
|
||||
|
||||
public function getAdditionalEffects() : array{
|
||||
return [
|
||||
new EffectInstance(VanillaEffects::REGENERATION(), 600, 4),
|
||||
new EffectInstance(VanillaEffects::REGENERATION(), 600, 1),
|
||||
new EffectInstance(VanillaEffects::ABSORPTION(), 2400, 3),
|
||||
new EffectInstance(VanillaEffects::RESISTANCE(), 6000),
|
||||
new EffectInstance(VanillaEffects::FIRE_RESISTANCE(), 6000)
|
||||
|
@ -1625,7 +1625,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->resetItemCooldown($item);
|
||||
$this->resetItemCooldown($oldItem);
|
||||
$this->returnItemsFromAction($oldItem, $item, $returnedItems);
|
||||
|
||||
$this->setUsingItem($item instanceof Releasable && $item->canStartUsingItem($this));
|
||||
@ -1654,7 +1654,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
}
|
||||
|
||||
$this->setUsingItem(false);
|
||||
$this->resetItemCooldown($slot);
|
||||
$this->resetItemCooldown($oldItem);
|
||||
|
||||
$slot->pop();
|
||||
$this->returnItemsFromAction($oldItem, $slot, [$slot->getResidue()]);
|
||||
@ -1682,7 +1682,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
$returnedItems = [];
|
||||
$result = $item->onReleaseUsing($this, $returnedItems);
|
||||
if($result === ItemUseResult::SUCCESS){
|
||||
$this->resetItemCooldown($item);
|
||||
$this->resetItemCooldown($oldItem);
|
||||
$this->returnItemsFromAction($oldItem, $item, $returnedItems);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user