Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.4.7]Only one ore generating...
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
Vemahk20

[1.4.7]Only one ore generating...

By Vemahk20, May 20, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Vemahk20    1

Vemahk20

Vemahk20    1

  • Tree Puncher
  • Vemahk20
  • Members
  • 1
  • 33 posts
Posted May 20, 2013

I have no idea what's going on... I have 4 things set to genereate but for SOME reason, only one of them is and i have no flipping idea why. Any help is great, here's the gen code.

 

package IndustrialBreakout.world;

import java.util.Random;

import IndustrialBreakout.mod_IndustrialBreakout;
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 WorldGeneratorIB implements IWorldGenerator {
        @Override
        public void generate(Random r, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

    		int x = chunkX*16 +r.nextInt(16);
    		//int y = chunkY*16 +random.nextInt(16);
    		int z = chunkZ*16 +r.nextInt(16);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreTitanium.blockID, 1+r.nextInt(2), 16, 3);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreTin.blockID, 4 + r.nextInt(2), 32, 3);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreCopper.blockID, 6 + r.nextInt(6), 64, 10);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreChargedCoal.blockID, 2 + r.nextInt(2), 16, 3);
        }
        
        private void addOreGen(Random r, int cX, int cZ, World w, int id, int numberOfGen, int y, int numOfVeins){		
        	for(int i = 0; i < numOfVeins; i++){
        		int x = cX*16 + r.nextInt(16);
        		int z = cZ*16 + r.nextInt(16);
        		(new WorldGenMinable(id, numberOfGen)).generate(w, r, x, y, z);
        	}
        }
        
}

  • Quote

Share this post


Link to post
Share on other sites

Mew    36

Mew

Mew    36

  • Dragon Slayer
  • Mew
  • Members
  • 36
  • 567 posts
Posted May 20, 2013

have you tried following a tutorial? This way seems weird for me...

  • Quote

Share this post


Link to post
Share on other sites

Vemahk20    1

Vemahk20

Vemahk20    1

  • Tree Puncher
  • Vemahk20
  • Members
  • 1
  • 33 posts
Posted May 20, 2013

Lol, tutorials make no since to me, so i just pick up on certain things from browsing the forums and that is what i got xD.

No help then? :)

  • Quote

Share this post


Link to post
Share on other sites

Mew    36

Mew

Mew    36

  • Dragon Slayer
  • Mew
  • Members
  • 36
  • 567 posts
Posted May 20, 2013

Here is how I do generation:

 

https://github.com/ModderPenguin/JC-s-Dragons-Mod---add-ons/blob/master/source/motoolsnstuff/worldgen/WorldGeneratorDragonBros.java

 

And I realised that you had the right implementation, but I got it confused with another one :P

  • Quote

Share this post


Link to post
Share on other sites

Vemahk20    1

Vemahk20

Vemahk20    1

  • Tree Puncher
  • Vemahk20
  • Members
  • 1
  • 33 posts
Posted May 20, 2013

Ah, you see, we kind of did ours similarly, i just didnt want to write out all those for loops. Also, i have a question. What is the point of calling the generateNether() and generateEnd() if there is nothing in them?

  • Quote

Share this post


Link to post
Share on other sites

Mew    36

Mew

Mew    36

  • Dragon Slayer
  • Mew
  • Members
  • 36
  • 567 posts
Posted May 20, 2013

because then I have them there when I need them :P

  • Quote

Share this post


Link to post
Share on other sites

Vemahk20    1

Vemahk20

Vemahk20    1

  • Tree Puncher
  • Vemahk20
  • Members
  • 1
  • 33 posts
Posted May 20, 2013

Ah... Well i am not going to screw with nether ores or end ores so i woudn't need those.. :)

I am going to switch styles of that code to see if it helps, but i really dont see much of a difference so... Yeah...

  • Quote

Share this post


Link to post
Share on other sites

Mew    36

Mew

Mew    36

  • Dragon Slayer
  • Mew
  • Members
  • 36
  • 567 posts
Posted May 20, 2013

You NEED a new for loop everytime. You also NEED the switch statement. Just in case I read that wrong, sorry.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Ronaldi2001
      Adding burn time to a block

      By Ronaldi2001 · Posted 16 minutes ago

      Im trying to figure out how to add burn time to a block, I can add It to an item no problem but I can't figure it out for a block. I tried looking through the Minecraft code for what they do with a coal block but I can't find where they do it.
    • NoMercyPro
      Forge 1.12.2 Launcher Crash

      By NoMercyPro · Posted 17 minutes ago

      Oh, I'm so sorry! I didn't know 9minecraft.net was a repost site. I won't use it anymore and I thank you for your help. A lot of people (including me) would be lost without you.
    • DavidM
      Forge server kicking players randomly, sometimes unable to join

      By DavidM · Posted 25 minutes ago

      Please post the server log of when someone got kicked.
    • DavidM
      pointing to MCP folder instead of MDK ???

      By DavidM · Posted 28 minutes ago

      No need to mess with MCP. Simply download the 1.14 mdk and copy the src from 1.12 to 1.14. Then fix all the mapping changes and other changes with your IDE.
    • DaemonUmbra
      pointing to MCP folder instead of MDK ???

      By DaemonUmbra · Posted 28 minutes ago

      At this time I have to say McJty's tutorial is the least bad. If you have an MCP folder you're doing something wrong because MCP is not longer really a thing
  • Topics

    • Ronaldi2001
      0
      Adding burn time to a block

      By Ronaldi2001
      Started 15 minutes ago

    • NoMercyPro
      3
      Forge 1.12.2 Launcher Crash

      By NoMercyPro
      Started 21 hours ago

    • Kull
      1
      Forge server kicking players randomly, sometimes unable to join

      By Kull
      Started 17 hours ago

    • JMAS
      8
      pointing to MCP folder instead of MDK ???

      By JMAS
      Started 3 hours ago

    • Professional Derp
      0
      Server frequently crashes

      By Professional Derp
      Started 47 minutes ago

  • Who's Online (See full list)

    • geekles
    • K_Sasha
    • Arcratist
    • stepsword
    • Ommina
    • Ronaldi2001
    • NoMercyPro
    • Frontear
    • DavidM
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.4.7]Only one ore generating...
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community