I've learned so much. btw all the codes working now. i think it was because my mod was clashing with a dr who mod. doors opening and everything. I developed a new ore, a new gem, and a few new tools based off of it. still having slight trouble getting my item to play my custom item.
nevermind, i added a folder to the actual .minecraft folder cause i didnt know how to import sounds. basically i made a new folder in mobs called basic, and put the sound called sonic inside. Is there a more user friendly way in case i wanted a friend to install it
Thanks =]. Any tips on what kind of code to look for if I want to copy and paste to my item, cause there's a lot of code, and it is quite hard to figure out which one does what.
When you get the reobfuscated files and zip them be careful of the folder structure. I don't know how you have setup your project in Eclipse.
But in your reobf folder you get a minecraft folder and in it you have your mod.
Don't zip the minecraft folder, open it and zip the folder within.
If you have put your files in the net.minecraft..... structure in Eclipse you have a net folder if you have setup a folder four you file you have a "youmod" or wathever folder you name it.
You can have both too.
Zip them and put the zip in the mod folder of minecraft.
When you run it you will see your mod in the mod tab in the game menu.
Oh sorry i'm a bit late didn't see you solved your item problem.
and when i say copy and paste my item i mean, like values from certain items like flint and steel activates TNT, i could take the code that does that and paste it into my item so it can activate flint and steel
---- Minecraft Crash Report ----
// Why is it breaking
Time: 12/6/13 8:24 PM
Description: There was a severe problem during mod loading that has caused the game to fail
cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodError: cpw.mods.fml.common.registry.GameRegistry.registerWorldGenerator(Ltutorial/basic/EventManager;)V
at cpw.mods.fml.common.LoadController.transition(LoadController.java:149)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:231)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:507)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:806)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
Caused by: java.lang.NoSuchMethodError: cpw.mods.fml.common.registry.GameRegistry.registerWorldGenerator(Ltutorial/basic/EventManager;)V
at tutorial.basic.Basic.load(Basic.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:696)
... 10 more
its working fine off of eclipse, but not when i mod minecraft.
i noticed that, but ive tried everything within those ranges to fix it. i've tried commenting out the worldgenerator gameregistry line, ive imported, the game registry file, but i dont know now. if it's of any use then heres my code for the EventManager class
package tutorial.basic;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class EventManager implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch(world.provider.dimensionId){
case -1: generateNether(world, random, chunkX * 16, chunkZ * 16);
case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16);
case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateEnd(World world, Random random, int x, int z) {
}
private void generateSurface(World world, Random random, int x, int z) {
this.addOreSpawn(Basic.genericOre, world, random, x, z, 16, 16, 3+random.nextInt(4), 32, 15, 160);
}
private void generateNether(World world, Random random, int x, int z) {
}
/**
* Adds an Ore Spawn to Minecraft. Simply register all Ores to spawn with this method in your Generation method in your IWorldGeneration extending Class
*
* @param The Block to spawn
* @param The World to spawn in
* @param A Random object for retrieving random positions within the world to spawn the Block
* @param An int for passing the X-Coordinate for the Generation method
* @param An int for passing the Z-Coordinate for the Generation method
* @param An int for setting the maximum X-Coordinate values for spawning on the X-Axis on a Per-Chunk basis
* @param An int for setting the maximum Z-Coordinate values for spawning on the Z-Axis on a Per-Chunk basis
* @param An int for setting the maximum size of a vein
* @param An int for the Number of chances available for the Block to spawn per-chunk
* @param An int for the minimum Y-Coordinate height at which this block may spawn
* @param An int for the maximum Y-Coordinate height at which this block may spawn
**/
public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY)
{
int maxPossY = minY + (maxY - 1);
assert maxY > minY: "The maximum Y must be greater than the Minimum Y";
assert maxX > 0 && maxX <= 16: "addOreSpawn: The Maximum X must be greater than 0 and less than 16";
assert minY > 0: "addOreSpawn: The Minimum Y must be greater than 0";
assert maxY < 256 && maxY > 0: "addOreSpawn: The Maximum Y must be less than 256 but greater than 0";
assert maxZ > 0 && maxZ <= 16: "addOreSpawn: The Maximum Z must be greater than 0 and less than 16";
int diffBtwnMinMaxY = maxY - minY;
for(int x = 0; x < chancesToSpawn; x++)
{
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(diffBtwnMinMaxY);
int posZ = blockZPos + random.nextInt(maxZ);
(new WorldGenMinable(block.blockID, maxVeinSize)).generate(world, random, posX, posY, posZ);
}
}
}
i think this is the bit that'll be of use
Edit: the commented out bits are bits that im excluding from the mod for now just to make sure what's the problem
Where is your class oremanager, you registered it and it seems that the problem come from there.
Or maybe you didn't create it. If you register an oremanager and if this oremanager is not complete or present you will get "not such method ...."
But to get a better tracking of your problem, place breakpoints in your code and run it as debug in Eclipse.
Then you can run the code line by line and catch the error right at the moment it happens.
I do this 10 times a day as i also make a lot of mistakes but in this way you can quickly find the problem and solve it.
i dont have an oremanager, but i have an eventmanager. but im assuming those are two different things.
breakpoints? what are those (i might know what they are, i just havent heard that word though)
And about break points, you can run the game inside Eclise by clicking on the Debug client button (the little green bug)
If you set breakpoints in you code, the game will stop at that line and you will return to Eclipse and then you can advance step by step and watch variables values and when you arrive on the crash spot you will know excatly which line of code caused it.
To put breakpoints just double click in the little margin at the left, the one under the litte J icon.
Art by me: MrPancakeWolfie@DeviantArt
Art by me: MrPancakeWolfie@DeviantArt
i cant find the comparator, i only redstone in Items, but ill keep looking.
Art by me: MrPancakeWolfie@DeviantArt
You'll have to add a TileEntity yourself to have it block specific, atm all blocks of the same type share the same "on/off" state
And you could possibly improve this as well
What do you mean with Copy & Paste your item?
Art by me: MrPancakeWolfie@DeviantArt
But in your reobf folder you get a minecraft folder and in it you have your mod.
Don't zip the minecraft folder, open it and zip the folder within.
If you have put your files in the net.minecraft..... structure in Eclipse you have a net folder if you have setup a folder four you file you have a "youmod" or wathever folder you name it.
You can have both too.
Zip them and put the zip in the mod folder of minecraft.
When you run it you will see your mod in the mod tab in the game menu.
Oh sorry i'm a bit late didn't see you solved your item problem.
and when i say copy and paste my item i mean, like values from certain items like flint and steel activates TNT, i could take the code that does that and paste it into my item so it can activate flint and steel
its working fine off of eclipse, but not when i mod minecraft.
Art by me: MrPancakeWolfie@DeviantArt
Art by me: MrPancakeWolfie@DeviantArt
i think this is the bit that'll be of use
Edit: the commented out bits are bits that im excluding from the mod for now just to make sure what's the problem
Or maybe you didn't create it. If you register an oremanager and if this oremanager is not complete or present you will get "not such method ...."
But to get a better tracking of your problem, place breakpoints in your code and run it as debug in Eclipse.
Then you can run the code line by line and catch the error right at the moment it happens.
I do this 10 times a day as i also make a lot of mistakes but in this way you can quickly find the problem and solve it.
breakpoints? what are those (i might know what they are, i just havent heard that word though)
GameRegistry.registerItem(genericPick, "genericPick");
GameRegistry.registerWorldGenerator(oreManager); <-------
And about break points, you can run the game inside Eclise by clicking on the Debug client button (the little green bug)
If you set breakpoints in you code, the game will stop at that line and you will return to Eclipse and then you can advance step by step and watch variables values and when you arrive on the crash spot you will know excatly which line of code caused it.
To put breakpoints just double click in the little margin at the left, the one under the litte J icon.