I am working on my mod and I'm almost done! I just can't figure out how to get the ore to drop xp when it is mined. Can someone please help me out!
Any help would be greatly appreiciated!
Rollback Post to RevisionRollBack
ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็ **Y U NO GIMME HIGH FIVE** ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็
Yeah, when I change par1World to world it thows me an error on
.
I've been trying to fix this problem for three days now, plus I am a noob when it comes to modding.
public void onBlockDestroyedByPlayer(World world, int i1, int i2, int i3, int i4){
World world2 = ModLoader.getMinecraftInstance().theWorld;
dropXpOnBlockBreak(world2, i1, i2, i3, #);
}
public void onBlockDestroyedByPlayer(World world, int i1, int i2, int i3, int i4){
World world2 = ModLoader.getMinecraftInstance().theWorld;
dropXpOnBlockBreak(world2, i1, i2, i3, #);
}
the first one should work though.
Now it throws me two errors, one on
"theWorld" and one on "dropXpOnBlockBreak"
Rollback Post to RevisionRollBack
ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็ **Y U NO GIMME HIGH FIVE** ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็
SO how would I fix number 1 then? And for number 2 it does extend Block.
Actually, (ive never modded in 1.3 so i could be wrong) the drop xp thing might be part of BlockOre. Try making it extend BlockOre and then erase the ModLoader.getMinecraftInstance().theWorld stuff and just use "world" from the on block destroyed method.
Rollback Post to RevisionRollBack
Check out my addon for IC2, IndustrialCraft 2 Combo Armors
Actually, (ive never modded in 1.3 so i could be wrong) the drop xp thing might be part of BlockOre. Try making it extend BlockOre and then erase the ModLoader.getMinecraftInstance().theWorld stuff and just use "world" from the on block destroyed method.
I've made it extend BlockOre and still nothing. I've been looking for the code that the other ores use to drop the XP but I can't seem to find it.
Rollback Post to RevisionRollBack
ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็ **Y U NO GIMME HIGH FIVE** ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็
public void onBlockDestroyedByPlayer(World world, int i1, int i2, int i3, int i4){
World world2 = ModLoader.getMinecraftInstance().theWorld;
dropXpOnBlockBreak(world2, i1, i2, i3, #);
}
Don't do that. It won't always work right in SMP, and in 1.3 you're pretty much always in SMP.
The first way (using the world instance that gets passed to the function) is correct. So to get rid of the error just go back to the way it was before -- pass world to whatever needs one.
Don't do that. It won't always work right in SMP, and in 1.3 you're pretty much always in SMP.
The first way (using the world instance that gets passed to the function) is correct. So to get rid of the error just go back to the way it was before -- pass world to whatever needs one.
Huh? You're talking to a noob dude, please explain it a little more.
Rollback Post to RevisionRollBack
ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็ **Y U NO GIMME HIGH FIVE** ส็็็็็็็็็็็็็็็็็็็(ಠ益ಠส็็็็็็็็็็็็็็็็็็็
Huh? You're talking to a noob dude, please explain it a little more.
Use world instead of the world2 I told you to define, because ModLoader.getMinecraftInstance() apparently doesnt always work in Multiplayer.
(thinks to himself: well its gonna be a massive pain in the **** to update my mod to 1.3 then.....)
Rollback Post to RevisionRollBack
Check out my addon for IC2, IndustrialCraft 2 Combo Armors
Any help would be greatly appreiciated!
Maybe its because you have
public void onBlockDestroyedByPlayer(World world int i1, int i2, int i3, int i4){}
but then
dropXpOnBlockBreak(par1world, i1, i2, i3, #)
You know, you cant become a modder purely by relying on people from the forums. You have to use your brain sometimes, too.
I fixed the effed up formatting. It was a very obvious mistake when the forums doesnt decide to turn everything retarted.
Yeah, when I change par1World to world it thows me an error on
.
I've been trying to fix this problem for three days now, plus I am a noob when it comes to modding.
If
public void onBlockDestroyedByPlayer(World world, int i1, int i2, int i3, int i4){
dropXpOnBlockBreak(world, i1, i2, i3, NUMBERHERE);
}
doesnt work, try
the first one should work though.
Now it throws me two errors, one on
"theWorld" and one on "dropXpOnBlockBreak"
Can you elaborate on "two errors"
(ie, copy/paste them here)
For number one... it should be if your using modloader, although it might only be part of forge, not 100% sure.
for number 2... your block does extend block, right?
SO how would I fix number 1 then? And for number 2 it does extend Block.
Actually, (ive never modded in 1.3 so i could be wrong) the drop xp thing might be part of BlockOre. Try making it extend BlockOre and then erase the ModLoader.getMinecraftInstance().theWorld stuff and just use "world" from the on block destroyed method.
Don't do that. It won't always work right in SMP, and in 1.3 you're pretty much always in SMP.
The first way (using the world instance that gets passed to the function) is correct. So to get rid of the error just go back to the way it was before -- pass world to whatever needs one.
Use world instead of the world2 I told you to define, because ModLoader.getMinecraftInstance() apparently doesnt always work in Multiplayer.
(thinks to himself: well its gonna be a massive pain in the **** to update my mod to 1.3 then.....)