![JAR search and dependency download from the Maven repository](/logo.png)
com.llamalad7.mixinextras.injector.StackExtension 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.injector;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.MethodNode;
import org.spongepowered.asm.mixin.injection.struct.Target;
public class StackExtension {
private final MethodNode target;
public StackExtension(Target target) {
this.target = target.method;
}
public void receiver(boolean isStatic) {
if (!isStatic) {
target.maxStack++;
}
}
public void capturedArgs(Type[] argTypes, int argCount) {
for (int i = 0; i < argCount; i++) {
target.maxStack += argTypes[i].getSize();
}
}
public void extra(int size) {
target.maxStack += size;
}
public void ensureAtLeast(int size) {
if (target.maxStack < size) {
target.maxStack = size;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy