Posted July 5, 201411 yr Hi! I have done a mod to replace skin and cape with the hd support. It work perfectly in eclipse but I have always the same error when I run minecraft Forge normally, there is a crash: [00:16:33 INFO]: Client> 2014-07-06 00:16:33 [iNFOS] [ForgeModLoader] Launching wrapped minecraft {net.minecraft.client.main.Main} [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* INSIDE OBFUSCATED AbstractClientPlayer TRANSFORMER ABOUT TO PATCH: beu [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: <init> Desc:(Labw;Ljava/lang/String;)V [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: l Desc:()V [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: p Desc:()Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: q Desc:()Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: r Desc:()Lbjo; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: s Desc:()Lbjo; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: a Desc:(Lbjo;Ljava/lang/String;)Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: b Desc:(Lbjo;Ljava/lang/String;)Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: a Desc:(Lbjo;Ljava/lang/String;Lbjo;Lbfi;)Lbic; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: d Desc:(Ljava/lang/String;)Ljava/lang/String; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Inside target method1! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] Patching Method1 Complete! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Method Name: e Desc:(Ljava/lang/String;)Ljava/lang/String; [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] ********* Inside target2 method! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [iNFOS] [sTDOUT] Patching Method2 Complete! [00:16:36 INFO]: Client> 2014-07-06 00:16:36 [GRAVE] [ForgeModLoader] Unable to launch [00:16:36 INFO]: Client> java.lang.reflect.InvocationTargetException [00:16:36 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [00:16:36 INFO]: Client> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [00:16:36 INFO]: Client> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [00:16:36 INFO]: Client> at java.lang.reflect.Method.invoke(Unknown Source) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.Launch.main(Launch.java:27) [00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP [00:16:36 INFO]: Client> at net.minecraft.client.main.Main.main(SourceFile:37) [00:16:36 INFO]: Client> ... 6 more [00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> ... 7 more [00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityPlayerSP [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass1(Native Method) [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at java.security.SecureClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:178) [00:16:36 INFO]: Client> ... 9 more [00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityPlayerSP [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> ... 13 more [00:16:36 INFO]: Client> Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/AbstractClientPlayer [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass1(Native Method) [00:16:36 INFO]: Client> at java.lang.ClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at java.security.SecureClassLoader.defineClass(Unknown Source) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:178) [00:16:36 INFO]: Client> ... 15 more [00:16:36 INFO]: Client> Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.AbstractClientPlayer [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:186) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> at java.lang.ClassLoader.loadClass(Unknown Source) [00:16:36 INFO]: Client> ... 19 more [00:16:36 INFO]: Client> Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: bic [00:16:36 INFO]: Client> at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.ClassWriter.a(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.Frame.a(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.Frame.a(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.tree.MethodNode.accept(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.tree.MethodNode.accept(Unknown Source) [00:16:36 INFO]: Client> at org.objectweb.asm.tree.ClassNode.accept(Unknown Source) [00:16:36 INFO]: Client> at pickandcraftSkin.SkinClassTransformer.patchClassASM(SkinClassTransformer.java:157) [00:16:36 INFO]: Client> at pickandcraftSkin.SkinClassTransformer.transform(SkinClassTransformer.java:30) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:274) [00:16:36 INFO]: Client> at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:172) [00:16:36 INFO]: Client> ... 21 more [00:16:36 INFO]: Game ended with no troubles detected (exit code 0) I suppose that src are not obsfuscated but I don't understand why!
July 5, 201411 yr Author But i know what I do and It work perfectly in eclipse SkinClassTransformer http://pastebin.com/Tm6HXd6N SkinDummyContainer http://pastebin.com/bkMD0QMF SkinFMLLoadingPlugin http://pastebin.com/LXL0vT4i PlayerCustom http://pastebin.com/XiNXsb8R ImageBufferDowload http://pastebin.com/u7HrdK9k I think that it is the reobsbuscate whitch don't work
July 5, 201411 yr Use [ spoiler ] tags for posting error logs. It is generally bad practice to write comments in anything but English if you expect anyone else to have to look at your code. You are modifying vanilla code. I could be wrong, but I don't believe that will work. Additionally ... 1.6.4?
July 5, 201411 yr Ah. Well, that makes sense - but it seems a dangerous and incompatible way to go about it. Nevertheless, depending on the circumstances I can see that being useful.
July 6, 201411 yr It seems the mod in question in this topic is modifying the source code rather than the bytecode. I have had a look at modifying bytecode - it seemed approachable, but reflection is less of a hassle for now, with what I am trying to do. The information on coremods is absolutely valued and appreciated though, as many of the ideas I have for mods probably require coremods. Thank you!
July 6, 201411 yr Lines 25 and 26 of this file don't have a hardcoded value, but instead a value based on the resolution of the buffered image. That seems modified to me
July 6, 201411 yr Author Yes but the class is replaced with ASM thank's to the method patchJar. It's not good?
July 6, 201411 yr Author Ok so I will to change to patch only parseskin. I have a problem to optifine: We don't see the skin when optifine is installed. do you know why? And how access to the field imageheight et imagewidht with asm?
July 6, 201411 yr Author I can get the field with field visitor but how change the fields? And how call a method like hastransparence since a other class with asm?
July 6, 201411 yr Author I want to rewrite parseUserSkin to support the hd. I think the most easy is to do this: - I will delete all the the instructions - I add a call to a method - I rewrite parseUserSkin in this method But, to do this, I need to access to the field and change their value So I think use fieldvisitor to have the value of the field but I don't know how change the value and call functions in ImageBufferDownload.
July 6, 201411 yr Author I try to patch the class line to line like in this tutorial http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editingbut i have almost all the line to change is very laborious! How can do this differently? I think delete all the instruction and call a function like I have do to the getSkin function but I cant because I need to change field and call metho of the class ImageBufferDownload
July 6, 201411 yr Author I have the vanilla class ImageBufferDownload and I want to transform the vanilla function parseUserSkin (http://pastebin.com/E9burVR4) to http://pastebin.com/TSinTCsA. So I try to change line to line like in the tutorial. But here, I have a lot of change. I think this method isn't feasible in this case. I looked for a other method to change the function. I think to do this: remove all instruction in parseUserSkin and, instead of instruction add a call to a static function. But I can't do this beacause in parseUserSkin I need to call functions and change field witch are in ImageBufferDownload
July 6, 201411 yr Author I have get the bytecodes of class modified function http://pastebin.com/kjL7Hc5P vanilla function http://pastebin.com/cVMswNWq But what it's L0 L1 L2... I believe that is the line but they don't is on the good order
July 7, 201411 yr Author Ok But I need label to add condition if(this.imageHeight != this.imageWidth/2){ return null; } with the opcode IFNONNULL no ? Or I must use LINENUMBER? And what is FRAME SAME ? the bytecode of "this.imageWidth = par1BufferedImage.getWidth();" : mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitMethodInsn(INVOKEVIRTUAL, "java/awt/image/BufferedImage", "getWidth", "()I", false); mv.visitFieldInsn(PUTFIELD, "net/minecraft/client/renderer/ImageBufferDownload", "imageWidth", "I"); Why there is ALOAD 0? It serve no purpose!
July 8, 201411 yr Author Ok! Before to try to do the condition I try to change this.imageWidth = 64; this.imageHeight = 32; to this.imageWidth = par1BufferedImage.getWidth(); this.imageHeight = par1BufferedImage.getHeight(); So It's the bytecode of the vanilla function: http://pastebin.com/3WZ3yfnc And I do this: http://pastebin.com/tcXz3uZx But I have a crash http://pastebin.com/35umU3Tm I don't understand why!
July 8, 201411 yr Author I used System.print.out to debug and I have two opcode -1 so I correct the bipush_index + 3 and bipush_index + 4 to bipush_index + 5 and bipush_index + 6 I have also change the loop for targetNode affectation http://pastebin.com/LpfdgKxt But I have the same error I didn't saw you reply I correct this
July 8, 201411 yr Author Y Your error is because you didn't load "this" onto the stack for the PUTFIELD call. You first load the bufferedImage, then call getWidth / getHeight with INVOKEVIRTUAL. Yes but aload 0 is alredy before bipush All my problem come to targetnode affectation and bipush index. I have resolved this problem What there are two opcode -1? In my eclipse plugin bytecode outline I see one opcode FRAME SAME? First of all: it's generally considered good practice to make comments to your code in English if you intend others to read it. Sorry I don't think to translate my comments I have finish to patch the function... AND I HAVE A ERROR :'( The crash report http://pastebin.com/7yvyMShG obviously there is a cast problem. My code: http://pastebin.com/0TXer5jp I lose hope...
July 8, 201411 yr Author Oh my god AMAZING! It works! Thanks a lot for your help! thanks to you I can fix all errors! http://img15.hostingpics.net/thumbs/mini_74611620140709001037.png[/img] But it I reobfbuscate I will have error no? For instance toInjectAreaOpaque2.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/ImageBufferDownload", "imageHeight", "I")); will don't work because the obuscate name of ImageBufferDownload it's bfn?
July 8, 201411 yr Author And I have a error without eclipse, with the reobuscate class: 48:12 [iNFOS] [sTDERR] Exception in thread "Skin downloader: http://antibiotique.perso.sfr.fr/skins/gargan.png" java.lang.NoSuchFieldError: imageHeight [00:48:12 INFO]: Client> 2014-07-09 00:48:12 [iNFOS] [sTDERR] at net.minecraft.client.renderer.ImageBufferDownload.func_78432_a(SourceFile:15) [00:48:12 INFO]: Client> 2014-07-09 00:48:12 [iNFOS] [sTDERR] at net.minecraft.client.renderer.ThreadDownloadImageDataINNER1.run(SourceFile:76)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.