@@ -69,7 +69,7 @@ public class DelCharTweaker implements Tweaker {
6969 public DelCharTweaker (LaunchConfig config , LegacyTweakContext context ) {
7070 if (config == null || context == null ) {
7171 throw new IllegalArgumentException (
72- "Launch config and legacy tweak context must be non-null to construct DelCharTweaker." );
72+ "Launch config and legacy tweak context must be non-null to construct DelCharTweaker." );
7373 }
7474
7575 this .config = config ;
@@ -119,22 +119,22 @@ private String getGuiScreenName(ClassNode node) {
119119 AbstractInsnNode [] insns = fill (method .instructions .get (index ), 5 );
120120
121121 if (!compareInsn (insns [0 ], ALOAD , 1 ) || !compareInsn (insns [1 ], ALOAD , 0 ) ||
122- !compareInsn (insns [2 ], ILOAD ) || !compareInsn (insns [3 ], ILOAD ) ||
123- !compareInsn (insns [4 ], INVOKEVIRTUAL )) {
122+ !compareInsn (insns [2 ], ILOAD ) || !compareInsn (insns [3 ], ILOAD ) ||
123+ !compareInsn (insns [4 ], INVOKEVIRTUAL )) {
124124 continue ;
125125 }
126126
127- MethodInsnNode invokeInsn = (MethodInsnNode ) insns [4 ];
127+ MethodInsnNode invokeInsn = (MethodInsnNode )insns [4 ];
128128 if (!invokeInsn .owner .equals (argTypes [0 ].getInternalName ())) {
129129 continue ;
130130 }
131131
132132 Type [] invokeArgTypes = Type .getArgumentTypes (invokeInsn .desc );
133133 if (invokeArgTypes .length != 3 ||
134- invokeArgTypes [0 ].getSort () != Type .OBJECT ||
135- !invokeArgTypes [0 ].getInternalName ().equals (node .name ) ||
136- !invokeArgTypes [1 ].equals (Type .INT_TYPE ) ||
137- !invokeArgTypes [2 ].equals (Type .INT_TYPE )) {
134+ invokeArgTypes [0 ].getSort () != Type .OBJECT ||
135+ !invokeArgTypes [0 ].getInternalName ().equals (node .name ) ||
136+ !invokeArgTypes [1 ].equals (Type .INT_TYPE ) ||
137+ !invokeArgTypes [2 ].equals (Type .INT_TYPE )) {
138138 continue ;
139139 }
140140
@@ -178,19 +178,19 @@ private boolean isGuiChat(ClassNode node) {
178178 Type fieldType = Type .getType (field .desc );
179179
180180 if ((field .access & ACC_PROTECTED ) != 0 &&
181- (field .access & ACC_STATIC ) == 0 &&
182- fieldType .getSort () == Type .OBJECT &&
183- fieldType .getClassName ().equals ("java.lang.String" )) {
181+ (field .access & ACC_STATIC ) == 0 &&
182+ fieldType .getSort () == Type .OBJECT &&
183+ fieldType .getClassName ().equals ("java.lang.String" )) {
184184 hasProtectedString = true ;
185185 } else if ((field .access & ACC_PRIVATE ) != 0 &&
186- (field .access & ACC_STATIC ) == 0 &&
187- fieldType .equals (Type .INT_TYPE )) {
186+ (field .access & ACC_STATIC ) == 0 &&
187+ fieldType .equals (Type .INT_TYPE )) {
188188 hasPrivateInt = true ;
189189 } else if ((field .access & ACC_PRIVATE ) != 0 &&
190- (field .access & ACC_STATIC ) != 0 &&
191- (field .access & ACC_FINAL ) != 0 &&
192- fieldType .getSort () == Type .OBJECT &&
193- fieldType .getClassName ().equals ("java.lang.String" )) {
190+ (field .access & ACC_STATIC ) != 0 &&
191+ (field .access & ACC_FINAL ) != 0 &&
192+ fieldType .getSort () == Type .OBJECT &&
193+ fieldType .getClassName ().equals ("java.lang.String" )) {
194194 hasPrivateStaticFinalString = true ;
195195 }
196196 }
@@ -206,7 +206,7 @@ private boolean isGuiChat(ClassNode node) {
206206
207207 Type [] argTypes = Type .getArgumentTypes (method .desc );
208208 if (argTypes .length != 2 || !argTypes [0 ].equals (Type .CHAR_TYPE ) ||
209- !argTypes [1 ].equals (Type .INT_TYPE )) {
209+ !argTypes [1 ].equals (Type .INT_TYPE )) {
210210 continue ;
211211 }
212212
@@ -238,15 +238,14 @@ private boolean isGuiTextField(ClassNode node) {
238238 Type [] argTypes = Type .getArgumentTypes (method .desc );
239239
240240 if (argTypes .length == 7 &&
241- argTypes [0 ].getSort () == Type .OBJECT &&
242- argTypes [0 ].getInternalName ().equals (guiScreenName ) &&
243- argTypes [1 ].getSort () == Type .OBJECT && // FontRenderer
244- argTypes [2 ].equals (Type .INT_TYPE ) &&
245- argTypes [3 ].equals (Type .INT_TYPE ) &&
246- argTypes [4 ].equals (Type .INT_TYPE ) &&
247- argTypes [5 ].equals (Type .INT_TYPE ) &&
248- argTypes [6 ].getSort () == Type .OBJECT
249- && argTypes [6 ].getClassName ().equals ("java.lang.String" )) {
241+ argTypes [0 ].getSort () == Type .OBJECT &&
242+ argTypes [0 ].getInternalName ().equals (guiScreenName ) &&
243+ argTypes [1 ].getSort () == Type .OBJECT && // FontRenderer
244+ argTypes [2 ].equals (Type .INT_TYPE ) &&
245+ argTypes [3 ].equals (Type .INT_TYPE ) &&
246+ argTypes [4 ].equals (Type .INT_TYPE ) &&
247+ argTypes [5 ].equals (Type .INT_TYPE ) &&
248+ argTypes [6 ].getSort () == Type .OBJECT && argTypes [6 ].getClassName ().equals ("java.lang.String" )) {
250249 return true ;
251250 }
252251 }
@@ -274,13 +273,13 @@ private IntInsnNode getTargetInsn(AbstractInsnNode insn) {
274273 AbstractInsnNode [] insns = fill (insn , 4 );
275274
276275 if (!compareInsn (insns [0 ], IFGE ) ||
277- !compareInsn (insns [1 ], ILOAD , 1 ) ||
278- !compareInsn (insns [2 ], BIPUSH , 32 ) ||
279- !compareInsn (insns [3 ], IF_ICMPLE )) {
276+ !compareInsn (insns [1 ], ILOAD , 1 ) ||
277+ !compareInsn (insns [2 ], BIPUSH , 32 ) ||
278+ !compareInsn (insns [3 ], IF_ICMPLE )) {
280279 return null ;
281280 }
282281
283- return (IntInsnNode ) insns [2 ];
282+ return (IntInsnNode )insns [2 ];
284283 }
285284
286285 public boolean tweakClass (ClassNodeSource source , String name ) {
@@ -327,7 +326,9 @@ public boolean tweakClass(ClassNodeSource source, String name) {
327326
328327 for (MethodNode method : sourceNode .methods ) {
329328 for (AbstractInsnNode currentInsn = getFirst (
330- method .instructions ); currentInsn != null ; currentInsn = nextInsn (currentInsn )) {
329+ method .instructions );
330+ currentInsn != null ;
331+ currentInsn = nextInsn (currentInsn )) {
331332 IntInsnNode targetInsn = getTargetInsn (currentInsn );
332333 if (targetInsn == null ) {
333334 continue ;
0 commit comments