Jump to content

Recommended Posts

Posted (edited)

Version: forge-1.12.2-14.23.5.2768-mdk

Using IntelliJ Community 2018.3

 

I'm relatively new to this whole thing, and I'm having an issue where importing certain classes within the same packages into a certain other file fails for some reason.

"MessageMod" is the main "@Mod" class.

So my issue is that in MessageEvent I can do "import a.b.MessageMod" just fine. I've compiled MessageEvent repeatedly but no issues with that so far. The same with the other three classes calling any other things from within the package.

But I need to register the MessageEvent, and so from MessageMod I have to import MessageEvent. But inside MessageMod.java, "import a.b.event.MessageEvent" invariably fails:

I've tried building the other packages and files all first, restarting, clearing the cache, compiling the whole project all at once, etc. but still haven't gotten it to build properly yet. Also checked the import names a bunch, used the "auto-complete" one from IntelliJ (didn't work) and typed it myself (still didn't work).

in short IntelliJ can auto-complete the package name and "knows" it's there, but the error doesn't show up until I try to compile, at which time it tells me that the package does not exist.

Googling doesn't do much as the few things that do pop up tell me to do things I can't find or have no idea how to do, or are several years old.

Anybody know how to fix this?

Edited by lightningdragonx5
Posted

Post your code as a GitHub repo

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

Could you tell me what you mean by "compile" by the way, how are you building your mod?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted (edited)
  On 12/16/2018 at 3:01 AM, DaemonUmbra said:

Could you tell me what you mean by "compile" by the way, how are you building your mod?

Expand  

By "compile" I mean either attempt to run the MC client, or right-clicking the individual file and selecting "Recompile filename.java".

 

How am I building the mod? Not quite sure, I followed the directions on the readthedocs site

(https://mcforge.readthedocs.io/en/latest/gettingstarted/#terminal-free-intellij-idea-configuration)

as best as I could but I may have missed something. I have no idea what I'm missing so that's why I'm here to begin with, to see if packages not finding each other is a common error that could be solved by something I don't know about.

 

Anyhow it worked fine when I didn't have files referencing each other - for instance when it was just the main mod class by itself it compiled and showed up in the Mods section of the MC client.

Edited by lightningdragonx5
Posted

Check your GitHub

  • Thanks 1

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted (edited)

lmao, apparently the extensions just flat out don't show on intellij (at least not by default)

 

Thanks for helping me out btw, now I know to watch out for that kind of thing in the future

Edited by lightningdragonx5
Posted

Because it doesn't get counted as a source file

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.