diff --git a/src/main/kotlin/net/weavemc/loader/mappings/XSrgMapper.kt b/src/main/kotlin/net/weavemc/loader/mappings/XSrgMapper.kt deleted file mode 100644 index 784df568..00000000 --- a/src/main/kotlin/net/weavemc/loader/mappings/XSrgMapper.kt +++ /dev/null @@ -1,44 +0,0 @@ -package net.weavemc.loader.mappings - -import org.objectweb.asm.commons.Remapper - -internal class XSrgMapper(resource: String) : Remapper() { - private val classes = mutableMapOf() - private val methods = mutableMapOf() - private val fields = mutableMapOf() - - init { - this.javaClass.getResourceAsStream(resource)!! - .bufferedReader() - .useLines { - it.filter { it.isNotEmpty() }.forEach { line -> - val split = line.drop(4).split(' ') - when(line.take(4)) { - "CL: " -> classes[split[0]] = split[1] - "MD: " -> { - val clazz = split[0].substringBeforeLast('/') - val method = split[0].substringAfterLast('/') - methods["$clazz.$method${split[1]}"] = split[2].substringAfterLast('/') - } - "FD: " -> { - val clazz = split[0].substringBeforeLast('/') - val field = split[0].substringAfterLast('/') - fields["$clazz.$field"] = split[2].substringAfterLast('/') - } - } - } - } - } - - fun mapReverse(internalName: String) = - classes.entries.find { it.value == internalName }?.key ?: internalName - - override fun map(internalName: String) = - classes.getOrDefault(internalName, internalName) - - override fun mapMethodName(owner: String, name: String, descriptor: String) = - methods.getOrDefault("$owner.$name$descriptor", name) - - override fun mapFieldName(owner: String, name: String, descriptor: String) = - fields.getOrDefault("$owner.$name", name) -}