![JAR search and dependency download from the Maven repository](/logo.png)
com.llamalad7.mixinextras.utils.UniquenessHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mixinextras-fabric Show documentation
Show all versions of mixinextras-fabric Show documentation
Companion library to Mixin with lots of features to improve the compatibility and concision of your mixins!
package com.llamalad7.mixinextras.utils;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
public class UniquenessHelper {
public static String getUniqueMethodName(ClassNode classNode, String name) {
for (int counter = classNode.methods.size(); ; counter++) {
String candidate = name + '$' + counter;
boolean isValid = true;
for (MethodNode methodNode : classNode.methods) {
if (methodNode.name.equals(candidate)) {
isValid = false;
break;
}
}
if (isValid) {
return candidate;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy