Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kerbybit committed Sep 16, 2019
1 parent cd61937 commit cc61509
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/kerbybit/minecwaft/MinecwaftOwO.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class MinecwaftOwO {
static final String MODID = "MinecwaftOwO";
static final String VERSION = "1.0";

//private static final String[] faces = new String[]{"(*^ω^)", "(◕‿◕✿)", "(◕ᴥ◕)", "ʕ•ᴥ•ʔ", "ʕ→ᴥ←ʔ", "(*^.^*)", "owo", "(。♥‿♥。)", "uwu", "(* ̄з ̄)", ">w<", "^w^", "(つ✧ω✧)つ", "(/ =ω=)/"};
private static final String[] faces = new String[]{"(*^w^)", "(*^.^*)", "owo", "uwu", ">w<", "^w^", "(/ =w=)/"};
private static final Matcher[] faceText = new Matcher[]{
Pattern.compile("!( |$)").matcher(""),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.kerbybit.minecwaft.tweaker.transform;

import com.kerbybit.minecwaft.MinecwaftOwO;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.*;

import java.util.ListIterator;

public class FontRendererTransformer implements ITransformer {
@Override
public String[] getClassName() {
Expand All @@ -17,9 +14,10 @@ public void transform(ClassNode classNode, String name) {
for (MethodNode methodNode : classNode.methods) {
String methodName = mapMethodName(classNode, methodNode);

if (methodName.equalsIgnoreCase("renderStringAtPos") || methodName.equalsIgnoreCase("func_78255_a")) {
methodNode.instructions.insertBefore(methodNode.instructions.getFirst(), changeTextHook());
} else if (methodName.equalsIgnoreCase("getStringWidth") || methodName.equalsIgnoreCase("func_78256_a")) {
if (methodName.equalsIgnoreCase("renderStringAtPos")
|| methodName.equalsIgnoreCase("func_78255_a")
|| methodName.equalsIgnoreCase("getStringWidth")
|| methodName.equalsIgnoreCase("func_78256_a")) {
methodNode.instructions.insertBefore(methodNode.instructions.getFirst(), changeTextHook());
}
}
Expand All @@ -28,10 +26,6 @@ public void transform(ClassNode classNode, String name) {
private InsnList changeTextHook() {
InsnList insnList = new InsnList();

// ALOAD 1
// INVOKESTATIC com/kerbybit/minecwaft/MinecwaftOwO.makeOwO (Ljava/lang/String;)Ljava/lang/String;
// ASTORE 1

insnList.add(new VarInsnNode(Opcodes.ALOAD, 1));
insnList.add(new MethodInsnNode(
Opcodes.INVOKESTATIC,
Expand Down

0 comments on commit cc61509

Please sign in to comment.