#cant figure out how to make imports work in my fabric mod

13 messages · Page 1 of 1 (latest)

charred geyser
#

works in forge, dunno how to make it work in fabric

#

gradle is setup, ran gensources, still nothing

thin oasis
#

Try closing intellij, deleting the .idea directory, then reopening it?

charred geyser
#

I'll try that when I get back home, I think it's just net.minecraft imports tho

modest slate
#

Easy way to find out is to try to import MatrixStack or PoseStack. The first is Yarn, the second is MojMap

#

!!mappings

rich briarBOT
#

Mappings are an essential part of modding Minecraft with any tool.
Mappings change the fields, methods, classes, and parameters from unusable nonsense like cdr.a into more readable code like net.minecraft.Block.Blocks.AIR.
The mappings Fabric uses are created and maintained by the Fabric community and are called "yarn mappings".

Fabric mappings are used on top of intermediaries so that the mappings generally work from version to version.
Intermediaries are also a type of mapping that stays consistent through versions.
So if a variable was named cdr.a in one version but the next one it was named cer.b, the intermediary name of class_2246.field_10124 will stay the same.

There are a variety of different mappings people have made, such as Spigot mappings, Mojang mappings, and MCP mappings.
You do not necessarily need to know what mappings are in order to mod the game with Fabric, but it certainly does help.
The mappings that Fabric uses are available here, with every version that we have mapped being under a separate branch: https://github.com/FabricMC/yarn.

A more in-depth explanation can be found at https://fabricmc.net/wiki/tutorial:mappings.

modest slate
#

You can change to use mojang mappings if you're currently using yarn (that lines up with forge better)

thin oasis
#

MinecraftClient is yarn but they said it works in forge?

modest slate
#

Oh true

#

!yc net.minecraft.item.BlockItem

rich briarBOT
#
1.21.11-pre3 matches

Names

Official: dkb
Intermediary: net/minecraft/class_1747
Yarn: net/minecraft/item/BlockItem

Yarn Access Widener

accessible class net/minecraft/item/BlockItem
Javadoc