From 2173aab967fde0e2680ab77bcd1be1e0c3a32e85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:05:38 +0000 Subject: [PATCH 1/6] Bump thollander/actions-comment-pull-request from 2 to 3 (#6482) --- .github/workflows/draft-release-from-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-release-from-pr.yml b/.github/workflows/draft-release-from-pr.yml index 3936a2649..8a347853b 100644 --- a/.github/workflows/draft-release-from-pr.yml +++ b/.github/workflows/draft-release-from-pr.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Post draft release URL on PR - uses: thollander/actions-comment-pull-request@v2 + uses: thollander/actions-comment-pull-request@v3 with: message: "[Draft release ${{ needs.draft.outputs.version }}](${{ needs.draft.outputs.draft-url }}) has been created for commit ${{ github.sha }}. Please review and publish it." From b3b8aaddffe3b3a1eee8dcc62dd08fcd10581916 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:29:01 +0000 Subject: [PATCH 2/6] Bump docker/build-push-action from 6.8.0 to 6.9.0 (#6465) --- .github/workflows/build-docker-image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 7f5eae32a..4325c63f2 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -53,7 +53,7 @@ jobs: run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT - name: Build image for tag - uses: docker/build-push-action@v6.8.0 + uses: docker/build-push-action@v6.9.0 with: push: true context: ./pocketmine-mp @@ -66,7 +66,7 @@ jobs: - name: Build image for major tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v6.8.0 + uses: docker/build-push-action@v6.9.0 with: push: true context: ./pocketmine-mp @@ -79,7 +79,7 @@ jobs: - name: Build image for minor tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v6.8.0 + uses: docker/build-push-action@v6.9.0 with: push: true context: ./pocketmine-mp @@ -92,7 +92,7 @@ jobs: - name: Build image for latest tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v6.8.0 + uses: docker/build-push-action@v6.9.0 with: push: true context: ./pocketmine-mp From 8c04d47b1b2fb9775601af919d3263eb8690458f Mon Sep 17 00:00:00 2001 From: Muqsit Date: Sun, 10 Nov 2024 03:18:30 +0800 Subject: [PATCH 3/6] Make weakness effect only applicable for melee damage (#6489) --- src/event/entity/EntityDamageByEntityEvent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event/entity/EntityDamageByEntityEvent.php b/src/event/entity/EntityDamageByEntityEvent.php index 5ef6c4b8e..052be9a15 100644 --- a/src/event/entity/EntityDamageByEntityEvent.php +++ b/src/event/entity/EntityDamageByEntityEvent.php @@ -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); } } From 231eec911f762beb9c17ab18e44842eb9580f3cd Mon Sep 17 00:00:00 2001 From: WavyCraftNetwork <42108413+WavyCraftNetwork@users.noreply.github.com> Date: Sat, 9 Nov 2024 11:43:30 -0800 Subject: [PATCH 4/6] Enchanted Golden Apple: Regeneration 5 => 2 matching Java (#6445) --- src/item/GoldenAppleEnchanted.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item/GoldenAppleEnchanted.php b/src/item/GoldenAppleEnchanted.php index 5b68f5f21..28e43a7a4 100644 --- a/src/item/GoldenAppleEnchanted.php +++ b/src/item/GoldenAppleEnchanted.php @@ -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) From 05a9e9c76ebe64251245f77eb53bc90e409651b6 Mon Sep 17 00:00:00 2001 From: ipad54 <63200545+ipad54@users.noreply.github.com> Date: Sun, 10 Nov 2024 18:07:18 +0300 Subject: [PATCH 5/6] Implemented sound when drinking a potion (#6444) --- src/item/Potion.php | 3 ++- src/world/sound/BottleEmptySound.php | 35 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/world/sound/BottleEmptySound.php diff --git a/src/item/Potion.php b/src/item/Potion.php index 41b0f634a..192a25784 100644 --- a/src/item/Potion.php +++ b/src/item/Potion.php @@ -26,6 +26,7 @@ namespace pocketmine\item; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\Living; use pocketmine\player\Player; +use pocketmine\world\sound\BottleEmptySound; class Potion extends Item implements ConsumableItem{ @@ -50,7 +51,7 @@ class Potion extends Item implements ConsumableItem{ } public function onConsume(Living $consumer) : void{ - + $consumer->broadcastSound(new BottleEmptySound()); } public function getAdditionalEffects() : array{ diff --git a/src/world/sound/BottleEmptySound.php b/src/world/sound/BottleEmptySound.php new file mode 100644 index 000000000..bb2a0be2a --- /dev/null +++ b/src/world/sound/BottleEmptySound.php @@ -0,0 +1,35 @@ + Date: Sun, 10 Nov 2024 22:15:30 +0300 Subject: [PATCH 6/6] Fixed server crash when applying item cooldown (#6491) This commit fixes server crash when applying a cooldown to any item which count is equals to 1. closes #6490 closes #6488 --- src/player/Player.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/player/Player.php b/src/player/Player.php index 8ae206e1a..192e26a5f 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -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; }