MC Modding
Please register and join the community!

[Answered]Problem with ore generating

MC Modding :: Help :: Help

View previous topic View next topic Go down

[Answered]Problem with ore generating

Post by quindo on Thu Oct 27, 2011 4:22 pm

Hey people, i started modding yesterday,I've created new ore, and item, but when i try to make ore generating I am getting errors, here is my code:
Code:
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
    {
        for(int i = 0; i < 12; i++)
        {
            int randPosX = chunkX + rand.nextInt(16);
            int randPosY = rand.nextInt(46);
            int randPosZ = chunkZ + rand.nextInt(16);
            (new WorldGenMinable(mod_Emerald.Emerald.190, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
        }
    } 

and errors:
Code:
2011-10-27 15:14 -    commands.__init__ - INFO - == MCP v4.4 ==
2011-10-27 15:14 -    commands.__init__ - DEBUG - OS : win32
2011-10-27 15:14 -  recompile.main - INFO - > Recompiling client...
2011-10-27 15:14 -    commands.recompile - DEBUG - recompile: 'javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;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\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java'
2011-10-27 15:14 -    commands.recompile - ERROR - javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;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\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java failed.
2011-10-27 15:14 -    commands.recompile - ERROR - Return code : 1
2011-10-27 15:14 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:1: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - DEBUG - public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
2011-10-27 15:14 -    commands.recompile - DEBUG - ^
2011-10-27 15:14 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - DEBUG - for(int i = 0; i < 12; i++)
2011-10-27 15:14 -    commands.recompile - DEBUG - ^
2011-10-27 15:14 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - DEBUG - for(int i = 0; i < 12; i++)
2011-10-27 15:14 -    commands.recompile - DEBUG - ^
2011-10-27 15:14 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:6: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - DEBUG - int randPosY = rand.nextInt(46);
2011-10-27 15:14 -    commands.recompile - DEBUG - ^
2011-10-27 15:14 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:7: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - DEBUG - int randPosZ = chunkZ + rand.nextInt(16);
2011-10-27 15:14 -    commands.recompile - DEBUG - ^
2011-10-27 15:14 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:8: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - DEBUG - (new WorldGenMinable(mod_Emerald.Emerald.190, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
2011-10-27 15:14 -    commands.recompile - DEBUG - ^
2011-10-27 15:14 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:9: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - DEBUG - }
2011-10-27 15:14 -    commands.recompile - DEBUG - ^
2011-10-27 15:14 -    commands.recompile - DEBUG - 7 errors
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - == ERRORS FOUND ==
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:1: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - ERROR - public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
2011-10-27 15:14 -    commands.recompile - ERROR - ^
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - ERROR - for(int i = 0; i < 12; i++)
2011-10-27 15:14 -    commands.recompile - ERROR - ^
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - ERROR - for(int i = 0; i < 12; i++)
2011-10-27 15:14 -    commands.recompile - ERROR - ^
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:6: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - ERROR - int randPosY = rand.nextInt(46);
2011-10-27 15:14 -    commands.recompile - ERROR - ^
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:7: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - ERROR - int randPosZ = chunkZ + rand.nextInt(16);
2011-10-27 15:14 -    commands.recompile - ERROR - ^
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:8: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - ERROR - (new WorldGenMinable(mod_Emerald.Emerald.190, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
2011-10-27 15:14 -    commands.recompile - ERROR - ^
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:9: class, interface, or enum expected
2011-10-27 15:14 -    commands.recompile - ERROR - }
2011-10-27 15:14 -    commands.recompile - ERROR - ^
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -    commands.recompile - ERROR - 7 errors
2011-10-27 15:14 -    commands.recompile - ERROR - ==================
2011-10-27 15:14 -    commands.recompile - ERROR -
2011-10-27 15:14 -  recompile.main - INFO - > Done in 17.31 seconds
2011-10-27 15:14 -  recompile.main - INFO - > Recompiling server...
2011-10-27 15:14 -    commands.checksources - WARNING - !! Can not find server sources !!


Last edited by quindo on Thu Oct 27, 2011 6:10 pm; edited 1 time in total

quindo
Member

Posts : 5
Join date : 2011-10-26

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by ikke009 on Thu Oct 27, 2011 4:38 pm

this bit
(new WorldGenMinable(mod_Emerald.Emerald.190, 5))

should be this
(new WorldGenMinable(mod_Emerald.Emerald.blockID, 5))


the part blockID doesnt mean you have to put in the id of the block, it means the block is a ...block xD for items you use .shiftedIndex and for blocks you use .blockID
undeceidedt explains this well in one of his youtube videos..
avatar
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 23
Location : The netherlands

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by quindo on Thu Oct 27, 2011 4:43 pm

huhh, my bad Razz Thank you for help ;]

quindo
Member

Posts : 5
Join date : 2011-10-26

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by ikke009 on Thu Oct 27, 2011 4:46 pm

no problem Smile
avatar
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 23
Location : The netherlands

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by quindo on Thu Oct 27, 2011 4:53 pm

I am still having errors ;/
Code:
2011-10-27 15:52 -    commands.__init__ - INFO - == MCP v4.4 ==
2011-10-27 15:52 -    commands.__init__ - DEBUG - OS : win32
2011-10-27 15:52 -  recompile.main - INFO - > Recompiling client...
2011-10-27 15:52 -    commands.recompile - DEBUG - recompile: 'javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;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\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java'
2011-10-27 15:52 -    commands.recompile - ERROR - javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;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\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraft\src\*.java  conf/patches/*.java failed.
2011-10-27 15:52 -    commands.recompile - ERROR - Return code : 1
2011-10-27 15:52 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:1: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - DEBUG - public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
2011-10-27 15:52 -    commands.recompile - DEBUG - ^
2011-10-27 15:52 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - DEBUG - for(int i = 0; i < 12; i++)
2011-10-27 15:52 -    commands.recompile - DEBUG - ^
2011-10-27 15:52 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - DEBUG - for(int i = 0; i < 12; i++)
2011-10-27 15:52 -    commands.recompile - DEBUG - ^
2011-10-27 15:52 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:6: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - DEBUG - int randPosY = rand.nextInt(46);
2011-10-27 15:52 -    commands.recompile - DEBUG - ^
2011-10-27 15:52 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:7: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - DEBUG - int randPosZ = chunkZ + rand.nextInt(16);
2011-10-27 15:52 -    commands.recompile - DEBUG - ^
2011-10-27 15:52 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:8: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - DEBUG - (new WorldGenMinable(mod_Emerald.Emerald.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
2011-10-27 15:52 -    commands.recompile - DEBUG - ^
2011-10-27 15:52 -    commands.recompile - DEBUG - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:9: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - DEBUG - }
2011-10-27 15:52 -    commands.recompile - DEBUG - ^
2011-10-27 15:52 -    commands.recompile - DEBUG - 7 errors
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - == ERRORS FOUND ==
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:1: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - ERROR - public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
2011-10-27 15:52 -    commands.recompile - ERROR - ^
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - ERROR - for(int i = 0; i < 12; i++)
2011-10-27 15:52 -    commands.recompile - ERROR - ^
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:3: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - ERROR - for(int i = 0; i < 12; i++)
2011-10-27 15:52 -    commands.recompile - ERROR - ^
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:6: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - ERROR - int randPosY = rand.nextInt(46);
2011-10-27 15:52 -    commands.recompile - ERROR - ^
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:7: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - ERROR - int randPosZ = chunkZ + rand.nextInt(16);
2011-10-27 15:52 -    commands.recompile - ERROR - ^
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:8: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - ERROR - (new WorldGenMinable(mod_Emerald.Emerald.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
2011-10-27 15:52 -    commands.recompile - ERROR - ^
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_EmeraldGen.java:9: class, interface, or enum expected
2011-10-27 15:52 -    commands.recompile - ERROR - }
2011-10-27 15:52 -    commands.recompile - ERROR - ^
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -    commands.recompile - ERROR - 7 errors
2011-10-27 15:52 -    commands.recompile - ERROR - ==================
2011-10-27 15:52 -    commands.recompile - ERROR -
2011-10-27 15:52 -  recompile.main - INFO - > Done in 1.28 seconds
2011-10-27 15:52 -  recompile.main - INFO - > Recompiling server...
2011-10-27 15:52 -    commands.checksources - WARNING - !! Can not find server sources !!

quindo
Member

Posts : 5
Join date : 2011-10-26

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by ikke009 on Thu Oct 27, 2011 5:21 pm

Code:

public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
    {
        for(int i = 0; i < 12; i++)
        {
            int randPosX = chunkX + rand.nextInt(16);
            int randPosY = rand.nextInt(46);
            int randPosZ = chunkZ + rand.nextInt(16);
            (new WorldGenMinable(mod_name1.name2.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
        }
    } 
name 1 is the name of the class file that extends basemod, where you register all your blocks etc. and where this code is located if you do it correctly.
name2 is the name of the block that you are letting generate, so for you probably emerald.
also the code is located in the squiggly brackets starting under the line
public class mod_name extends BaseMod
and OUTSIDE of the {} from public mod_name() {

i hope you can figure it out..
avatar
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 23
Location : The netherlands

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by quindo on Thu Oct 27, 2011 6:05 pm

ok, nothing, i findet out whats going on Razz


Last edited by quindo on Thu Oct 27, 2011 6:10 pm; edited 1 time in total (Reason for editing : sorry :P)

quindo
Member

Posts : 5
Join date : 2011-10-26

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by ikke009 on Thu Oct 27, 2011 6:16 pm

what was it? i'd like to know for when im gonna try this myself
avatar
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 23
Location : The netherlands

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by quindo on Thu Oct 27, 2011 6:41 pm

i forgot about something here is code that don't give errors :
Code:
package net.minecraft.src;
import java.util.Random;
public class mod_EmeraldGen extends BaseMod
{

public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
    {
        for(int i = 0; i < 12; i++)
        {
            int randPosX = chunkX + rand.nextInt(16);
            int randPosY = rand.nextInt(46);
            int randPosZ = chunkZ + rand.nextInt(16);
            (new WorldGenMinable(mod_Emerald.Emerald.blockID, 5)).generate(world, rand, randPosX, randPosY, randPosZ);
        }
    }
public String Version()
  {
      return "1.8.1";
  }
}
   
// }   

quindo
Member

Posts : 5
Join date : 2011-10-26

View user profile

Back to top Go down

Re: [Answered]Problem with ore generating

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


MC Modding :: Help :: Help

 
Permissions in this forum:
You cannot reply to topics in this forum