Jump to content
  • Home
  • Files
  • Docs
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...
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
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

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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

    • LessyDoggy
      Forge 1.12.2 Installing Bug

      By LessyDoggy · Posted 1 hour ago

      So I used forge 1.16.5 but now I cant change it too 1.12.2 no mather what. I have tried Installing client, Installing server and extract but nothing works. I even removed forge 1.16.5 from my computer but I still have that verison on and idk how to change it.
    • Yourskillx2
      !!Keeps crashing during launch!!

      By Yourskillx2 · Posted 1 hour ago

      I have a decent sized mod pack with around 90 mods and every time I go to launch the game, it loads some stuff then crashes with exit code 0, I cannot figure out if its a mod in the pack doing it, like maybe not a release version or if it just doesn't work with Mc like its supposed to.
    • IMaironI
      server error

      By IMaironI · Posted 8 hours ago

      2021-03-06-8.log
    • diesieben07
      server error

      By diesieben07 · Posted 8 hours ago

      Like I already said: The logs folder.
    • prototype204
      Attacking/Hitting issue

      By prototype204 · Posted 8 hours ago

      I am no longer able to attack animals or mobs in the game, however they are still able to attack me. I checked to verify that the mods I downloaded weren't the issue. I think they might be an error code in forge 1.16.5 however if anyone knows what I could do to fix this. P.S. I could still break bricks. 
  • Topics

    • LessyDoggy
      0
      Forge 1.12.2 Installing Bug

      By LessyDoggy
      Started 1 hour ago

    • Yourskillx2
      0
      !!Keeps crashing during launch!!

      By Yourskillx2
      Started 1 hour ago

    • IMaironI
      13
      server error

      By IMaironI
      Started 12 hours ago

    • prototype204
      0
      Attacking/Hitting issue

      By prototype204
      Started 8 hours ago

    • BeardlessBrady
      3
      [1.16.5] Adding arguments to DeferredRegister and RegistryObject

      By BeardlessBrady
      Started 12 hours ago

  • Who's Online (See full list)

    • zlappedx3
    • DavidM
    • troublemaker_47
    • VecsonON
    • Kreepydude
    • chaseoqueso
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.4.7]Only one ore generating...
  • Theme

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