default branch (1.21) does not compile #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Output of
$ ./gradlew jar
As you can see, there are some import-related errors. Launching any Gradle task which requires
:Common:compileJava
in IntelliJ IDEA also fails with the same message.System info:
Looks like our example mod needs some updates to its resource registers, especially for the changes to foods and tooltips. These were changes only added recently to 1.21.
Not sure who we'll assign this to but I'll ping @hypherionmc about it for now.
Theoretically though, if you ditch the example mod, you should be able to code things as normal.
Hmm... I deleted the lines related to tooltip listener and I still have some errors:
It seems like Java cannot find anything from
net.minecraft
namespace in theCommon
module.Right, something else must be going on here then. Hyph will have to have a look as it's beyond my capabilities
Pushed a fix for the compile issue, and also updated fabric/neoforge.
Regarding the missing MC classes, if you are using IntelliJ idea, go into Settings -> Build, Execution, Deployment -> Build Tools -> Gradle and make sure that gradle jvm is set to Project SDK, instead of your system default.
@hypherionmc I already changed it to
Project SDK
and I still get errors (re-cloned the repo btw)Try running
./gradlew --stop
in a terminal. After that is complete, reload the project in intellij.If that still doesn't work, do
./gradlew --refresh-dependencies
. Reload the project again after thatUnfortunately, none of these solutions worked. I even restarted the machine, re-cloned the repo (yet again) and the errors are still present.
IntelliJ IDEA suggests (Alt-Enter) adding
neoforge
library to the classpath 🤔. From what I understand, theCommon
module should use the Fabric-providednet.minecraft
namespace, right?I am closing this issue. The main problem caused by the food and tooltip changes has been fixed. The other one seems to be unique to my machine. It does not occur on my other machine.
Hmmm yeah that one is odd. Common should only provide the "vanilla" minecraft classes. One final solution you can try on the machine with the issue is to nuke the entire
.gradle
folder in your home directory. That would clear out the entire gradle cache, but also means that any other gradle projects you have would need to redownload all their dependencies and files againI have already tried to build the project after removing the `~/.gradle' directory...
But the "vanilla" classes must be provided from somewhere like Fabric or (Neo)Forge. In our case, it's Fabric that provides them, right?
Common/build.gradle
I might have a wrong understanding as I am a beginner when it comes to Minecraft mod development.
That is correct. Although we use fabric in the common project, it is only to provide the vanilla classes, and nothing else
Understood. Thank you for your assistance and time, have a nice day!