Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Lingering potion & Area Effect Cloud #5276

Open
wants to merge 57 commits into
base: minor-next
Choose a base branch
from

Conversation

IvanCraft623
Copy link
Member

@IvanCraft623 IvanCraft623 commented Sep 2, 2022

Introduction

Implements lingering potions and area effect cloud + custom effect support, also complements #5163

Changes

API changes

  • The following new classes have been added:
    • entity\effect\EffectContainer
    • pocketmine\entity\object\AreaEffectCloud
    • pocketmine\item\LingeringPotion
  • The following API methods have changed signatures
    • SplashPotion->setLinger() - now returns self instead of void

Rationale for EffectContainer addition

Unlike entities (Living) there are different types of things that can contain effects that are not necessarily applied. Such is the case of AreaEffectCloud.

Other stuff that may contain effects:

Backwards compatibility

No BC-breaking changes.

Tests

https://youtu.be/cRAjwEVbb0w
This has been playtested and and there was only one issue:

  • On fire animation is shown when extinguishing fire (this is an already known bug on PM).

NhanAZ
NhanAZ previously approved these changes Sep 2, 2022
@dktapps
Copy link
Member

dktapps commented Sep 2, 2022

Nice, I'll review this tomorrow.

@IvanCraft623
Copy link
Member Author

IvanCraft623 commented Sep 3, 2022

Minecraft Bedrock implements AreaCloudEffect in a weird way, behaves differently than described in the wiki and in java.
Some examples:

  • The number of times the effect is applied varies per effect (I still can't figure out the criteria).
  • Regardless of where the SplashPotion falls, the cloud will be positioned in the middle of the block.
  • ReapplicationDelay changes depending if the effect is Instantaneous.
  • RadiusOnUse is applied even the cloud has no effects.
  • The potion effect is stored in the ListTag effects, it does not make sense since it is aready storing the PotionId.
  • It is only updated every 10 ticks.

xqwtxon
xqwtxon previously approved these changes Sep 15, 2022
- Move bubble color calculation to EffectContainer
- Implement API for effect validator for bubbles
- Implement API for default bubbles color
- Match more AreaEffectCloud properties with vanilla
@jasonw4331 jasonw4331 added Category: Gameplay Related to Minecraft gameplay experience Type: Contribution labels Sep 20, 2022
Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is rather bloated by the EffectContainer changes so it's difficult for me to see what's going on. I've given this only a cursory review.

src/entity/object/AreaEffectCloud.php Outdated Show resolved Hide resolved
src/entity/object/AreaEffectCloud.php Outdated Show resolved Hide resolved
src/entity/object/AreaEffectCloud.php Outdated Show resolved Hide resolved
src/entity/object/AreaEffectCloud.php Outdated Show resolved Hide resolved
src/entity/object/AreaEffectCloud.php Outdated Show resolved Hide resolved
src/entity/object/AreaEffectCloud.php Outdated Show resolved Hide resolved
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 12, 2024
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 19, 2024
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 19, 2024
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 19, 2024
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 19, 2024
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 19, 2024
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 19, 2024
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants