Good to know. I'll make sure to get that to you ASAP (I don't have access to the mod files right now). Also, I was wondering if there is a way to add the following things WITHOUT modifying a base class:
A: Ore blocks to the pickaxe's "efficient mining list".
B: Different types of tools, like editing EnumToolMaterial I think it's called...
The reason I ask is I would love to put a stamp on my mod saying "Modifies NO Base Classes!", and also to improve compatability.
EDIT: Feel free to chuck code @ me, I'll figure out how to incorporate it :wink.gif:
Good to know. I'll make sure to get that to you ASAP (I don't have access to the mod files right now). Also, I was wondering if there is a way to add the following things WITHOUT modifying a base class:
A: Ore blocks to the pickaxe's "efficient mining list".
B: Different types of tools, like editing EnumToolMaterial I think it's called...
The reason I ask is I would love to put a stamp on my mod saying "Modifies NO Base Classes!", and also to improve compatability.
EDIT: Feel free to chuck code @ me, I'll figure out how to incorporate it :wink.gif:
Scokeev9's ScotTools seems to be exactly what you're looking for. I use it in my own mod, and it's very easy to learn and use. There's a tutorial for it right on the thread, but I'll be trying to write one while I have a long weekend.
o yea i added sum stuff to my mod and i got "invalid method declaration error; return type required" on this code
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// ItemFood
public class ItemCSprinkles extends ItemFood
{
public ItemSprinkles(int i, int j, boolean flag, int k)
{
super(i, j, flag);
maxStackSize = k;
}
}
i mean, i jes copied it straight from the cookie file :tongue.gif: and i made sher all the caps r rite...... help?
k i fixed it but its still the same as b4 and nothing is out of place can i send u the files so u can chek it out 4 me plz? thx
and also wen i try startclient, it sed i could not find r load main class start........:sad.gif: help too?
OK, I'll take a look at that. Does the user have to download anything when installing my mod this way?
BTW here's the error message I get, this is from startclient.bat
It says NullPointerException, which could mean almost anything. If you used ModLoader.AddArmor() and edited ItemPickaxe in anyway this might happen. You might have also just declared something wrong
o yea i added sum stuff to my mod and i got "invalid method declaration error; return type required" on this code
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// ItemFood
public class ItemCSprinkles extends ItemFood
{
public ItemSprinkles(int i, int j, boolean flag, int k)
{
super(i, j, flag);
maxStackSize = k;
}
}
i mean, i jes copied it straight from the cookie file :tongue.gif: and i made sher all the caps r rite...... help?
k i fixed it but its still the same as b4 and nothing is out of place can i send u the files so u can chek it out 4 me plz? thx
and also wen i try startclient, it sed i could not find r load main class start........:sad.gif: help too?
I can't understand when you write like that. It's very messy and hard to read. If you post again in plain English I'll be able to help you more.
It says NullPointerException, which could mean almost anything. If you used ModLoader.AddArmor() and edited ItemPickaxe in anyway this might happen. You might have also just declared something wrong
-snip-
Hmm, I haven't done anything with armour yet...
Could you check the code if I send in a PM?
It says NullPointerException, which could mean almost anything. If you used ModLoader.AddArmor() and edited ItemPickaxe in anyway this might happen. You might have also just declared something wrong
I can't understand when you write like that. It's very messy and hard to read. If you post again in plain English I'll be able to help you more.
srry i said that i fixed the declaration problem, but then the problems previously posted occurred again, and that startclient doesnt work bcause it was missing the start class or something....... and can i give u the files that i made so u can figure it out and another thing, im not trying to mod with modloader
srry i said that i fixed the declaration problem, but then the problems previously posted occurred again, and that startclient doesnt work bcause it was missing the start class or something....... and can i give u the files that i made so u can figure it out and another thing, im not trying to mod with modloader
For the ore tutorial in modloader I saw you said that random had to be ran or something and some other changes that are not in your original thing... here is my code, can you tell me what needs to be changed.
package net.minecraft.src;
public class mod_TutorialOre extends BaseMod {
public static final Block oreTutorial = new BlockOre(101, 0).setHardness(5F).setResistance(10F).setBlockName("oreTutorial");
public mod_TutorialOre() {
ModLoader.RegisterBlock(oreTutorial);
oreTutorial.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Tutorial Ore/oretutorial.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.oreTutorial.blockID, 10).generate(world, rand, xCoord, yCoord, zCoord);
}
}
public String Version() {
return "Tutorial Ore Version 1 for MineCraft 1.7.3";
}
}
Please I dont know what to do I copied your end result 3 times and still get errors.
For the ore tutorial in modloader I saw you said that random had to be ran or something and some other changes that are not in your original thing... here is my code, can you tell me what needs to be changed.
package net.minecraft.src;
public class mod_TutorialOre extends BaseMod {
public static final Block oreTutorial = new BlockOre(101, 0).setHardness(5F).setResistance(10F).setBlockName("oreTutorial");
public mod_TutorialOre() {
ModLoader.RegisterBlock(oreTutorial);
oreTutorial.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Tutorial Ore/oretutorial.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.oreTutorial.blockID, 10).generate(world, rand, xCoord, yCoord, zCoord);
}
}
public String Version() {
return "Tutorial Ore Version 1 for MineCraft 1.7.3";
}
}
Please I dont know what to do I copied your end result 3 times and still get errors.
package net.minecraft.src;
import java.util.Random;
public class mod_TutorialOre extends BaseMod {
public static final Block oreTutorial = new BlockOre(101, 0).setHardness(5F).setResistance(10F).setBlockName("oreTutorial");
public mod_TutorialOre() {
ModLoader.RegisterBlock(oreTutorial);
oreTutorial.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Tutorial Ore/oretutorial.png");
}
public void GenerateSurface(World world, Random rand, 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.oreTutorial.blockID, 10).generate(world, rand, xCoord, yCoord, zCoord);
}
}
public String Version() {
return "Tutorial Ore Version 1 for MineCraft 1.7.3";
}
}
I made the changes for you. They aren't very major, but I think I should explain them.
First, I imported the Random class. The line before the top line shows this:
import java.util.Random;
Second, I changed the parameter in GenerateSurface() from Random random to Random rand, as that's what I used for rand.nextInt(). Sorry if that made no sense, but I honestly don't know the technical word. Oh wait, it's an instance variable
I do need to change the tutorial, thanks for reminding me. :smile.gif:
package net.minecraft.src;
import java.util.Random;
public class mod_TutorialOre extends BaseMod {
public static final Block oreTutorial = new BlockOre(101, 0).setHardness(5F).setResistance(10F).setBlockName("oreTutorial");
public mod_TutorialOre() {
ModLoader.RegisterBlock(oreTutorial);
oreTutorial.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Tutorial Ore/oretutorial.png");
}
public void GenerateSurface(World world, Random rand, 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.oreTutorial.blockID, 10).generate(world, rand, xCoord, yCoord, zCoord);
}
}
public String Version() {
return "Tutorial Ore Version 1 for MineCraft 1.7.3";
}
}
I made the changes for you. They aren't very major, but I think I should explain them.
First, I imported the Random class. The line before the top line shows this:
import java.util.Random;
Second, I changed the parameter in GenerateSurface() from Random random to Random rand, as that's what I used for rand.nextInt(). Sorry if that made no sense, but I honestly don't know the technical word. Oh wait, it's an instance variable
I do need to change the tutorial, thanks for reminding me. :smile.gif:
no problem and I literally love your tutorials I am using yours and a couple others to learn but yours first because it is the easiest to understand. I have two questions though, do you import the random class whenever using random stuff, and two is whether we could use Random random if we used random.nextInt() or something along those lines.
Also you forgot that you cant have Block.oreTutorial in the generator but instead you should have mod_TutorialOre.oreTutorial.
no problem and I literally love your tutorials I am using yours and a couple others to learn but yours first because it is the easiest to understand. I have two questions though, do you import the random class whenever using random stuff, and two is whether we could use Random random if we used random.nextInt() or something along those lines.
Also you forgot that you cant have Block.oreTutorial in the generator but instead you should have mod_TutorialOre.oreTutorial.
1. Yes, anytime you need something random you typically want to import Random.
2. Yes, as long as you are calling the right instance variable.
And thanks for pointing that out. I really screwed that tutorial up :mellow.gif:
1. Yes, anytime you need something random you typically want to import Random.
2. Yes, as long as you are calling the right instance variable.
And thanks for pointing that out. I really screwed that tutorial up :mellow.gif:
Hey its no problem thats why you have us to point that out and its also why I am looking at other tutorials after yours to learn different things. Once I learn if I find something cool Ill submit it to you as a tutorial if you dont mind since I want to help people out.
Sorry for the double post but this is unrelated to the one above, are most of the functions of normal modding the same in Modloader or do I need to search through the javadoc. What I mean is could you add textures to each side of a block using:
Sorry for the double post but this is unrelated to the one above, are most of the functions of normal modding the same in Modloader or do I need to search through the javadoc. What I mean is could you add textures to each side of a block using:
When following you ModLoader block tutorial, I always get the same error, I even tried copy and pasting your code, but I still got errors.
This is my mod_OreTutorial. It's the exact same as yours. Am I setting it up wrong? I will make a video showing how I set it up with ModLoader.
package net.minecraft.src;
public class mod_TutorialOre extends BaseMod {
public static final Block oreTutorial = new BlockOre(101, 0).setHardness(5F).setResistance(10F).setBlockName("oreTutorial");
public mod_TutorialOre() {
ModLoader.RegisterBlock(oreTutorial);
oreTutorial.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Tutorial Ore/oretutorial.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.oreTutorial.blockID, 10).generate(world, rand, xCoord, yCoord, zCoord);
}
}
public String Version() {
return "1.0 for MC Beta 1.7.3";
}
}
When following you ModLoader block tutorial, I always get the same error, I even tried copy and pasting your code, but I still got errors.
This is my mod_OreTutorial. It's the exact same as yours. Am I setting it up wrong? I will make a video showing how I set it up with ModLoader.
package net.minecraft.src;
public class mod_TutorialOre extends BaseMod {
public static final Block oreTutorial = new BlockOre(101, 0).setHardness(5F).setResistance(10F).setBlockName("oreTutorial");
public mod_TutorialOre() {
ModLoader.RegisterBlock(oreTutorial);
oreTutorial.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Tutorial Ore/oretutorial.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.oreTutorial.blockID, 10).generate(world, rand, xCoord, yCoord, zCoord);
}
}
public String Version() {
return "1.0 for MC Beta 1.7.3";
}
}
It's my fault and I deserve it. I wrote the tutorial wrong.
If you look a few posts back you'll see somebody with the same problem. Look for something that says:
Okay thank you :biggrin.gif: I really think you should fix the tutorial if that's the case. Honestly, this is the best tutorial set I've seen yet. After I added in import.java.util.Random; I got one error, which was that I put a "." between the import and java. But after fixing that, I got 5 new errors when recompiling:
EDIT: I fixed all the "rand" errors by adding "om" and the end of "rand" but now it has just one last error.
EDIT2: my final error was a result of my putting mod_TutorialOre in the code and then naming the .java file mod_oreTutorial xD Thanks, the tutorial really helped :biggrin.gif:
EDIT3: When I load it up I get a black screen. META-INF deleted, only class in my mod is mod_TutorialOre, mods installed: TooManyItems, ModLoader. I get it right after the Mojang logo. Absolutely clueless.
A: Ore blocks to the pickaxe's "efficient mining list".
B: Different types of tools, like editing EnumToolMaterial I think it's called...
The reason I ask is I would love to put a stamp on my mod saying "Modifies NO Base Classes!", and also to improve compatability.
EDIT: Feel free to chuck code @ me, I'll figure out how to incorporate it :wink.gif:
Scokeev9's ScotTools seems to be exactly what you're looking for. I use it in my own mod, and it's very easy to learn and use. There's a tutorial for it right on the thread, but I'll be trying to write one while I have a long weekend.
BTW here's the error message I get, this is from startclient.bat
o yea i added sum stuff to my mod and i got "invalid method declaration error; return type required" on this code
i mean, i jes copied it straight from the cookie file :tongue.gif: and i made sher all the caps r rite...... help?
k i fixed it but its still the same as b4 and nothing is out of place can i send u the files so u can chek it out 4 me plz? thx
and also wen i try startclient, it sed i could not find r load main class start........:sad.gif: help too?
It says NullPointerException, which could mean almost anything. If you used ModLoader.AddArmor() and edited ItemPickaxe in anyway this might happen. You might have also just declared something wrong
I can't understand when you write like that. It's very messy and hard to read. If you post again in plain English I'll be able to help you more.
Hmm, I haven't done anything with armour yet...
Could you check the code if I send in a PM?
srry i said that i fixed the declaration problem, but then the problems previously posted occurred again, and that startclient doesnt work bcause it was missing the start class or something....... and can i give u the files that i made so u can figure it out and another thing, im not trying to mod with modloader
Yes.
Yes, please send the files in a PM.
Please I dont know what to do I copied your end result 3 times and still get errors.
I made the changes for you. They aren't very major, but I think I should explain them.
First, I imported the Random class. The line before the top line shows this:
Second, I changed the parameter in GenerateSurface() from Random random to Random rand, as that's what I used for rand.nextInt().
Sorry if that made no sense, but I honestly don't know the technical word.Oh wait, it's an instance variableI do need to change the tutorial, thanks for reminding me. :smile.gif:
no problem and I literally love your tutorials I am using yours and a couple others to learn but yours first because it is the easiest to understand. I have two questions though, do you import the random class whenever using random stuff, and two is whether we could use Random random if we used random.nextInt() or something along those lines.
Also you forgot that you cant have Block.oreTutorial in the generator but instead you should have mod_TutorialOre.oreTutorial.
1. Yes, anytime you need something random you typically want to import Random.
2. Yes, as long as you are calling the right instance variable.
And thanks for pointing that out. I really screwed that tutorial up :mellow.gif:
Hey its no problem thats why you have us to point that out and its also why I am looking at other tutorials after yours to learn different things. Once I learn if I find something cool Ill submit it to you as a tutorial if you dont mind since I want to help people out.
or do we have to use something from modloader. Does modloader even have a function we could use to make this thing easier?
As long as that's in the block class it should work. You also have to declare your textures in your mod_ file as ints:
Then in your block class instead of blockIndexInTexture put your int declaration from the mod_ class:
This is my mod_OreTutorial. It's the exact same as yours. Am I setting it up wrong? I will make a video showing how I set it up with ModLoader.
It's my fault and I deserve it. I wrote the tutorial wrong.
If you look a few posts back you'll see somebody with the same problem. Look for something that says:
And read that post.
EDIT: I fixed all the "rand" errors by adding "om" and the end of "rand" but now it has just one last error.
EDIT2: my final error was a result of my putting mod_TutorialOre in the code and then naming the .java file mod_oreTutorial xD Thanks, the tutorial really helped :biggrin.gif:
EDIT3: When I load it up I get a black screen. META-INF deleted, only class in my mod is mod_TutorialOre, mods installed: TooManyItems, ModLoader. I get it right after the Mojang logo. Absolutely clueless.