Skip to content
Discussion options

You must be logged in to vote

Cannot assign a value to final variable 'DIAMOND

Oh, I forgot that interface fields can only be final, so you can't write an interface mixin which assigns to an interface field because there's no way to make the code compile. Normally you'd have your shadow be @Final instead of final, but the compiler adds final, so that doesn't work for interface mixins.
That makes this significantly more complicated. You'll need to use @ModifyArgs to change the arguments passed to the ArmorMaterial constructor call, using @ModifyArgs.slice to restrict the scope of the @At so it only targets the initialiser of DIAMOND.

Field 'DIAMOND' might not have been initialized

Initialise it to null. Shadow meth…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@roman-emerald
Comment options

Comment options

You must be logged in to vote
1 reply
@roman-emerald
Comment options

Answer selected by roman-emerald
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
2 participants