Line 7: $'\nCreated on Fri Apr 8 16:54:36 2011\n\n@author: ProfMobius\n@version: v1.2\n': Command not found.
from: can't read /var/mail/optparse
from: can't read /var/mail/commands
Line 13: Bad Syntax: unexpected Word: `('
^Note: This is translated and not the direct output.^
Line 13: `def main(conffile=None, force_jad=False):
That are the Errors I get If I run decompile.py directly with the Content of decompile.py.
I'm pretty much just guessing with this, but did you add the bin folder to the files? I can't remember where, and I'm to lazy to look XD
It's in one of the tutorials.
This tutorial will be turning .java's into .class so it can be downloaded and installed for people to use.
First, go into your MCP folder. Double click recompile.bat and make sure there aren't any errors. Once it's finished, close that and double click on reobfuscate.bat and wait for that to finish. Once that's finished, close it and then open the "reobf" folder. Here you will find any modified .class, added .class, and your textures folder. Select them all, right click, and select "Send to -> Compressed (zipped) Folder". Rename that to whatever you want, upload that to your favorite uploading site (I like mediafire the best) and that's it! People can now download your mod and add it to their minecraft.
im using a mac 10.5.8 and whenever i try to run the recompile.sh file my computer just opens up the code inside. ive also tried running it through terminal but it just says there is no such file or directory. any ideas?
The problem with this is that I learn by having things happen to me. I never had this problem so I can't help :/
The only thing that I can think of is if you have to set the destination on Linux/Mac, but I don't know if that's the case, or how to do it. It could also be MCP, I looked at the wiki and found this "You need to install Python 2.7 on OSX and Linux to use this version. If you have python 3.x installed it will not work, this will be fixed soon." I'm guessing it could also do with that, but I have no clue what it is.
Could you help me with the MCP? I cant start it, because when I start decompile.sh (Yes im using Linux), it gives out this Error:
python: can't open file 'runtime/decompile.py': [Errno 2] No such file or directory
This happened to me the first time I tried running decompile.sh on my Mac.
The thing is that I unarchived minecraft.jar to a new folder to install ModLoader. MCP don't like this...
I solved this by opening minecraft.jar with BetterZip (any zip software should work) and installing the .class files from there.
This may or may not be the problem in your case since you're on Linux, but it might work :smile.gif:
I started with a fresh Minecraft.jar, never used before.
That's not what I'm talking about..
Inside the bin folder you put in /mpc/jars there is a minecraft.jar. You have to install ModLoader to this .jar to make any of your mods work. When installing the ModLoader files, you have to open the .jar with a Linux equivalent of Windows' WinZip/WinRar/7Zip etc.
7-Zip is also avaible for Linux :biggrin.gif:
Is ModLoader a Must-Have to run MCP?
No, but it's highly recommended, as it provides your mod with compatibility with other mods, as well as making it possible to create more advanced mods.
but I made a block and thought: How do you make a multitextured block? Like a bookshelf? :smile.gif:
I found tutorials on the internet but they are all crap with 6 sides and stuf :sad.gif:
I haven't worked with multiple textured items YET. Once I feel like updating my healing mod I'll be adding one, and then I'll make a tutorial on it :smile.gif:
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/mod_Professional.java:4: net.minecraft.src.mod_Professional is not abstract and does not override abstract method load() in net.minecraft.src.BaseMod
public class mod_Professional extends BaseMod {
^
1 error
==================
> Done in 13.45 seconds
> Recompiling server...
!! Can not find server sources !!
I know a tiny little thing about java so i thought: Just make my class abstract, just like BaseMod :tongue.gif:
public abstract class mod_Professional extends BaseMod {
But i guess that minecraft doesn't like that. I do not get any error when recompiling and reobfuscating. But when i add the classes to my minecraft.jar (of course with the .png files)
it crashes. With this error:
Dec 25, 2011 11:03:52 AM ModLoader addMod
FINE: Failed to load mod from "mod_Professional.class"
Dec 25, 2011 11:03:52 AM ModLoader addMod
FINER: THROW
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at ModLoader.addMod(ModLoader.java:275)
at ModLoader.readFromClassPath(ModLoader.java:1227)
at ModLoader.init(ModLoader.java:825)
at ModLoader.AddAllRenderers(ModLoader.java:186)
at wb.<init>(wb.java:76)
at wb.<clinit>(wb.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at nm.a(nm.java:27)
at net.minecraft.client.Minecraft.run(SourceFile:644)
at java.lang.Thread.run(Thread.java:680)
Dec 25, 2011 11:04:02 AM ModLoader readFromModFolder
any help?
Hey. Abstract classes should be used when you want to use interfacing with child classes or the object which you are representing is "abstract" (there should never be an instance of the class, like Food might be represented by an abstract class because you can never have a "Food", only a child (sub-type) of a Food, like a Grape)
"BaseMod" is abstract because the creator of ModLoader wanted to have abstract methods (children of a parent abstract class that has abstract methods are forced to override the abstract methods and provide some sort of method body, whether it have content or not) and also wanted to ensure that no instance of "BaseMod" could be created.
BTW, thank you for this tutorial. I have been learning Java for a little over 4 years and I thought modifying the Minecraft client would be difficult, apparently not because some kind fellow made an API and deobfuscator :smile.gif:
I want to get back into modding and making some more tutorials. Please leave any suggestions for me, and if I'm interested in the idea I'll make a tutorial for you :smile.gif:
Pretty simple, change the capital letters to an integer.
This will go into your mod_whatever
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for (int i=0; i < HOW_RARE; i++)
{
int randPosX = chunkX + rand.nextInt(VEIN_SIZE);
int randPosY = rand.nextInt(VEIN_HEIGHT);
int randPosZ = chunkZ + rand.nextInt(VEIN_SIZE);
(new WorldGenMinable(yourblock.blockID, VEIN_MAX_SIZE)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
HOW_RARE = For comparison, coal is 15 I think
VEIN_SIZE = Max vein size for the X/Z positions
VEIN_HEIGHT = From bedrock, diamond is at 13 I think
VEIN_MAX_SIZE = The max amount of the block in one vein
yourblock = If your block is mod_whatever.BlueOre.blockID, just have BlueOre.blockID, if it's in the same mod_
If you want to add another generation, it should look like this:
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for (int i=0; i < HOW_RARE; i++)
{
int randPosX = chunkX + rand.nextInt(VEIN_SIZE);
int randPosY = rand.nextInt(VEIN_HEIGHT);
int randPosZ = chunkZ + rand.nextInt(VEIN_SIZE);
(new WorldGenMinable(yourblock.blockID, VEIN_MAX_SIZE)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int i=0; i < HOW_RARE; i++)
{
int randPosX = chunkX + rand.nextInt(VEIN_SIZE);
int randPosY = rand.nextInt(VEIN_HEIGHT);
int randPosZ = chunkZ + rand.nextInt(VEIN_SIZE);
(new WorldGenMinable(yourblock.blockID, VEIN_MAX_SIZE)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
@GunThaSun
I might do the mob spawn one eventually, and as for the smelting one. Look in the table of contents for how to use the mod_ Template. There will be how to add a smelting recipe there.
There's no point, it's all trial and error. Look at the hitboxes for cows and pigs and you basically have to make it bigger or smaller. It's a lot easier when you do it then when you think about it.
I'm sorry, I've never seen anything about 'abstract'. I can't help you here.
-Muserae
I'm pretty much just guessing with this, but did you add the bin folder to the files? I can't remember where, and I'm to lazy to look XD
It's in one of the tutorials.
-Muserae
im using a mac 10.5.8 and whenever i try to run the recompile.sh file my computer just opens up the code inside. ive also tried running it through terminal but it just says there is no such file or directory. any ideas?
The problem with this is that I learn by having things happen to me. I never had this problem so I can't help :/
The only thing that I can think of is if you have to set the destination on Linux/Mac, but I don't know if that's the case, or how to do it. It could also be MCP, I looked at the wiki and found this "You need to install Python 2.7 on OSX and Linux to use this version. If you have python 3.x installed it will not work, this will be fixed soon." I'm guessing it could also do with that, but I have no clue what it is.
-Muserae
Yes, I was going to make a tutorial for it but never got around to it.
Click this and look for getRenderType
-Muserae
To run the .sh files, do this:
Open Terminal
Enter "cd " (remove quotes, and remember to put a space after 'cd')
Find your MCP folder and drag it into Terminal
Hit Enter/Return
You can now execute any .sh file by writing
./whatever.sh (replace 'whatever' with the file you want executed)
----------------------------------------------------------------------------------------
This happened to me the first time I tried running decompile.sh on my Mac.
The thing is that I unarchived minecraft.jar to a new folder to install ModLoader. MCP don't like this...
I solved this by opening minecraft.jar with BetterZip (any zip software should work) and installing the .class files from there.
This may or may not be the problem in your case since you're on Linux, but it might work :smile.gif:
Extract minecraft.jar to separate folder = bad
Opening minecraft.jar and dragging ModLoader class files into the jar file from there = good
That's not what I'm talking about..
Inside the bin folder you put in /mpc/jars there is a minecraft.jar. You have to install ModLoader to this .jar to make any of your mods work. When installing the ModLoader files, you have to open the .jar with a Linux equivalent of Windows' WinZip/WinRar/7Zip etc.
No, but it's highly recommended, as it provides your mod with compatibility with other mods, as well as making it possible to create more advanced mods.
I haven't worked with multiple textured items YET. Once I feel like updating my healing mod I'll be adding one, and then I'll make a tutorial on it :smile.gif:
-Muserae
"BaseMod" is abstract because the creator of ModLoader wanted to have abstract methods (children of a parent abstract class that has abstract methods are forced to override the abstract methods and provide some sort of method body, whether it have content or not) and also wanted to ensure that no instance of "BaseMod" could be created.
BTW, thank you for this tutorial. I have been learning Java for a little over 4 years and I thought modifying the Minecraft client would be difficult, apparently not because some kind fellow made an API and deobfuscator :smile.gif:
Just a developer :-)
Could you use a modeling tool like FMCModeler to make the blocks with multiple boxes
There is a way to make it with Techne, I haven't made a tutorial on it yet but I know other people have.
Like this guy
-Muserae
Upcoming:
Multi-textured block
-Muserae
Pretty simple, change the capital letters to an integer.
This will go into your mod_whatever
HOW_RARE = For comparison, coal is 15 I think
VEIN_SIZE = Max vein size for the X/Z positions
VEIN_HEIGHT = From bedrock, diamond is at 13 I think
VEIN_MAX_SIZE = The max amount of the block in one vein
yourblock = If your block is mod_whatever.BlueOre.blockID, just have BlueOre.blockID, if it's in the same mod_
If you want to add another generation, it should look like this:
Pretty simple, again. This goes in ItemWhatever
I might do the mob spawn one eventually, and as for the smelting one. Look in the table of contents for how to use the mod_ Template. There will be how to add a smelting recipe there.
-Muserae
There's no point, it's all trial and error. Look at the hitboxes for cows and pigs and you basically have to make it bigger or smaller. It's a lot easier when you do it then when you think about it.
-Muserae