MixinExtras icon indicating copy to clipboard operation
MixinExtras copied to clipboard

[Suggestion] Way to intentionally share a `@Share` between two mixins

Open TropheusJ opened this issue 1 year ago • 5 comments

a @Share is unique to a mixin, which is very good for compatibility, but that behavior can occasionally be desired.

For Porting Lib, I need to wrap a parameter as early as possible, and then access it later as late as possible. I am doing this with two mixins, one with low priority, and one with high. Since it's split, I can't use a @Share, and I'll have to use a ThreadLocal.

TropheusJ avatar Feb 16 '24 17:02 TropheusJ

I think a solution would be to have an option to expand the scope to within the current mixin config, if that's possible.

Gaming32 avatar Feb 16 '24 18:02 Gaming32

I think the most general solution would be to allow you to specify a namespace, which would default to the name of your mixin (the current behaviour).

LlamaLad7 avatar Feb 18 '24 17:02 LlamaLad7

It can't default to exactly the name of your mixin, because mixin names are fairly standardized. For example, the number of MixinBlock/BlockMixin or MixinLivingEntity/LivingEntityMixin are probably in the thousands.

Gaming32 avatar Feb 18 '24 18:02 Gaming32

The fully qualified name.

LlamaLad7 avatar Feb 18 '24 18:02 LlamaLad7

Fair enough

Gaming32 avatar Feb 18 '24 18:02 Gaming32