Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug no being able to set negative numbers in filter #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/main/java/stevesaddons/asm/StevesAddonsTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,23 @@ else if (node.getOpcode() == IFNE)
}
return list;
}
},
ADD_RETURN("onKeyStroke", "(Lvswe/stevesfactory/interfaces/GuiManager;CI)Z")
{
@Override
protected InsnList modifyInstructions(InsnList list)
{
AbstractInsnNode node = list.getFirst();
while (!(node.getOpcode() == GOTO && node.getPrevious().getOpcode() == INVOKEVIRTUAL))
{
node = node.getNext();
}

list.insertBefore(node, new InsnNode(ICONST_1));
list.insertBefore(node, new InsnNode(IRETURN));
list.remove(node);
return list;
}
};

protected String name;
Expand Down Expand Up @@ -566,7 +583,8 @@ private enum ClassName
CONTAINER_TYPES("vswe.stevesfactory.components.ComponentMenuContainerTypes", Transformer.WRITE_TO_NBT, Transformer.READ_FROM_NBT),
DATA_BIT_HELPER("vswe.stevesfactory.network.DataBitHelper", Transformer.BIT_HELPER_INIT),
CONNECTION_BLOCK_TYPE("vswe.stevesfactory.blocks.ConnectionBlockType", Transformer.IS_INSTANCE),
COMPONENT_MENU_INTERVAL("vswe.stevesfactory.components.ComponentMenuInterval", Transformer.IS_VISIBLE);
COMPONENT_MENU_INTERVAL("vswe.stevesfactory.components.ComponentMenuInterval", Transformer.IS_VISIBLE),
TEXT_BOX_LIST("vswe.stevesfactory.components.TextBoxNumberList", Transformer.ADD_RETURN);

private String name;
private Transformer[] transformers;
Expand Down