MC Modding
Please register and join the community!


Join the forum, it's quick and easy

MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[1.8.1] Generating Ores

+6
bottz2
jesshankin22
lcass
groxmapper
ikke009
Strengthowns
10 posters

Go down

[1.8.1] Generating Ores Empty [1.8.1] Generating Ores

Post by Strengthowns Wed Oct 05, 2011 10:54 am

Generating Ores

Spoiler:
Strengthowns
Strengthowns
Admin

Posts : 79
Join date : 2011-06-14
Location : Right here!

http://www.mcmodding.4umer.com

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by ikke009 Thu Oct 27, 2011 11:42 am

how does the rarity work? if coal is 20, would diamond be higher or lower?
ikke009
ikke009
Member

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

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by groxmapper Thu Oct 27, 2011 1:31 pm

Strengthowns wrote:
Generating Ores

Spoiler:

I would like to note this doesn't work with generateNether because WorldGenMinable replaces smooth stone when placing the ores so you'll need to copy WorldGenMineable and edit that to be netherrack for nether ore spawning.
groxmapper
groxmapper
Member

Posts : 27
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by lcass Thu Oct 27, 2011 7:07 pm

diamond is 7 and i think in ic2 uranium is 10

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by lcass Thu Oct 27, 2011 7:30 pm

I noticed people found generating ores hard so here is the full code with all the fixes
Code:
package net.minecraft.src;

import java.util.Random;

public class mod_rubyore extends BaseMod
{
  public static Block rubyore = new rubyore(195, 0).setHardness(1.0F).setResistance(300.0F).setLightValue(1.0F).setBlockName("rubyore");
 
  public String Version()
  {
      return "1.8.1";
  }
 
  public mod_rubyore()
  {
      ModLoader.RegisterBlock(rubyore);
      rubyore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crystal/rubyore.png");
      ModLoader.AddName(rubyore, "rubyore");
   
  }
  public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
  {
      for(int i = 0; i < 6; i++)
      {
          int randPosX = chunkX + rand.nextInt(16);
          int randPosY = rand.nextInt(30 );
          int randPosZ = chunkZ + rand.nextInt(16);
          (new WorldGenMinable(mod_rubyore.rubyore.blockID, 2)).generate(world, rand, randPosX, randPosY, randPosZ);
      }
  }
}

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by jesshankin22 Fri Oct 28, 2011 12:12 am

hmmm... it says it can't recognize the character "public"...

jesshankin22
Member

Posts : 47
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by lcass Fri Oct 28, 2011 12:13 am

WOW

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by jesshankin22 Fri Oct 28, 2011 8:19 pm

Wow what?

jesshankin22
Member

Posts : 47
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by ikke009 Fri Oct 28, 2011 8:26 pm

wow you could probably click on the error icon in front of the line number to get a list of things you can change the word public in and click the right one, or if you click the word public itself. that is, if you are using eclipse
ikke009
ikke009
Member

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

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by lcass Fri Oct 28, 2011 8:27 pm

Very Happy cant recognize character public

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by bottz2 Sat Oct 29, 2011 9:24 pm

it wont gen

bottz2
Member

Posts : 14
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by ikke009 Sat Oct 29, 2011 10:41 pm

bottz2 wrote:it wont gen
you might want to start by making a topic in the help section, posging your code and your problem in the right format.. right now i cant magically tell you like 'oh you have to add a ; to the end of line 7 then itll work..'
ikke009
ikke009
Member

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

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by jesshankin22 Sat Oct 29, 2011 11:00 pm

Oh I know that was when I was a n00b to the site... just disregard that cause I got it all figured out, but thanks anyway.

jesshankin22
Member

Posts : 47
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by thedirtyassassin Sun Oct 30, 2011 2:24 pm

where do i put the code? what do you mean by out side of the modloader stuff?

thedirtyassassin
Member

