Skip to content

Conversation

@TonytheMacaroni
Copy link
Contributor

Removed arbitrary restrictions in CraftAreaEffectCloud, CraftArrow and CraftMetaPotion that prevented adding multiple potion effects of the same type. There seems to be no such restriction in vanilla, and multiple effects of the same type do apply properly.

During testing, I noticed an issue introduced by the handling of EntityPotionEffectEvent that prevented some potion effects from properly applying, when compared to vanilla. I wasn't entirely sure of the best approach to fix this - as such, I tried sticking to the Javadoc description of EntityPotionEffectEvent#isOverride, where if override is true, the previous effect is entirely replaced. As such, a new effect hiding a previous effect is currently not considered "overriding", and EntityPotionEffectEvent#setOverride(true) force applies the new effect, removing the old effect.

Also includes a fix for MC-259832. There's a remaining issue with the /effect command improperly considering applying an effect with a lower amplifier, but longer duration as compared to the current effect, as failing to apply, but I'm unsure of how best to fix that. It only impacts messaging, so I did not attempt to fix it.

@TonytheMacaroni TonytheMacaroni requested a review from a team as a code owner July 29, 2024 01:57
@TonytheMacaroni TonytheMacaroni force-pushed the effect-overriding branch 2 times, most recently from c849a3f to e68c8b1 Compare August 8, 2024 21:40
@Machine-Maker
Copy link
Member

This changes some of the "add effect" methods that have a boolean return value to never return false. It feels like too much of an API break to make this change in methods where the expectation is something else. Perhaps new methods to take advantage of this functionality is better? smth like addCustomEffectWithMerge to clarify that it will "combine" effects utilizing the hidden effect functionality.

@Warriorrrr Warriorrrr moved this from Awaiting review to Waiting For Author in Paper PR Queue Mar 5, 2025
@kennytv kennytv added the pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch label Mar 23, 2025
@kennytv kennytv deleted the branch PaperMC:master March 23, 2025 19:16
@kennytv kennytv closed this Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch pre-softspoon

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants