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

    • Jack Richard
      [1.15.2] Minecraft Registry Problem When Loading from Jar

      By Jack Richard · Posted 1 hour ago

      Thanks so much for your help! I removed the log4j dependency, I honesty don't remember when I put that there. Once I fixed the jar.finalizedBy line, everything worked! (One small issue where I was relocating all of "com.google" when I just should've relocated "com.google.common," too)   Thanks again!
    • Teedledee
      1.16.4 Failed to synchronize registry data with server LAN

      By Teedledee · Posted 1 hour ago

      Fixed the issue, one config didnt match, downloaded randompatches to solve badly compressed packet afterwards.
    • DaemonUmbra
      [1.15.2] Minecraft Registry Problem When Loading from Jar

      By DaemonUmbra · Posted 1 hour ago

      First of all, why are you shadowing log4j? Minecraft already provides log4j2. Second if build is running shadowjar instead of jar then you might need to tweak the line where it says jar.finalizedBy('reobfJar') to finalize shadowJar instead
    • DaemonUmbra
      "The game crashed whilst rendering overlay"

      By DaemonUmbra · Posted 1 hour ago

      What do you think you should do about this?
    • DaemonUmbra
      IntelliJ doesn't include resources folder while debugging

      By DaemonUmbra · Posted 1 hour ago

      What version of Minecraft are you using?
  • Topics

    • Jack Richard
      2
      [1.15.2] Minecraft Registry Problem When Loading from Jar

      By Jack Richard
      Started 2 hours ago

    • Teedledee
      2
      1.16.4 Failed to synchronize registry data with server LAN

      By Teedledee
      Started January 18

    • GuyWithTVHead
      1
      "The game crashed whilst rendering overlay"

      By GuyWithTVHead
      Started 1 hour ago

    • GermanBucket
      2
      IntelliJ doesn't include resources folder while debugging

      By GermanBucket
      Started 3 hours ago

    • Arthurmeade12
      8
      Error Conecting to My Minecraft Server

      By Arthurmeade12
      Started Saturday at 11:05 PM

  • Who's Online (See full list)

    • forgotendeath09
    • Inforno
    • brunoxd2
    • ChampionAsh5357
    • pupymk1
  • 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