so i downloaded the miner's coding pack and added the PATH variable and i decompiled the bin, resource, minecraft_server.jar, then i went into sources and opened EntityPig.java and uhhhh yeah...
import java.io.*;
public class EntityPig extends RenderChicken
{
public EntityPig()
{
field_15537_i = true;
}
public EntityPig(float f, float f1, boolean flag)
{
field_15541_e = f;
field_15540_f = f1;
field_15539_g = flag;
field_15537_i = true;
}
public void readPacketData(DataInputStream datainputstream)
{
field_15541_e = datainputstream.readFloat();
field_15540_f = datainputstream.readFloat();
super.readPacketData(datainputstream);
}
public void writePacketData(DataOutputStream dataoutputstream)
{
dataoutputstream.writeFloat(field_15541_e);
dataoutputstream.writeFloat(field_15540_f);
super.writePacketData(dataoutputstream);
}
public int getPacketSize()
{
return 9;
}
}
i used to code flash for a little while so i get the coding basics, but how do i know what the "field" + random number and letter does (do i have to search everywhere that the file extends and search for that specific function to find out what it does? >.<) , also the word obfuscated makes me laugh :biggrin.gif:
i think it means uhhhh you cant rename minecraftserver.java to minecraftserver.java.orig because u already have a file called minecraftserver.java.orig???? lucky guess?
I'm using netbeans to make a code for a new recipe for beta, but I can't figure it out.
public class mod_craftobsidian extends BaseMod
{
public void AddRecipes(eu recipes)
{
ModLoader.AddAllRecipes(new ev(og.ap,1), new Object[] {
"#", Character.valueOf('#'), og.x
});
}
}
What should the "ev" be because netbeans says it's wrong?
I'm using netbeans to make a code for a new recipe for beta, but I can't figure it out.
public class mod_craftobsidian extends BaseMod
{
public void AddRecipes(eu recipes)
{
ModLoader.AddAllRecipes(new ev(og.ap,1), new Object[] {
"#", Character.valueOf('#'), og.x
});
}
}
What should the "ev" be because netbeans says it's wrong?
Its wrong because you're never supposed to call AddAllRecipes.. that function is what calls YOUR mods AddRecipes function (along with all other mods addRecipe functions). You are just supposed to use the 'eu' object which is the Crafting manager and add directly to it. Thats why it was passed in as an argument to your function.
Recompilation guide using JavaC
Step 1: Locate javac and add it to your %PATH% variable (there are many guides out there if you're not sure how).
Step 2: Set up your development environment by creating a folder somewhere (example: c:\minecraft_dev).
Step 3: Copy all .jar's from the .minecraft/bin/ folder over to c:\minecraft_dev\bin folder. These should include: minecraft.jar, lwjgl.jar, lwjgl_util.jar, jinput.jar
Step 4: Follow the other guides in this thread to decompile whichever file you'd like into .java source code.
Step 5: Make whatever changes you would like to the .java file and save it into the base c:\minecraft_dev folder.
Step 6: Pop open a command prompt / terminal window and change to the folder >cd c:\minecraft_dev
Step 7: Compile the .java file into a class using the following line: C:\minecraft_dev\> javac -cp bin/minecraft.jar;bin/lwjgl.jar;bin/lwjgl_util.jar;bin/jinput.jar your.java
Step 8: After you've compiled the files you want to edit, add the updated classes to the minecraft.jar in your c:\minecraft_dev\bin folder. If you do not update this file with your new changes, the java linker will ignore any changes you've made when compiling classes.
Step 9: After inserting your class, copy your c:\minecraft_dev\bin\minecraft.jar into your .minecraft/bin folder to update the client with your new code.
An alternative is to put the full path for each of the .jar's listed above in the command line and do all your edits live on the ./minecraft/bin/minecraft.jar.
This should at least compile most of the simple class files provided in the minecraft.jar, although there will still be a good number of files that need manual edits to work.
This method could easily be converted into a batch file or shell script using a console version of zip / winrar to inject compiled class files directly into the jar.
Hope this helps a little.
I've seen a tutorial like this before but I always get the same error.
'C:\Users\[myname]\Desktop\minedev\' is not recognized as an internal or external command,
operable program or batch file.
I was looking through the minecraft_server code, and I made a simple change. All I did was add an echo to everything said. There was nothing wrong with the code, and I pressed ctrl+s in eclipse to save the .java to a .class. I then drug the kk.class into the minecraft_server.jar using archive manager, just like the post says. I'm experiencing a HUGE error though. When I try to join my test server the server saves its chunks and closes. Does anyone know what's wrong?
That's not a valid batch file command. It doesn't mean anything to the Windows command shell.
What you need to do is change to your source directory and then do the javac command.
Is "minecraft.src" the name of your source directory? If so, that's very strange to give a directory an extension (e.g., ".src"). Pretty much no one does that, and doing that will confuse people, but apparently it is a valid directory name in Windows.
So, if your source directory is "C:\Users\[myname]\Desktop\minedev\minecraft.src", first go to your source directory: cd c: (makes sure you are on the C drive) cd Users\[myname]\Desktop\minedev\minecraft.src (goes to source directory)
Then, assuming your command is correct (which I do not know whether it is, without looking into how to decompile/compile the game myself) you'd enter the command. javac -cp ..\bin\minecraft.jar;..\bin\lwjgl.jar;..\bin\lwjgr_util.jar;..\bin\jinput.jar ei.java
That would be your batch file -- all of the above in bold.
That's not a valid batch file command. It doesn't mean anything to the Windows command shell.
What you need to do is change to your source directory and then do the javac command.
Is "minecraft.src" the name of your source directory? If so, that's very strange to give a directory an extension (e.g., ".src"). Pretty much no one does that, and doing that will confuse people, but apparently it is a valid directory name in Windows.
So, if your source directory is "C:\Users\[myname]\Desktop\minedev\minecraft.src", first go to your source directory: cd c: (makes sure you are on the C drive) cd Users\[myname]\Desktop\minedev\minecraft.src (goes to source directory)
It works! Thank you so much!
Then, assuming your command is correct (which I do not know whether it is, without looking into how to decompile/compile the game myself) you'd enter the command. javac -cp ..\bin\minecraft.jar;..\bin\lwjgl.jar;..\bin\lwjgr_util.jar;..\bin\jinput.jar ei.java
That would be your batch file -- all of the above in bold.
scelton, waayy outdated, back b4 halloween update :biggrin.gif:.
BTW, can someone confirm my questions? i guess once you know what the classes do, the next update you can go search around the now obfuscated again classes and find the one u knew about before? Soo if there is someway to search would that make locating the right classes easier? And because MCP is still not out, all us new modders havve to guess our way to the classes using other ppl's mods?
Rollback Post to RevisionRollBack
Check out my Youtube Channel! http://www.youtube.com/user/EiDeHua Right now I'm doing a let's play of Sleeping Dogs! Working on updating my Luck's Edge mod, a LOT of new content! Also I've got another mod idea in mind! -Updated 8/16/12
If you've decompiled the code already, look for a reference to "pumpkinblur.png"; I found it in mz.java in v1.1.2_02, ymmv though.
Simple map
to
Simple map
better to just look at the google docs listing for everything
That one is outdated, believe it or not. Sand in that one doesnt match, neither do Iron Ingots.
Edit1: It says Sand is du.
patch: **** can't rename `net\minecraft\server\MinecraftServer.java' to `net\min
ecraft\server\MinecraftServer.java.orig' : File exists
1 file(s) copied.
Anyone kno wat this means??
i used to code flash for a little while so i get the coding basics, but how do i know what the "field" + random number and letter does (do i have to search everywhere that the file extends and search for that specific function to find out what it does? >.<) , also the word obfuscated makes me laugh :biggrin.gif:
i think it means uhhhh you cant rename minecraftserver.java to minecraftserver.java.orig because u already have a file called minecraftserver.java.orig???? lucky guess?
public class mod_craftobsidian extends BaseMod
{
public void AddRecipes(eu recipes)
{
ModLoader.AddAllRecipes(new ev(og.ap,1), new Object[] {
"#", Character.valueOf('#'), og.x
});
}
}
What should the "ev" be because netbeans says it's wrong?
Its wrong because you're never supposed to call AddAllRecipes.. that function is what calls YOUR mods AddRecipes function (along with all other mods addRecipe functions). You are just supposed to use the 'eu' object which is the Crafting manager and add directly to it. Thats why it was passed in as an argument to your function.
recipes.a(new fz(fire, 1), new Object[] { "X", "X", Character.valueOf('X'), stik });
that is a call from one of my mods. of course 'stik' and 'fire' are assigned to the appropriate item and block instances respectively.
I've seen a tutorial like this before but I always get the same error.
'C:\Users\[myname]\Desktop\minedev\' is not recognized as an internal or external command,
operable program or batch file.
Help?
Sounds like you have spaces somewhere in the path. If that's the case, put quotes (") around the entire path.
Either that, or you are entering the current working directory as part of the command. If that's the case, you are probably way in over your head.
For example, where they wrote:
You don't enter: C:\minecraft_dev\>
You go to your minecraft source directory (if its path is C:\minecraft_dev).
c:<enter>
cd minecraft_dev<enter>
And then you enter the command:
javac -cp bin/minecraft.jar;bin/lwjgl.jar;bin/lwjgl_util.jar;bin/jinput.jar your.java
Hey I really appreciate your detailed and fast response.
I am following kungfuhamsters guide here
http://www.minecraftwiki.net/wiki/User:KungFuHamster
My batch file still does not work, my entire code is
I also have a path using environmental variables to
and I am trying to edit ei.java so I do not think I am trying to edit something too complicated.
Thanks for your help.
That's not a valid batch file command. It doesn't mean anything to the Windows command shell.
What you need to do is change to your source directory and then do the javac command.
Is "minecraft.src" the name of your source directory? If so, that's very strange to give a directory an extension (e.g., ".src"). Pretty much no one does that, and doing that will confuse people, but apparently it is a valid directory name in Windows.
So, if your source directory is "C:\Users\[myname]\Desktop\minedev\minecraft.src", first go to your source directory:
cd c: (makes sure you are on the C drive)
cd Users\[myname]\Desktop\minedev\minecraft.src (goes to source directory)
Then, assuming your command is correct (which I do not know whether it is, without looking into how to decompile/compile the game myself) you'd enter the command.
javac -cp ..\bin\minecraft.jar;..\bin\lwjgl.jar;..\bin\lwjgr_util.jar;..\bin\jinput.jar ei.java
That would be your batch file -- all of the above in bold.
BTW, can someone confirm my questions? i guess once you know what the classes do, the next update you can go search around the now obfuscated again classes and find the one u knew about before? Soo if there is someway to search would that make locating the right classes easier? And because MCP is still not out, all us new modders havve to guess our way to the classes using other ppl's mods?