Fix existing transformers
This commit is contained in:
parent
6ddfa10903
commit
cad7263d9e
5 changed files with 85 additions and 124 deletions
|
@ -48,7 +48,8 @@ dependencies {
|
||||||
|
|
||||||
modImplementation libs.quilted.fabric.api
|
modImplementation libs.quilted.fabric.api
|
||||||
|
|
||||||
modApi include("dev.emi:trinkets:${libs.versions.trinkets.get()}")
|
// not JiJ because it causes its mixins to fail to load
|
||||||
|
modApi "dev.emi:trinkets:${libs.versions.trinkets.get()}"
|
||||||
modApi include("com.unascribed:lib39-core:${libs.versions.lib39.get()}+${libs.versions.minecraft.get()}")
|
modApi include("com.unascribed:lib39-core:${libs.versions.lib39.get()}+${libs.versions.minecraft.get()}")
|
||||||
modApi include("com.unascribed:lib39-dessicant:${libs.versions.lib39.get()}+${libs.versions.minecraft.get()}")
|
modApi include("com.unascribed:lib39-dessicant:${libs.versions.lib39.get()}+${libs.versions.minecraft.get()}")
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,8 @@ public class ItemStackMixin {
|
||||||
// Excluding ourselves from this check to force unequip/equip when switching bag items fixes a duplication bug
|
// Excluding ourselves from this check to force unequip/equip when switching bag items fixes a duplication bug
|
||||||
// Gross and hacky but oh well, can't mixin mixins.
|
// Gross and hacky but oh well, can't mixin mixins.
|
||||||
@Inject(method = "areEqual", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "areEqual", at = @At("HEAD"), cancellable = true)
|
||||||
private void scout$grossTrinketsEquipFix(ItemStack newStack, CallbackInfoReturnable<Boolean> callbackInfo) {
|
private static void scout$grossTrinketsEquipFix(ItemStack stack, ItemStack otherStack, CallbackInfoReturnable<Boolean> callbackInfo) {
|
||||||
ItemStack self = (ItemStack) (Object) this;
|
if (stack.getItem() instanceof BaseBagItem && otherStack.getItem() instanceof BaseBagItem) {
|
||||||
if (self.getItem() instanceof BaseBagItem && newStack.getItem() instanceof BaseBagItem) {
|
|
||||||
callbackInfo.setReturnValue(false);
|
callbackInfo.setReturnValue(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package pm.c7.scout.mixin;
|
||||||
|
|
||||||
import org.objectweb.asm.tree.*;
|
import org.objectweb.asm.tree.*;
|
||||||
import org.quiltmc.loader.api.QuiltLoader;
|
import org.quiltmc.loader.api.QuiltLoader;
|
||||||
|
|
||||||
import pm.c7.scout.mixinsupport.ClassNodeTransformer;
|
import pm.c7.scout.mixinsupport.ClassNodeTransformer;
|
||||||
|
|
||||||
import static org.objectweb.asm.Opcodes.*;
|
import static org.objectweb.asm.Opcodes.*;
|
||||||
|
@ -9,31 +10,22 @@ import static org.objectweb.asm.Opcodes.*;
|
||||||
public class ScreenHandlerTransformer implements ClassNodeTransformer {
|
public class ScreenHandlerTransformer implements ClassNodeTransformer {
|
||||||
@Override
|
@Override
|
||||||
public void transform(String name, ClassNode node) {
|
public void transform(String name, ClassNode node) {
|
||||||
var internalOnSlotClick = "m_nqfgpzfl";
|
var resolver = QuiltLoader.getMappingResolver();
|
||||||
var insertItem = "m_jpjdgbxy";
|
var namespace = "intermediary";
|
||||||
|
|
||||||
var PlayerEntity = "net/minecraft/unmapped/C_jzrpycqo";
|
var internalOnSlotClick = resolver.mapMethodName(namespace, name, "method_30010", "(IILnet/minecraft/class_1713;Lnet/minecraft/class_1657;)V");
|
||||||
var playerScreenHandler = "f_xvlfpipb";
|
|
||||||
|
|
||||||
var PlayerScreenHandler = "net/minecraft/unmapped/C_wgehrbdx";
|
|
||||||
var Slot = "net/minecraft/unmapped/C_nhvqfffd";
|
|
||||||
var DefaultedList = "net/minecraft/unmapped/C_rnrfftze";
|
|
||||||
|
|
||||||
if (QuiltLoader.isDevelopmentEnvironment()) {
|
|
||||||
internalOnSlotClick = "internalOnSlotClick";
|
|
||||||
insertItem = "insertItem";
|
|
||||||
|
|
||||||
PlayerEntity = "net/minecraft/entity/player/PlayerEntity";
|
|
||||||
playerScreenHandler = "playerScreenHandler";
|
|
||||||
|
|
||||||
PlayerScreenHandler = "net/minecraft/screen/PlayerScreenHandler";
|
|
||||||
Slot = "net/minecraft/screen/slot/Slot";
|
|
||||||
DefaultedList = "net/minecraft/util/collection/DefaultedList";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var PlayerEntity = resolver.mapClassName(namespace, "net.minecraft.class_1657");
|
||||||
|
var PlayerScreenHandler = slash(resolver.mapClassName(namespace, "net.minecraft.class_1723"));
|
||||||
var LPlayerScreenHandler = L(PlayerScreenHandler);
|
var LPlayerScreenHandler = L(PlayerScreenHandler);
|
||||||
|
String playerScreenHandler = resolver.mapFieldName(namespace, PlayerEntity, "field_7498", LPlayerScreenHandler);
|
||||||
|
PlayerEntity = slash(PlayerEntity);
|
||||||
|
|
||||||
|
var Slot = slash(resolver.mapClassName(namespace, "net.minecraft.class_1735"));
|
||||||
var LSlot = L(Slot);
|
var LSlot = L(Slot);
|
||||||
|
|
||||||
|
var DefaultedList = slash(resolver.mapClassName(namespace, "net.minecraft.class_2371"));
|
||||||
|
|
||||||
for (var mn : node.methods) {
|
for (var mn : node.methods) {
|
||||||
if (mn.name.equals(internalOnSlotClick)) {
|
if (mn.name.equals(internalOnSlotClick)) {
|
||||||
for (var insn : mn.instructions) {
|
for (var insn : mn.instructions) {
|
||||||
|
@ -42,32 +34,32 @@ public class ScreenHandlerTransformer implements ClassNodeTransformer {
|
||||||
if (insn.getNext() instanceof JumpInsnNode nextInsn && nextInsn.getOpcode() == IFGE) {
|
if (insn.getNext() instanceof JumpInsnNode nextInsn && nextInsn.getOpcode() == IFGE) {
|
||||||
var jumpTo = nextInsn.label;
|
var jumpTo = nextInsn.label;
|
||||||
mn.instructions.insert(nextInsn, insns(
|
mn.instructions.insert(nextInsn, insns(
|
||||||
ILOAD(1),
|
ILOAD(1),
|
||||||
INVOKESTATIC("pm/c7/scout/ScoutUtil", "isBagSlot", "(I)Z"),
|
INVOKESTATIC("pm/c7/scout/ScoutUtil", "isBagSlot", "(I)Z"),
|
||||||
IFNE(jumpTo)
|
IFNE(jumpTo)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
} else if (vin.getOpcode() == ASTORE && (vin.var == 6 || vin.var == 7)) {
|
} else if (vin.getOpcode() == ASTORE && vin.var == 7) {
|
||||||
if (vin.getPrevious() instanceof TypeInsnNode prevInsn && prevInsn.getOpcode() == CHECKCAST && prevInsn.desc.equals(Slot)) {
|
if (vin.getPrevious() instanceof TypeInsnNode prevInsn && prevInsn.getOpcode() == CHECKCAST && prevInsn.desc.equals(Slot)) {
|
||||||
if (prevInsn.getPrevious() instanceof MethodInsnNode prevPrevInsn && prevPrevInsn.getOpcode() == INVOKEVIRTUAL) {
|
if (prevInsn.getPrevious() instanceof MethodInsnNode prevPrevInsn && prevPrevInsn.getOpcode() == INVOKEVIRTUAL) {
|
||||||
if(prevPrevInsn.owner.equals(DefaultedList)) {
|
if(prevPrevInsn.owner.equals(DefaultedList)) {
|
||||||
LabelNode LnotBag = new LabelNode();
|
LabelNode LnotBag = new LabelNode();
|
||||||
LabelNode Lend = new LabelNode();
|
LabelNode Lend = new LabelNode();
|
||||||
mn.instructions.insertBefore(prevPrevInsn.getPrevious().getPrevious().getPrevious(), insns(
|
mn.instructions.insertBefore(prevPrevInsn.getPrevious().getPrevious().getPrevious(), insns(
|
||||||
ILOAD(1),
|
ILOAD(1),
|
||||||
INVOKESTATIC("pm/c7/scout/ScoutUtil", "isBagSlot", "(I)Z"),
|
INVOKESTATIC("pm/c7/scout/ScoutUtil", "isBagSlot", "(I)Z"),
|
||||||
IFEQ(LnotBag),
|
IFEQ(LnotBag),
|
||||||
ILOAD(1),
|
ILOAD(1),
|
||||||
ALOAD(4),
|
ALOAD(4),
|
||||||
GETFIELD(PlayerEntity, playerScreenHandler, LPlayerScreenHandler),
|
GETFIELD(PlayerEntity, playerScreenHandler, LPlayerScreenHandler),
|
||||||
INVOKESTATIC("pm/c7/scout/ScoutUtil", "getBagSlot", "(I" + LPlayerScreenHandler + ")" + LSlot),
|
INVOKESTATIC("pm/c7/scout/ScoutUtil", "getBagSlot", "(I" + LPlayerScreenHandler + ")" + LSlot),
|
||||||
CHECKCAST(Slot),
|
CHECKCAST(Slot),
|
||||||
ASTORE(vin.var),
|
ASTORE(vin.var),
|
||||||
GOTO(Lend),
|
GOTO(Lend),
|
||||||
LnotBag
|
LnotBag
|
||||||
));
|
));
|
||||||
mn.instructions.insert(vin, insns(
|
mn.instructions.insert(vin, insns(
|
||||||
Lend
|
Lend
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,44 +67,14 @@ public class ScreenHandlerTransformer implements ClassNodeTransformer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}/* else if (mn.name.equals(insertItem)) {
|
}
|
||||||
for (var insn : mn.instructions) {
|
|
||||||
if (insn instanceof VarInsnNode vin && vin.getOpcode() == ASTORE && vin.var == 7) {
|
|
||||||
if (vin.getPrevious() instanceof TypeInsnNode prevInsn && prevInsn.getOpcode() == CHECKCAST && prevInsn.desc.equals(Slot)) {
|
|
||||||
if (prevInsn.getPrevious() instanceof MethodInsnNode prevPrevInsn && prevPrevInsn.getOpcode() == INVOKEVIRTUAL) {
|
|
||||||
if(prevPrevInsn.owner.equals(DefaultedList)) {
|
|
||||||
LabelNode LnotBag = new LabelNode();
|
|
||||||
LabelNode LpastSlot = new LabelNode();
|
|
||||||
mn.instructions.insertBefore(prevPrevInsn.getPrevious().getPrevious().getPrevious(), insns(
|
|
||||||
INVOKESTATIC("pm/c7/scout/ScoutUtil", "getPlayerScreenHandler", "()" + LPlayerScreenHandler),
|
|
||||||
ASTORE(20),
|
|
||||||
ALOAD(20),
|
|
||||||
IFNULL(LpastSlot),
|
|
||||||
ILOAD(6),
|
|
||||||
INVOKESTATIC("pm/c7/scout/ScoutUtil", "isBagSlot", "(I)Z"),
|
|
||||||
IFEQ(LnotBag),
|
|
||||||
ILOAD(6),
|
|
||||||
ALOAD(20),
|
|
||||||
INVOKESTATIC("pm/c7/scout/ScoutUtil", "getBagSlot", "(I" + LPlayerScreenHandler + ")" + LSlot),
|
|
||||||
CHECKCAST(Slot),
|
|
||||||
ASTORE(vin.var),
|
|
||||||
LnotBag,
|
|
||||||
ILOAD(6),
|
|
||||||
INVOKESTATIC("pm/c7/scout/ScoutUtil", "isBagSlot", "(I)Z"),
|
|
||||||
IFNE(LpastSlot)
|
|
||||||
));
|
|
||||||
mn.instructions.insert(vin, insns(
|
|
||||||
LpastSlot
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String slash(String clazz) {
|
||||||
|
return clazz.replaceAll("\\.", "/");
|
||||||
|
}
|
||||||
|
|
||||||
private String L(String clazz) {
|
private String L(String clazz) {
|
||||||
return "L" + clazz + ";";
|
return "L" + clazz + ";";
|
||||||
}
|
}
|
||||||
|
@ -122,34 +84,34 @@ public class ScreenHandlerTransformer implements ClassNodeTransformer {
|
||||||
for (var i : insns) li.add(i);
|
for (var i : insns) li.add(i);
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
private static VarInsnNode ILOAD(int var) {
|
private static VarInsnNode ILOAD(int v) {
|
||||||
return new VarInsnNode(ILOAD, var);
|
return new VarInsnNode(ILOAD, v);
|
||||||
}
|
}
|
||||||
private static MethodInsnNode INVOKESTATIC(String owner, String name, String desc) {
|
private static MethodInsnNode INVOKESTATIC(String owner, String name, String desc) {
|
||||||
return new MethodInsnNode(INVOKESTATIC, owner, name, desc);
|
return new MethodInsnNode(INVOKESTATIC, owner, name, desc);
|
||||||
}
|
}
|
||||||
private static JumpInsnNode IFNE(LabelNode var) {
|
private static JumpInsnNode IFNE(LabelNode v) {
|
||||||
return new JumpInsnNode(IFNE, var);
|
return new JumpInsnNode(IFNE, v);
|
||||||
}
|
}
|
||||||
private static JumpInsnNode IFEQ(LabelNode var) {
|
private static JumpInsnNode IFEQ(LabelNode v) {
|
||||||
return new JumpInsnNode(IFEQ, var);
|
return new JumpInsnNode(IFEQ, v);
|
||||||
}
|
}
|
||||||
private static VarInsnNode ALOAD(int var) {
|
private static VarInsnNode ALOAD(int v) {
|
||||||
return new VarInsnNode(ALOAD, var);
|
return new VarInsnNode(ALOAD, v);
|
||||||
}
|
}
|
||||||
private static VarInsnNode ASTORE(int var) {
|
private static VarInsnNode ASTORE(int v) {
|
||||||
return new VarInsnNode(ASTORE, var);
|
return new VarInsnNode(ASTORE, v);
|
||||||
}
|
}
|
||||||
private static FieldInsnNode GETFIELD(String owner, String name, String desc) {
|
private static FieldInsnNode GETFIELD(String owner, String name, String desc) {
|
||||||
return new FieldInsnNode(GETFIELD, owner, name, desc);
|
return new FieldInsnNode(GETFIELD, owner, name, desc);
|
||||||
}
|
}
|
||||||
private static JumpInsnNode IFNULL(LabelNode var) {
|
private static JumpInsnNode IFNULL(LabelNode v) {
|
||||||
return new JumpInsnNode(IFNULL, var);
|
return new JumpInsnNode(IFNULL, v);
|
||||||
}
|
}
|
||||||
private static TypeInsnNode CHECKCAST(String desc) {
|
private static TypeInsnNode CHECKCAST(String desc) {
|
||||||
return new TypeInsnNode(CHECKCAST, desc);
|
return new TypeInsnNode(CHECKCAST, desc);
|
||||||
}
|
}
|
||||||
private static JumpInsnNode GOTO(LabelNode var) {
|
private static JumpInsnNode GOTO(LabelNode v) {
|
||||||
return new JumpInsnNode(GOTO, var);
|
return new JumpInsnNode(GOTO, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package pm.c7.scout.mixin.client;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
|
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
|
||||||
|
@ -46,7 +45,7 @@ public abstract class HandledScreenMixin<T extends ScreenHandler> extends Screen
|
||||||
@Shadow
|
@Shadow
|
||||||
protected int backgroundHeight;
|
protected int backgroundHeight;
|
||||||
|
|
||||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawBackground(Lnet/minecraft/client/util/math/MatrixStack;FII)V"))
|
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawBackground(Lnet/minecraft/client/gui/GuiGraphics;FII)V"))
|
||||||
private void scout$drawSatchelRow(GuiGraphics graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
private void scout$drawSatchelRow(GuiGraphics graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
if (this.client != null && this.client.player != null && !ScoutUtil.isScreenBlacklisted(this)) {
|
if (this.client != null && this.client.player != null && !ScoutUtil.isScreenBlacklisted(this)) {
|
||||||
ItemStack backStack = ScoutUtil.findBagItem(this.client.player, BaseBagItem.BagType.SATCHEL, false);
|
ItemStack backStack = ScoutUtil.findBagItem(this.client.player, BaseBagItem.BagType.SATCHEL, false);
|
||||||
|
@ -272,7 +271,7 @@ public abstract class HandledScreenMixin<T extends ScreenHandler> extends Screen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawForeground(Lnet/minecraft/client/util/math/MatrixStack;II)V"))
|
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawForeground(Lnet/minecraft/client/gui/GuiGraphics;II)V"))
|
||||||
public void scout$drawOurSlots(GuiGraphics graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
public void scout$drawOurSlots(GuiGraphics graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
if (this.client != null && this.client.player != null && !ScoutUtil.isScreenBlacklisted(this)) {
|
if (this.client != null && this.client.player != null && !ScoutUtil.isScreenBlacklisted(this)) {
|
||||||
for (int i = ScoutUtil.SATCHEL_SLOT_START; i > ScoutUtil.BAG_SLOTS_END; i--) {
|
for (int i = ScoutUtil.SATCHEL_SLOT_START; i > ScoutUtil.BAG_SLOTS_END; i--) {
|
||||||
|
|
|
@ -2,25 +2,21 @@ package pm.c7.scout.mixin.client;
|
||||||
|
|
||||||
import org.objectweb.asm.tree.*;
|
import org.objectweb.asm.tree.*;
|
||||||
import org.quiltmc.loader.api.QuiltLoader;
|
import org.quiltmc.loader.api.QuiltLoader;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import pm.c7.scout.mixinsupport.ClassNodeTransformer;
|
import pm.c7.scout.mixinsupport.ClassNodeTransformer;
|
||||||
|
|
||||||
import static org.objectweb.asm.Opcodes.*;
|
import static org.objectweb.asm.Opcodes.*;
|
||||||
|
|
||||||
public class HandledScreenTransformer implements ClassNodeTransformer {
|
public class HandledScreenTransformer implements ClassNodeTransformer {
|
||||||
private static Logger LOGGER = LoggerFactory.getLogger("Scout:HandledScreenTransformer");
|
|
||||||
@Override
|
@Override
|
||||||
public void transform(String name, ClassNode node) {
|
public void transform(String name, ClassNode node) {
|
||||||
var drawSlot = "m_zioswvnu";
|
var resolver = QuiltLoader.getMappingResolver();
|
||||||
var Slot = "net/minecraft/unmapped/C_nhvqfffd";
|
var namespace = "intermediary";
|
||||||
var y = "f_tttqoodj";
|
|
||||||
|
|
||||||
if (QuiltLoader.isDevelopmentEnvironment()) {
|
var drawSlot = resolver.mapMethodName(namespace, name, "method_2385", "(Lnet/minecraft/class_332;Lnet/minecraft/class_1735;)V");
|
||||||
drawSlot = "drawSlot";
|
var Slot = resolver.mapClassName(namespace, "net.minecraft.class_1735");
|
||||||
Slot = "net/minecraft/screen/slot/Slot";
|
var y = resolver.mapFieldName(namespace, Slot, "field_7872", "I");
|
||||||
y = "y";
|
Slot = slash(Slot);
|
||||||
}
|
|
||||||
|
|
||||||
for (var mn : node.methods) {
|
for (var mn : node.methods) {
|
||||||
if (mn.name.equals(drawSlot)) {
|
if (mn.name.equals(drawSlot)) {
|
||||||
|
@ -32,19 +28,19 @@ public class HandledScreenTransformer implements ClassNodeTransformer {
|
||||||
LabelNode LnotBag = new LabelNode();
|
LabelNode LnotBag = new LabelNode();
|
||||||
int SAFE_REGISTER = 20;
|
int SAFE_REGISTER = 20;
|
||||||
mn.instructions.insert(vin, insns(
|
mn.instructions.insert(vin, insns(
|
||||||
ALOAD(2),
|
ALOAD(2),
|
||||||
INSTANCEOF("pm/c7/scout/screen/BagSlot"),
|
INSTANCEOF("pm/c7/scout/screen/BagSlot"),
|
||||||
IFEQ(LnotBag),
|
IFEQ(LnotBag),
|
||||||
ALOAD(2),
|
ALOAD(2),
|
||||||
CHECKCAST("pm/c7/scout/screen/BagSlot"),
|
CHECKCAST("pm/c7/scout/screen/BagSlot"),
|
||||||
ASTORE(SAFE_REGISTER),
|
ASTORE(SAFE_REGISTER),
|
||||||
ALOAD(SAFE_REGISTER),
|
ALOAD(SAFE_REGISTER),
|
||||||
INVOKEVIRTUAL("pm/c7/scout/screen/BagSlot", "getX", "()I"),
|
INVOKEVIRTUAL("pm/c7/scout/screen/BagSlot", "getX", "()I"),
|
||||||
ISTORE(vin.var - 1),
|
ISTORE(vin.var - 1),
|
||||||
ALOAD(SAFE_REGISTER),
|
ALOAD(SAFE_REGISTER),
|
||||||
INVOKEVIRTUAL("pm/c7/scout/screen/BagSlot", "getY", "()I"),
|
INVOKEVIRTUAL("pm/c7/scout/screen/BagSlot", "getY", "()I"),
|
||||||
ISTORE(vin.var),
|
ISTORE(vin.var),
|
||||||
LnotBag
|
LnotBag
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,19 +51,23 @@ public class HandledScreenTransformer implements ClassNodeTransformer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String slash(String clazz) {
|
||||||
|
return clazz.replaceAll("\\.", "/");
|
||||||
|
}
|
||||||
|
|
||||||
private InsnList insns(AbstractInsnNode... insns) {
|
private InsnList insns(AbstractInsnNode... insns) {
|
||||||
var li = new InsnList();
|
var li = new InsnList();
|
||||||
for (var i : insns) li.add(i);
|
for (var i : insns) li.add(i);
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
private static JumpInsnNode IFEQ(LabelNode var) {
|
private static JumpInsnNode IFEQ(LabelNode v) {
|
||||||
return new JumpInsnNode(IFEQ, var);
|
return new JumpInsnNode(IFEQ, v);
|
||||||
}
|
}
|
||||||
private static VarInsnNode ALOAD(int var) {
|
private static VarInsnNode ALOAD(int v) {
|
||||||
return new VarInsnNode(ALOAD, var);
|
return new VarInsnNode(ALOAD, v);
|
||||||
}
|
}
|
||||||
private static VarInsnNode ASTORE(int var) {
|
private static VarInsnNode ASTORE(int v) {
|
||||||
return new VarInsnNode(ASTORE, var);
|
return new VarInsnNode(ASTORE, v);
|
||||||
}
|
}
|
||||||
private static TypeInsnNode INSTANCEOF(String desc) {
|
private static TypeInsnNode INSTANCEOF(String desc) {
|
||||||
return new TypeInsnNode(INSTANCEOF, desc);
|
return new TypeInsnNode(INSTANCEOF, desc);
|
||||||
|
@ -78,7 +78,7 @@ public class HandledScreenTransformer implements ClassNodeTransformer {
|
||||||
private static MethodInsnNode INVOKEVIRTUAL(String owner, String name, String desc) {
|
private static MethodInsnNode INVOKEVIRTUAL(String owner, String name, String desc) {
|
||||||
return new MethodInsnNode(INVOKEVIRTUAL, owner, name, desc);
|
return new MethodInsnNode(INVOKEVIRTUAL, owner, name, desc);
|
||||||
}
|
}
|
||||||
private static VarInsnNode ISTORE(int var) {
|
private static VarInsnNode ISTORE(int v) {
|
||||||
return new VarInsnNode(ISTORE, var);
|
return new VarInsnNode(ISTORE, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue