-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
[1.21.3] Implement support for preventing effects from being removed by milk or totems #1603
base: 1.21.x
Are you sure you want to change the base?
Conversation
Last commit published: fa8261547e16da956fdb12235198e905ce5dfab4. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #1603' // https://github.com/neoforged/NeoForge/pull/1603
url 'https://prmaven.neoforged.net/NeoForge/pr1603'
content {
includeModule('net.neoforged', 'testframework')
includeModule('net.neoforged', 'neoforge')
}
}
} MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr1603
cd NeoForge-pr1603
curl -L https://prmaven.neoforged.net/NeoForge/pr1603/net/neoforged/neoforge/21.3.17-beta-pr-1603-effect_curing/mdk-pr1603.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip To test a production environment, you can download the installer from here. |
@XFactHD, this pull request has conflicts, please resolve them for this PR to move forward. |
This is an incomplete replacement. You handle the part of the effect cure system that allows making an general mob effect type not curable by milk, but don't handle the part of the system that allows making specific effect instances not curable. For instance, I have a mod that adds effects in a mutually exclusive system that uses effect cures to ensure that adding one effect from the set removes the others. However, I also have some vanilla effects in this system, which is easy to accomplish by setting the effect cures on the effect instance before applying it to the player. The only way to accomplish the same thing with this proposed system would require me registering additional copies of vanilla effects, which based on the effect may not scale properly (not to mention the UX mess if you have both the copy and the original at the same time) |
It's the best we'll get, unfortunately. NeoForge must preserve network compatibility with vanilla and therefor can't register a custom consume effect, which means we're restricted to |
@XFactHD Have you validated that this is network compatible? I had someone mention to me that changes in the default component set of an item are not network-compatible either, which would make this not a viable solution. |
This PR replaces the hard-coded consume effects on milk and totems such that mods can prevent their custom effects from being cured by milk and totems respectively. The honey bottle is left out intentionally as mods can use the
ModifyDefaultComponentsEvent
to add additionalRemoveStatusEffectsConsumeEffect
s for their effects to theDataComponents.CONSUMABLE
component specified on honey bottles.To achieve this, the
ClearAllStatusEffectsConsumeEffect
s are replaced withRemoveStatusEffectsConsumeEffect
s holding aNotHolderSet
that wraps a blacklist tag.Since these changes are applied to the item's "component prototype", the changes won't be synced to a non-NeoForge counterpart and should therefor not cause any issues or desyncs there.
This PR is the replacement for the defunct
EffectCure
system.