Nice tut Chewy. I'm an old DOS guy trying to figure out Java. I'm looking for codes maybe you can help. I want to add multiple textures to one block using my .png files and not the terrain.png as you highlighted in your tut, any way to point the textures. Also I want an item to be placeable in the world like a block. My thought is saving block ids by using items as decor items for a mod I am working on.
First problem: While updating MCP I got this error:
!! Missing jar file jars/minecraft_server.jar. Aborting !!
Then:
Can not find server sources !!
When I open up eclipse and set it to the eclipse workspace I automatically get 2 errors before I even do anything! I see a red ! next to server and a yellow warning sign with a ! next to client. When I run the minecraft crashes.
Anything I could have done wrong? I got this version of Eclipse: HERE
I followed and understood the setup for MCP... It just won't work! Any ideas?
java.lang.NullPointerException
at net.minecraft.src.GuiParticle.func_25087_a(GuiParticle.java:41)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:487)
at net.minecraft.client.Minecraft.run(Minecraft.java:514)
at java.lang.Thread.run(Unknown Source)
is the error I got. I'm new and I don't know what to do. I think i need to go into client->src->GuiParticle and see what's wrong?
Thanks Chewy! I wish I could "favourite" this! I will definitely be giving this to my friends! This is such a good written tutorial. Well done! :biggrin.gif:
I will be referring back to this! :smile.gif:
-Mc_Drizzle
Nice tut Chewy. I'm an old DOS guy trying to figure out Java. I'm looking for codes maybe you can help. I want to add multiple textures to one block using my .png files and not the terrain.png as you highlighted in your tut, any way to point the textures. Also I want an item to be placeable in the world like a block. My thought is saving block ids by using items as decor items for a mod I am working on.
look at TNT or any block that has multiple textures, you'll see a method called "getTextureFromSide", you will just need to make a new class for your object, take some experimenting and find out which face is which which, then just go through a bunch of ifs. As for using your own textures, you might want to look into modloader because it allows you to use your own textures, however each texture will have to be a different file, you can't just have a .png with 5 images on it, you have to have a separate image for each 5.
As for the items, why not just make it a block instead of an item? or look at how flint and steel sets fire to where you are pointing, using the onItemUse()
I found my idiotic problem... I forgot to set the path for JDK. I'm on the part where I have to set the value for path. How do I know what to put? Thanks guys! Epic tutorial by the way.
I was able to open eclipse just fine. Then I put the path as: C:\Program Files (x86)\Java\jdk1.6.0_25\bin
Now, when I open eclipse it says that it can't access something in the bin file. I must suck at java... can anybody help me?
I found my idiotic problem... I forgot to set the path for JDK. I'm on the part where I have to set the value for path. How do I know what to put? Thanks guys! Epic tutorial by the way.
I was able to open eclipse just fine. Then I put the path as: C:\Program Files (x86)\Java\jdk1.6.0_25\bin
Now, when I open eclipse it says that it can't access something in the bin file. I must suck at java... can anybody help me?
If you forgot to set the PATH you shouldn't even have been able to decompile. You need to set the PATH for both the JDK and the JRE.
How do I do it for both? I was able to decompile and I fixed what I messed up while trying to "fix" it. How do I add both? Right now it looks like this:
I know the location of my JRE files. Do I just add a semicolon to the end of this one and put the new one? Sorry... I'm new to this.
Another question... for my new ore... I don't see any ItemIronIngot or anything? Would I need a Item(myingot).jar? Because I want my ore block to be smeltable and craftable. Does that mean i need to make it an item?
How do I do it for both? I was able to decompile and I fixed what I messed up while trying to "fix" it. How do I add both? Right now it looks like this:
I know the location of my JRE files. Do I just add a semicolon to the end of this one and put the new one? Sorry... I'm new to this.
Another question... for my new ore... I don't see any ItemIronIngot or anything? Would I need a Item(myingot).jar? Because I want my ore block to be smeltable and craftable. Does that mean i need to make it an item?
I don't think you need it for the JRE, but it might help. Just find the path to the file (sometimes in the same folder as the JDK) and add it to the PATH.
As for your ore, you don't need an ingot class unless your going to make it do something special (like freeze water or spawn a cow). For a plain ingot you just need to use the class "Item". Look at the code for the iron ingot in Item.java. It uses the Item.java; that's exactly the way you should use it (while changing the ID of course).
package net.minecraft.src;
import java.util.Random;
public class mod_Bauxite extends BaseMod {
public static final Block oreBauxite = new BlockOre(101, 0).setHardness(5F).setResistance(10F).setBlockName("oreBauxite");
public mod_Bauxite() {
ModLoader.RegisterBlock(oreBauxite);
oreBauxite.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Togfan/Bauxite.png");
}
public void GenerateSurface(World world, Random random, int randXCoord, int randZCoord) {
for(int oreFrequency = 0; oreFrequency < 12; oreFrequency++) {
int xCoord = randXCoord + rand.nextInt(16);
int yCoord = rand.nextInt(128);
int zCoord = randZCoord + rand.nextInt(16);
new WorldGenMinable(Block.oreBauxite.blockID, 10).generate(world, rand, xCoord, yCoord, zCoord);
}
}
public String Version() {
return "1.0 for MC Beta 1.7.3";
}
}
Here's what I get
== MCP v4.3 ==
> Recompiling client...
"C:\Programfiler\Java\jdk1.6.0_26\bin\javac.exe" -g -verbose -classpath "lib/;li
b/*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl
_util.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraf
t\client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecr
aft\src\*.java conf/patches/*.java failed.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_class.java:4: class mod_Bauxite is public, s
hould be declared in a file named mod_Bauxite.java
public class mod_Bauxite extends BaseMod {
^
src\minecraft\net\minecraft\src\mod_class.java:15: cannot find symbol
symbol : variable rand
location: class net.minecraft.src.mod_Bauxite
int xCoord = randXCoord + rand.nextInt(16);
^
src\minecraft\net\minecraft\src\mod_class.java:15: operator + cannot be applied
to int,rand.nextInt
int xCoord = randXCoord + rand.nextInt(16);
^
src\minecraft\net\minecraft\src\mod_class.java:15: incompatible types
found : <nulltype>
required: int
int xCoord = randXCoord + rand.nextInt(16);
^
src\minecraft\net\minecraft\src\mod_class.java:16: cannot find symbol
symbol : variable rand
location: class net.minecraft.src.mod_Bauxite
int yCoord = rand.nextInt(128);
^
src\minecraft\net\minecraft\src\mod_class.java:17: cannot find symbol
symbol : variable rand
location: class net.minecraft.src.mod_Bauxite
int zCoord = randZCoord + rand.nextInt(16);
^
src\minecraft\net\minecraft\src\mod_class.java:17: operator + cannot be applied
to int,rand.nextInt
int zCoord = randZCoord + rand.nextInt(16);
^
src\minecraft\net\minecraft\src\mod_class.java:17: incompatible types
found : <nulltype>
required: int
int zCoord = randZCoord + rand.nextInt(16);
^
src\minecraft\net\minecraft\src\mod_class.java:18: cannot find symbol
symbol : variable rand
location: class net.minecraft.src.mod_Bauxite
new WorldGenMinable(Block.oreBauxite.blockID, 10).generate(world, rand, xCoord,
yCoord, zCoord);
^
src\minecraft\net\minecraft\src\mod_class.java:18: cannot find symbol
symbol : variable oreBauxite
location: class net.minecraft.src.Block
new WorldGenMinable(Block.oreBauxite.blockID, 10).generate(world, rand, xCoord,
yCoord, zCoord);
^
10 errors
==================
> Done in 1.84 seconds
> Recompiling server...
> Done in 2.34 seconds
entityplayer.heal(amount)
the rest was making it use one of the items, like if you had 4 healing items you'd then have 3.
!! Missing jar file jars/minecraft_server.jar. Aborting !!
Then:
Can not find server sources !!
When I open up eclipse and set it to the eclipse workspace I automatically get 2 errors before I even do anything! I see a red ! next to server and a yellow warning sign with a ! next to client. When I run the minecraft crashes.
Anything I could have done wrong? I got this version of Eclipse: HERE
And this version of MCP: HERE
I followed and understood the setup for MCP... It just won't work! Any ideas?
is the error I got. I'm new and I don't know what to do. I think i need to go into client->src->GuiParticle and see what's wrong?
Thats the code i found for what was in the error. Is anything wrong with it? I'm new to java...
Since I had some free time today I thought I'd write the Toolset tutorial. It is now up :smile.gif:
The ModLoader tutorial will be coming soon, but it will take me a while to write. Expect it tomorrow or the next day.
I will be referring back to this! :smile.gif:
-Mc_Drizzle
look at TNT or any block that has multiple textures, you'll see a method called "getTextureFromSide", you will just need to make a new class for your object, take some experimenting and find out which face is which which, then just go through a bunch of ifs. As for using your own textures, you might want to look into modloader because it allows you to use your own textures, however each texture will have to be a different file, you can't just have a .png with 5 images on it, you have to have a separate image for each 5.
As for the items, why not just make it a block instead of an item? or look at how flint and steel sets fire to where you are pointing, using the onItemUse()
I was able to open eclipse just fine. Then I put the path as: C:\Program Files (x86)\Java\jdk1.6.0_25\bin
Now, when I open eclipse it says that it can't access something in the bin file. I must suck at java... can anybody help me?
If you forgot to set the PATH you shouldn't even have been able to decompile. You need to set the PATH for both the JDK and the JRE.
Variable: PATH
Value: GL;C:\Program Files\Java\jdk1.6.0_25\bin
I know the location of my JRE files. Do I just add a semicolon to the end of this one and put the new one? Sorry... I'm new to this.
Another question... for my new ore... I don't see any ItemIronIngot or anything? Would I need a Item(myingot).jar? Because I want my ore block to be smeltable and craftable. Does that mean i need to make it an item?
I don't think you need it for the JRE, but it might help. Just find the path to the file (sometimes in the same folder as the JDK) and add it to the PATH.
As for your ore, you don't need an ingot class unless your going to make it do something special (like freeze water or spawn a cow). For a plain ingot you just need to use the class "Item". Look at the code for the iron ingot in Item.java. It uses the Item.java; that's exactly the way you should use it (while changing the ID of course).
HELP!!! xD
Edit: IT'S FIXED!!! =D
And this is what I get when I recompile
What am I doing wrong?
You have two package declarations :blink.gif:
Here's what I have now
Here's what I get