#Cannot resolve net.minecraft imports (outdated Yarn mappings I think?)

4 messages · Page 1 of 1 (latest)

little kite
#

I am trying to use code from a 1.21 API (https://github.com/Mortimer-Kerman/GravityChanger) in my mod. I have copied the relevant code over, but most of the imports from net.minecraft cannot be resolved.
I think it's because the API and my mod use different versions of Yarn.

The API uses Yarn mappings 1.21+build.2
My mod uses Yarn mappings 1.21+build.3

For example, I'm pretty sure net.minecraft.world.entity.Entity should be net.minecraft.entity.Entity
My problem is that there are a lot of them, some of which I cannot figure out what they should be changed to, e.g. import net.minecraft.world.phys.Vec3;

So (a) is there a way to automatically change these? or
(b) how can I find out what the changes should be

GitHub

A fabric mod and api that lets you change player gravity direction - Mortimer-Kerman/GravityChanger

limpid smelt
#

!!mappings

solemn widgetBOT
#

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.

limpid smelt
#

It looks like the library uses mojmap while you use yarn