Posts : 28
Join date : 2011-10-30
Location : In your dreams!

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by ikke009 Sun Oct 30, 2011 2:56 pm

this is the code i use for my titanium ore.
I put it in a new class file called mod_titaniumore, which is needed for every generator if you want to genereate more then 1 ore without getting crashes or getting your code unorganized.
Code:

package net.minecraft.src;
import java.util.Random;
public class mod_titaniumore extends BaseMod
{

   public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
     {
         for(int i = 0; i < 5; i++)
         {
             int randPosX = chunkX + rand.nextInt(16);
             int randPosY = rand.nextInt(20);
             int randPosZ = chunkZ + rand.nextInt(16);
             (new WorldGenMinable(mod_jasper.titaniumore.blockID, 70)).generate(world, rand, randPosX, randPosY, randPosZ);
         }
     }
 
public String Version()
  {
      return "1.8.1";
  }
}
ikke009
ikke009
Member

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

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by blackhounter Sun Oct 30, 2011 5:42 pm

rarity values are
diamond : 1
gold : 2
coal : 20

thats all i know

blackhounter
Member

Posts : 1
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by thedirtyassassin Sun Oct 30, 2011 5:44 pm

ikke009 wrote:this is the code i use for my titanium ore.
I put it in a new class file called mod_titaniumore, which is needed for every generator if you want to genereate more then 1 ore without getting crashes or getting your code unorganized.
Code:

package net.minecraft.src;
import java.util.Random;
public class mod_titaniumore extends BaseMod
{

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

but where do you put the class file?

thedirtyassassin
Member

Posts : 28
Join date : 2011-10-30
Location : In your dreams!

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by ikke009 Sun Oct 30, 2011 6:07 pm

blackhounter wrote:rarity values are
diamond : 1
gold : 2
coal : 20

thats all i know
source of information please?
ikke009
ikke009
Member

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

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by ikke009 Sun Oct 30, 2011 6:08 pm

thedirtyassassin wrote:
ikke009 wrote:snip

but where do you put the class file?
well in the net.minecraft.src of course
ikke009
ikke009
Member

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

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by groxmapper Sun Oct 30, 2011 6:30 pm

ikke009 wrote:
thedirtyassassin wrote:
ikke009 wrote:snip

but where do you put the class file?
well in the net.minecraft.src of course

To put what he said in other words, in the .jar or in a .zip in the mods folder.

EDIT: your not talking about the .class file, your talking about the .java file! The .java file goes in "MCPDIR/src/net/minecraft/src".
groxmapper
groxmapper
Member

Posts : 27
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by sammko Tue Nov 01, 2011 10:12 pm

ikke009 wrote:how does the rarity work? if coal is 20, would diamond be higher or lower?
for exaple: if RARITY is 20, the worldgen will try to put the block 20 times per chunk
if its 3 it will try to place it 3 times per chunk. so diamond RARITY is lower

sammko
Member

Posts : 5
Join date : 2011-11-01

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by GodSend Tue Nov 15, 2011 5:03 am

I have one question about this, what .java files exactly would you make? Like, would you make an mod_NameHere for the actual ore, and then make like another mod_WorldGenThingy and would that make the Item you created before automatically generate into the world?

One thing that saddens me is the small amount of descriptiveness Strength puts into his tutorials Sad

GodSend
Member

Posts : 2
Join date : 2011-11-15

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by jesshankin22 Tue Nov 15, 2011 6:12 am

well you could, but you don't have to. basically what you do is put it in between the brackets

jesshankin22
Member

Posts : 47
Join date : 2011-10-24

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by GodSend Wed Nov 16, 2011 12:48 am

Wait, I just figured it out. In the .java file you make for the block you include the whole world generation thingy for that block. Well, I'm recompiling and seeing if it worked.

GodSend
Member

Posts : 2
Join date : 2011-11-15

Back to top Go down

[1.8.1] Generating Ores Empty Re: [1.8.1] Generating Ores

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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