mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 04:32:33 +00:00
Mix initialisers more effectively, fixes @Aaron1011
This commit is contained in:
1 parent
a826bfdb9b
commit
98eb5f7f5b
3 files changed
+41
-12
No files matched your search
@@ -29,8 +29,10 @@ import static org.spongepowered.asm.lib.ClassWriter.*;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.spongepowered.asm.lib.ClassReader;
|
||||
import org.spongepowered.asm.lib.ClassWriter;
|
||||
@@ -883,4 +885,17 @@ public class ASMHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<LabelNode, LabelNode> cloneLabels(InsnList source) {
|
||||
Map<LabelNode, LabelNode> labels = new HashMap<LabelNode, LabelNode>();
|
||||
|
||||
for (Iterator<AbstractInsnNode> iter = source.iterator(); iter.hasNext();) {
|
||||
AbstractInsnNode insn = iter.next();
|
||||
if (insn instanceof LabelNode) {
|
||||
labels.put((LabelNode)insn, new LabelNode(((LabelNode)insn).getLabel()));
|
||||
}
|
||||
}
|
||||
|
||||
return labels;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user