Package me.tamkungz.nilkit.remapping
Class SimpleRemap
java.lang.Object
me.tamkungz.nilkit.remapping.SimpleRemap
SimpleRemap — mapping table between human-readable names and obfuscated names.
Avoids hardcoding values like "bD", "cj", "iq" across the codebase.
Usage:
SimpleRemap remap = SimpleRemap.forVersion("1.4.7");
String fieldName = remap.field("EntityPlayer", "inventory");
String methodName = remap.method("EntityPlayer", "getHeldItem");
Sources:
1) Generated mappings extracted at build time from tools/MinecraftRemapping
2) Direct SRG files in tools/MinecraftRemapping for developer runs
3) Built-in manual mappings
Priority in forVersion():
external SRG -> built-in manual overrides
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanapplyBuiltin(String version, SimpleRemap remap, boolean overwriteExisting) static booleanapplyGenerated(String version, SimpleRemap remap, boolean overwriteExisting) static SimpleRemapbuiltinOnly(String version) Creates a remap using built-in manual mappings only.Returns obfuscated class name.static SimpleRemapCreates an empty remap for custom or unsupported versions.Returns obfuscated field name.static SimpleRemapforVersion(String version) Creates a remap for a version by combining: 1) generated / SRG mappings 2) built-in manual overrides Built-in mappings are applied last so manual fixes win.static SimpleRemapgeneratedOnly(String version) Creates a remap using generated/submodule SRG mappings only.booleanisEmpty()Returns obfuscated method name.toString()
-
Method Details
-
forVersion
Creates a remap for a version by combining: 1) generated / SRG mappings 2) built-in manual overrides Built-in mappings are applied last so manual fixes win. -
builtinOnly
Creates a remap using built-in manual mappings only. -
generatedOnly
Creates a remap using generated/submodule SRG mappings only. -
empty
Creates an empty remap for custom or unsupported versions. -
applyBuiltin
-
applyGenerated
-
isEmpty
public boolean isEmpty() -
field
Returns obfuscated field name. Key format: "ClassName.fieldName" Falls back to the original name if not found. -
method
Returns obfuscated method name. -
cls
Returns obfuscated class name. -
getVersion
-
addField
-
addField
public SimpleRemap addField(String className, String friendly, String obf, boolean overwriteExisting) -
addMethod
-
addMethod
public SimpleRemap addMethod(String className, String friendly, String obf, boolean overwriteExisting) -
addClass
-
addClass
-
toString
-