#IntelliJ IDEA not properly running my project

12 messages · Page 1 of 1 (latest)

obtuse cove
#

I'm following along a tutorial on YouTube on how to make a client (like Feather/Lunar) in a Fabric mod, and he did it in Eclipse so I thought I'd follow along there just for plurality. Now that I've learned more, I wanted to switch to IntelliJ because I've used JetBrains IDEs before and they've traditionally been a very nice tool to use. However, when I tried opening the project inside IntelliJ and running the runClient task in Gradle, I get a number of errors that weren't present when I was using Eclipse (it normally ran successfully).

These couple of errors show up in a number of my files:

spectraclient/mixins/MinecraftClientMixin.java:11: error: Mixin has no targets
@Mixin(MinecraftClient.class)
^
spectraclient/mixins/MinecraftClientMixin.java:8: error: package net.minecraft.client does not exist
import net.minecraft.client.MinecraftClient;
                           ^
spectraclient/mixins/MinecraftClientMixin.java:11: error: cannot find symbol
@Mixin(MinecraftClient.class)
       ^
  symbol: class MinecraftClient

The ones above are originating from this file

package spectraclient.mixins;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import net.minecraft.client.MinecraftClient;

@Mixin(MinecraftClient.class)
public class MinecraftClientMixin {

    @Inject(method = "tick", at = @At("HEAD"), cancellable = true)
    public void onTick(CallbackInfo ci) {
        // Stuff to do on tick
    }
}

(image below) The mixin no target error is occuring in all my mixins, and the MinecraftClient not found is appearing in every instance that references it. IntelliJ itself also has a hover thing that recognizes MinecraftClient so I'm not sure whats going on

I tried removing re-generating sources and removing various .gradle folders to try to purge them in case they were Eclipse-specfiic, but I'm not sure

tardy moth
#

!!splitsources

burnt saffronBOT
#
Split Sources

Split Sources provide a compile-time guarantee against calling client only Minecraft code or client only API on the server.

Client-only code can be placed in client, and code that is common to client and server can be placed in main. Client-only code can refer code in main, but not the other way.

Read more: Split Client and Common code - Fabric Loom

tardy moth
#

and i maybe going too far, but that "module" system is generally associated with hacked clients. you will not get any help if that's the case

obtuse cove
#

Yes I can see how it is perceived that way and I realize the stigma behind that, but thats not what I'm trying to accomplish at all

obtuse cove
# burnt saffron

I'll look into that, but do you have an idea on why it worked on Eclipse but not IntelliJ?

tardy moth
#

what tutorial is this?

obtuse cove
tardy moth
#

becuase that's a project without split sources enabled

obtuse cove
#

Okay

#

it looks like its already defined as mentioned in that page though