Jump to content

Replacing base class


sep87x

Recommended Posts

So, last question: the Methods.class in your patch method ... does it contain a method it should be replaced with?

yes. It has the renderFirstPersonArm() as it is in the jar. THATS VERY IMPORTANT. If there's a return, etc, you still need to do that return.

My function's parameters that I gave you are as follows:

name: the name of the method you need, obfuscated or not. (do both, call it twice)

bytes the bytes you recived from the transform method

desc is the methods description

iFile is the path to the class containing the replacement methods.

rname is the name of the replacement method.

Hope I could help.

Link to comment
Share on other sites

And I don't see it in your code spoiler :P

It is there. Its in the transform method below the first code. It is right under the print saying what kind of transformation is being done and what kind of environment the game is in.

Link to comment
Share on other sites

Yes, I know, but I wanted to know what the newimport method looks like. I have the call setup in my class now:

 

		if (arg0.equals("acv")) {
		System.out.println("******** INSIDE OBFUSCATED BIOMEGENDESERT TRANSFORMER ABOUT TO PATCH: " + arg0);
		newimport("", arg2);

 

But there must be somewhere the code for the newimport method, you know, the

 

	private void newimport(String string, byte[] arg2) {

}

 

thing, or am I literally unable to spot it?

Link to comment
Share on other sites

dude....... you're returning null in

 

@Override
        public byte[] transform(String arg0, String arg1, byte[] arg2) {
                if (arg0.equals("acv")) {
                        System.out.println("******** INSIDE OBFUSCATED BIOMEGENDESERT TRANSFORMER ABOUT TO PATCH: " + arg0);
                        try {
                                return patch("a", arg2, "(Lue;)V", "/net/sep87x/desertwells/ASMMethods.class", "decorate");
                        } catch (IOException e) {
                                e.printStackTrace();
                        }
                }
               
                if (arg0.equals("net.minecraft.world.biome.BiomeGenDesert")) {
                        System.out.println("******** INSIDE BIOMEGENDESERT TRANSFORMER ABOUT TO PATCH: " + arg0);
                        try {
                                return patch("decorate", arg2, "(Lnet/minecraft/world/World;Ljava/util/Random;II)V", "/net/sep87x/desertwells/ASMMethods.class", "decorate");
                        } catch (IOException e) {
                                e.printStackTrace();
                        }
                }
               
                return null;
        }

 

change that "return null" to "return arg2"

Link to comment
Share on other sites

I would never had thought that the fault lies in the return of the transform method. Shut up and take all my Thank-you's :)

 

One last question before beta testing. This works absolutely sweet in a deobfuscated environment, but I am a bit worried about the functionality in an obfuscated environment.

 

return patch("a", arg2, "(Lue;)V", "/net/sep87x/desertwells/ASMMethods.class", "decorate");

 

What does the description "(Lue;)V" stand for? I know what the V means, but what does Lue; mean? Is that the obfuscated name of the RenderPlayer class? And if so, how do I need to make it fit the unobfuscated description "(Lnet/minecraft/world/World;Ljava/util/Random;II)V". Does it stay the same?

Link to comment
Share on other sites

i'm too lazy to check what class it is, but yes, it's the obfuscated name of some class, and yes, you need to change it. you need to find out the obfuscated name of World.class and use that. so, for example:

 

if World.class's obfuscated name is "asdfasdf.class"

 

(Lnet/minecraft/world/World;Ljava/util/Random;II)V

 

will turn into

 

(Lasdfasdf;Ljava/util/Random;II)V

 

that goes for all classes that get obfuscated.

 

 

 

EDIT:

 

if i remember right, "arg1" in

 

public byte[] transform(String arg0, String arg1, byte[] arg2)

 

is already the unobfuscated name. if it is, that would make things much easier. normally, i use the obfuscated names whenever i recompile and run my coremods in mc. i don't remember why i opted not to use that second argument. i'll have to look into again and do some testing to see if it is and if it's safe. i'll get back here if i find anything useful

Link to comment
Share on other sites

Wow, it's done crashing and it doesn't seem to works just fine. It seems like the replacement method returns null, but this shouldn't be happening.

 

java.lang.NoClassDefFoundError: net/minecraft/world/biome/BiomeGenDesert
at net.minecraft.world.biome.BiomeGenBase.<clinit>(BiomeGenBase.java:43)
at net.minecraft.world.WorldType.<clinit>(WorldType.java:23)
at net.minecraft.world.storage.WorldInfo.<init>(WorldInfo.java:88)
at net.minecraft.world.storage.SaveFormatOld.func_75803_c(SourceFile:59)
at net.minecraft.world.chunk.storage.AnvilSaveConverter.func_75799_b(SourceFile:57)
at net.minecraft.client.gui.GuiSelectWorld.func_74073_h(SourceFile:75)
at net.minecraft.client.gui.GuiSelectWorld.func_73866_w_(SourceFile:54)
at net.minecraft.client.gui.GuiScreen.func_73872_a(SourceFile:94)
at net.minecraft.client.Minecraft.func_71373_a(Minecraft.java:720)
at net.minecraft.client.gui.GuiMainMenu.func_73875_a(GuiMainMenu.java:297)
at net.minecraft.client.gui.GuiScreen.func_73864_a(SourceFile:69)
at net.minecraft.client.gui.GuiMainMenu.func_73864_a(GuiMainMenu.java:619)
at net.minecraft.client.gui.GuiScreen.func_73867_d(SourceFile:128)
at net.minecraft.client.gui.GuiScreen.func_73862_m(SourceFile:107)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1554)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:898)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
Caused by: java.lang.ClassNotFoundException: net.minecraft.world.biome.BiomeGenDesert
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:179)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 24 more
Caused by: java.lang.NullPointerException
at net.sep87x.desertwells.DesertGenClassTransformer.patch(DesertGenClassTransformer.java:80)
at net.sep87x.desertwells.DesertGenClassTransformer.transform(DesertGenClassTransformer.java:23)
at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:267)
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:165)
... 26 more

 

