jaredlll08 / MultiLoader-Template

A template for a Forge + Fabric project setup using a Common source set.
Creative Commons Zero v1.0 Universal
359 stars 71 forks source link

[1.19] Unreachable Minecraft packages and classes when using Fabric #32

Closed Griefed closed 11 months ago

Griefed commented 11 months ago

Heyo,

I am currently trying to make use of the 1.19 branch of this template in order to create a basic mod which simply adds a couple of blocks. The Forge-aspect of the template is working as expected, but I am running into a wall when it comes to Fabric.

  1. I've cloned the repo
  2. ran Your Project > Common > Tasks > vanilla gradle > decompile
  3. ran Your Project > Forge > Tasks > forgegradle runs > genIntellijRuns

and then went on to add Blocks for 1.19.2 to Fabric as shown on the Fabric wiki and on Kaupenjoes Fabric 1.19 Tutorial.

This is where the trouble begins and I do not know where the problem is:

I can not call new Identifier(...), IntelliJ IDEA can not find or access net.minecraft.util.Identifier. My IntelliJ IDEA version is IntelliJ IDEA 2023.2.4

I'm using the following verions set in my gradle.properties

minecraft_version=1.19.2

# Forge
forge_version=43.2.21
forge_loader_version_range=[43,)
forge_version_range=[43,)
minecraft_version_range=[1.19,)

# Fabric
fabric_version=0.76.1+1.19.2
fabric_loader_version=0.14.24

Would anyone here happen to know what the cause of this might be, or would anyone be able to help with this?

Cheers, Griefed

jaredlll08 commented 11 months ago

The tutorials you are looking at are using the Yarn mappings, https://fabricmc.net/wiki/tutorial:mappings, however this template is using the mappings provided by Mojang themselves, as that is the only way to get the common code compiling and working in both forge and fabric.

The Identifier class that you mentioned there, is actually ResourceLocation

Griefed commented 11 months ago

Thank you very much for helping me out here. I take it every other class, like ItemGroups will then have their corresponding class in the Mojang-mappings, too.

Schweet. That helps a lot! Thanks again!