minecraft-dev / MinecraftDev

Plugin for IntelliJ IDEA that gives special support for Minecraft modding projects.
https://minecraftdev.org/
GNU Lesser General Public License v3.0
1.49k stars 184 forks source link

Methods Implementing Interfaces in Mixins are Required to be Named in Mixin Style #2364

Closed Taskeren closed 2 weeks ago

Taskeren commented 2 weeks ago

Minecraft Development for IntelliJ plugin version

2024.2-1.8.1

IntelliJ version

2024.2.0.2

Operating System

Windows 11

Target platform

Mixins

Description of the bug

image

getSomeString is defined in the custom interface ISomeInterface, which is used for Interface Injection.

It should not be regulated by the naming style.

LlamaLad7 commented 2 weeks ago

Yes, it should be regulated by the naming style. The entire point is that using simple names will cause conflicts between mods. Both the name in your interface and in your mixin need to be prefixed.

Taskeren commented 2 weeks ago

Yes, it should be regulated by the naming style. The entire point is that using simple names will cause conflicts between mods. Both the name in your interface and in your mixin need to be prefixed.

Sorry, I'm not very good at Mixin. How can I make the implement methods naming in that style without errors? Is that @Implementation annotation? I don't see any document about Mixin use it.

LlamaLad7 commented 2 weeks ago

Both the name in your interface and in your mixin need to be prefixed.

LlamaLad7 commented 2 weeks ago

You put your modid or similar in front of their names.

Taskeren commented 2 weeks ago

But what if the interface is not MY custom one, but in other dependencies?

Earthcomputer commented 2 weeks ago

It's likely not advisable to implement interfaces from other dependencies into Minecraft classes, in case other mods try to do the same thing. If you are having this problem a lot, you can go into the settings for this inspection and disable the option for inherited methods.

Taskeren commented 2 weeks ago

Thanks for answering! I see the recommended way to do this.

But can it be inspected separately, like have different options for methods from interface and methods injecting?