Yarn Remapper
yarn_remapper is a Rust library that remaps Minecraft Yarn named mappings to their obfuscated counterparts. It parses the TINY v2 mapping format provided by FabricMC and enables the remapping of class names, method names, field names, and their descriptors. This tool is essential for accessing obfuscated classes, fields, and methods via the Java Native Interface (JNI) and is a foundational component of LiquidBounce Lite, a Minecraft DLL injection client written in Rust.
How it Works
The yarn_remapper library leverages the TINY v2 mapping format, which uses hierarchical sections to define mappings between named, intermediary, and official obfuscated class names, method names, field names, and descriptors. These mappings help transform names from the readable Yarn mappings to the obfuscated names used in Minecraft's official releases.
Example of a TINY v2 format snippet:
tiny 2 0 official intermediary named
c a class_123 pkg/SomeClass
f [I a field_789 someField
m (III)V a method_456 someMethod
p 1 param_0 x
p 2 param_1 y
p 3 param_2 z
c b class_234 pkg/xy/AnotherClass
m (Ljava/lang/String;)I a method_567 anotherMethod
Installation
Add yarn_remapper to your Cargo.toml dependencies:
[]
= "0.2.0"
Ensure you have downloaded the mapping file required for remapping:
TINY v2 Mapping File: yarn-1.20.4-rc1+build.1-mergedv2.jar
Usage
Here's an example of how to use yarn_remapper in your Rust project:
use ;
use MappingLoader;
use TinyV2Mapping;
use Path;
License
This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.
Contributions
Contributions are welcome! Please open a pull request or an issue to contribute to the project or suggest improvements.
This project is not affiliated with Mojang or Minecraft.