Again, I have no idea what could be the error. The method exists and is NOT null. Could it be caused by the super-call? http://gw.minecraftforge.net/9j8v http://gw.minecraftforge.net/SQLk

(Done in an obfuscated environment)

 

Edit: The error has been created because there wasn't a replacement method. It exists though. What could be the source of the error?

 

Edit 2: Oh man, I forgot that the method name inside the ASMMethods class is also obfuscated. Changed it. Works. Thanks to anyonw who has helped :)

Link to comment
Share on other sites

Wow, it's done crashing and it doesn't seem to works just fine. It seems like the replacement method returns null, but this shouldn't be happening.

 

java.lang.NoClassDefFoundError: net/minecraft/world/biome/BiomeGenDesert
at net.minecraft.world.biome.BiomeGenBase.<clinit>(BiomeGenBase.java:43)
at net.minecraft.world.WorldType.<clinit>(WorldType.java:23)
at net.minecraft.world.storage.WorldInfo.<init>(WorldInfo.java:88)
at net.minecraft.world.storage.SaveFormatOld.func_75803_c(SourceFile:59)
at net.minecraft.world.chunk.storage.AnvilSaveConverter.func_75799_b(SourceFile:57)
at net.minecraft.client.gui.GuiSelectWorld.func_74073_h(SourceFile:75)
at net.minecraft.client.gui.GuiSelectWorld.func_73866_w_(SourceFile:54)
at net.minecraft.client.gui.GuiScreen.func_73872_a(SourceFile:94)
at net.minecraft.client.Minecraft.func_71373_a(Minecraft.java:720)
at net.minecraft.client.gui.GuiMainMenu.func_73875_a(GuiMainMenu.java:297)
at net.minecraft.client.gui.GuiScreen.func_73864_a(SourceFile:69)
at net.minecraft.client.gui.GuiMainMenu.func_73864_a(GuiMainMenu.java:619)
at net.minecraft.client.gui.GuiScreen.func_73867_d(SourceFile:128)
at net.minecraft.client.gui.GuiScreen.func_73862_m(SourceFile:107)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1554)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:898)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
Caused by: java.lang.ClassNotFoundException: net.minecraft.world.biome.BiomeGenDesert
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:179)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 24 more
Caused by: java.lang.NullPointerException
at net.sep87x.desertwells.DesertGenClassTransformer.patch(DesertGenClassTransformer.java:80)
at net.sep87x.desertwells.DesertGenClassTransformer.transform(DesertGenClassTransformer.java:23)
at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:267)
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:165)
... 26 more

 

Again, I have no idea what could be the error. The method exists and is NOT null. Could it be caused by the super-call? http://gw.minecraftforge.net/9j8v http://gw.minecraftforge.net/SQLk

(Done in an obfuscated environment)

 

Edit: The error has been created because there wasn't a replacement method. It exists though. What could be the source of the error?

 

Edit 2: Oh man, I forgot that the method name inside the ASMMethods class is also obfuscated. Changed it. Works. Thanks to anyonw who has helped :)

I knew your problem was in the returning of the bytes xD. Guess I just missed that, because I assumed after you changed your code it would be fixed. Glad you got this worked out.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • SLOT DANA : Situs Slot Gacor Nagaliga Deposit Via DANA 10.000
    • NAGALIGA :  Agen Taruhan Mix Parlay Bola EURO Terpercaya Di Indonesia Nagaliga merupakan situs taruhan  judi bola euro dan slot gacor terbaik menyediakan link alternatif terbaik dan pastinya bisa di akses di seluruh penjuru dunia. Ayo meriahkan EURO bersama situs Nagaliga kemenangan berapapun pasti dibayar lunas tanpa ada kendala.
    • I have no idea how a UI mod crashed a whole world but HUGE props to you man, just saved me +2 months of progress!  
    • So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI)   I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.