You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Mod Can't Be Run On Quilt Because Of Your MilkNotCleanLightEffectsMixin Mixin Class, I Tried Asking Someone On The Official Fabric Development Discord For How To Improve It And Someone Said
"...that doesn't seem like a very good way to accomplish that at all
It totally ruins mod compat, because then only light within effects will not be cleared
And if that mod is loaded, there's nothing you can do about it
So to answer your question, yes there is a better way
I would inject into clearStatusEffects WrapWithCondition the iterator.remove call if the status effect is your status effect and a boolean is true
Then I would inject at the head and tail of milk bucket's finishUsing method and set the boolean to true, then false respectively"
They also gave an example
// some boolean in one of your non-mixin classes
boolean bool = false;
// mixin class for MilkBucketItem @Inject(method = "finishUsing", at = @at("HEAD"))
private void setBoolTrue(){
bool = true;
}
// mixin class for LivingEntity
@WrapWithCondition(method = "clearStatusEffects", at = @at(value = "INVOKE", target = "Ljava/util/Iterator;remove()V"))
private boolean noRemove(/whatever the args are/) {
if (bool && /* check if the status effect is a non-removable status effect */) {
return false;
}
return true;
}
If You Could Do This It Would Make My Life So Much Easier But I Know You're Busy So I'm Able To Wait
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The Mod Can't Be Run On Quilt Because Of Your MilkNotCleanLightEffectsMixin Mixin Class, I Tried Asking Someone On The Official Fabric Development Discord For How To Improve It And Someone Said
"...that doesn't seem like a very good way to accomplish that at all
It totally ruins mod compat, because then only light within effects will not be cleared
And if that mod is loaded, there's nothing you can do about it
So to answer your question, yes there is a better way
I would inject into clearStatusEffects WrapWithCondition the iterator.remove call if the status effect is your status effect and a boolean is true
Then I would inject at the head and tail of milk bucket's finishUsing method and set the boolean to true, then false respectively"
They also gave an example
// some boolean in one of your non-mixin classes
boolean bool = false;
// mixin class for MilkBucketItem
@Inject(method = "finishUsing", at = @at("HEAD"))
private void setBoolTrue(){
bool = true;
}
@Inject(method = "finishUsing", at = @at("RETURN"))
private void resetBool(){
bool = false;
}
// mixin class for LivingEntity
@WrapWithCondition(method = "clearStatusEffects", at = @at(value = "INVOKE", target = "Ljava/util/Iterator;remove()V"))
private boolean noRemove(/whatever the args are/) {
if (bool && /* check if the status effect is a non-removable status effect */) {
return false;
}
return true;
}
If You Could Do This It Would Make My Life So Much Easier But I Know You're Busy So I'm Able To Wait
Beta Was this translation helpful? Give feedback.
All reactions