@@ -24,23 +24,22 @@ public class ASMTransformer implements IClassTransformer {
24
24
25
25
@ Override
26
26
public byte [] transform (String name , byte [] bytes ) {
27
- switch (name ) {
28
- case "bn" :
29
- return patchStringTranslate (bytes , true );
30
- case "net.minecraft.util.StringTranslate" :
31
- return patchStringTranslate (bytes , false );
32
- case "net.minecraft.client.Minecraft" :
33
- return patchMinecraft (bytes , LoadingPlugin .isGameObfuscated ());
34
- case "u" :
35
- case "net.minecraft.util.ChatAllowedCharacters" :
36
- return patchAllowedCharacters (bytes );
27
+ if (name .equals ("bn" )) {
28
+ return patchStringTranslate (bytes , true );
29
+ } else if (name .equals ("net.minecraft.util.StringTranslate" )) {
30
+ return patchStringTranslate (bytes , false );
31
+ } else if (name .equals ("net.minecraft.client.Minecraft" )) {
32
+ return patchMinecraft (bytes , LoadingPlugin .isGameObfuscated ());
33
+ } else if (name .equals ("u" ) || name .equals ("net.minecraft.util.ChatAllowedCharacters" )) {
34
+ return patchAllowedCharacters (bytes );
37
35
}
38
36
return bytes ;
39
37
}
40
38
41
39
/**
42
40
* Делает русскую локаль не-unicode
43
41
*/
42
+ @ SuppressWarnings ("deprecation" )
44
43
private byte [] patchStringTranslate (byte [] bytes , boolean obf ) {
45
44
ClassNode clazz = Utils .readClass (bytes );
46
45
@@ -66,7 +65,7 @@ private byte[] patchStringTranslate(byte[] bytes, boolean obf) {
66
65
InsnList list = new InsnList ();
67
66
list .add (new LdcInsnNode ("ru_RU" ));
68
67
list .add (new VarInsnNode (ALOAD , 1 )); // #1 param
69
- list .add (new MethodInsnNode (INVOKEVIRTUAL , Type .getInternalName (String .class ), "equals" , Type .getMethodDescriptor (Type .BOOLEAN_TYPE , Type .getType (Object .class )), false ));
68
+ list .add (new MethodInsnNode (INVOKEVIRTUAL , Type .getInternalName (String .class ), "equals" , Type .getMethodDescriptor (Type .BOOLEAN_TYPE , Type .getType (Object .class ))));
70
69
list .add (new JumpInsnNode (IFEQ , label ));
71
70
list .add (new VarInsnNode (ALOAD , 0 )); // this
72
71
list .add (new InsnNode (ICONST_0 ));
0 commit comments