mekanism / Mekanism

A mod for Minecraft
MIT License
1.38k stars 521 forks source link

Help with nether generation #101

Closed UnknownAK closed 11 years ago

UnknownAK commented 11 years ago

Aidan I apologise for posting it here but I hope that with your brilliance you could help me with this problem or anyone else who sees this post. One of my ores that i have used for a long time in different versions of my mod will not generate in the nether. I get no errors in the code but when looking around in the nether I cannot find it.

I appreciate that this may not be your speciality but considering how advanced your modding skills are to others that i have seen im sure you would have some solution.

Anyway here is the code that i am using if you would care to take a look:

package scientificcomplexity.common;

import java.util.Random;

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 WorldGenNether implements IWorldGenerator{

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
    switch (world.provider.dimensionId){

    case -1:
        generateNether(world, random, chunkX * 16, chunkZ * 16);

    }

}

private void generateNether(World world, Random random, int blockX, int blockZ) {
    for(int i = 0; i < 100; i++){
        int xCoord = blockX + random.nextInt(16);
        int yCoord = random.nextInt(40);
        int zCoord = blockZ + random.nextInt(16);

        (new WorldGenMinable(ScientificComplexity.hellOre.blockID, 10)).generate(world, random, xCoord, yCoord, zCoord);
    }
}
    }
UnknownAK commented 11 years ago

once again i apologise and i feel like i am wasting your time but help would be greatly appreciated.

aidancbrady commented 11 years ago

Have you registered the handler? EDIT: closed, continue to write here though

UnknownAK commented 11 years ago

not sure if this is the handler but i presume it is, this is in my main file

GameRegistry.registerWorldGenerator(new WorldGenNether());

UnknownAK commented 11 years ago

this is a personal question but anyway, are you a programmer or did you just learn to mod and then got good with it. I am not a programmer and it seems hard to find some good mods that dont have someone who already had skills in that field. Doesn't leave you with much inspiration knowing that unless you have a job like that you couldnt make a mod like that

aidancbrady commented 11 years ago

I actually am taking Java courses, I've been developing for around 5 years. Minecraft is definitely a great way to learn, though, and by no means is it impossible to make a good mod without prior experience.

As for your code: do you know exactly what that is doing? From what I see, you're generating 100 veins of 10 ore in chunks, all of which are under y level 40. All is looking well from my standpoint, but I would recommend actually checking if the provider instanceof ChunkProviderNether instead of choosing from the dim ID.

UnknownAK commented 11 years ago

to be honest with you, no i dont know how the generation works. I understand a lot of the code in my mod and use common sense to figure what it is doing to fix errors but world generation is definitely an issue for me. The other ore in my mod which generates in the surface, i made a long time ago when i was last modding and i just updated the code. The way i have learned to mod is from tutorials online that i have made more advanced but there is no up to date tutorials on nether generation

UnknownAK commented 11 years ago

also aidan, i have been thinking of trying to learn javascript to help with my mod. But the problem is in my head i cant see how the functions and things you learn from javascript can be used to make things in game. Its hard to explain but i dont see how some functions turn into a game if you see what i mean

UnknownAK commented 11 years ago

i am planning for a future update for my mod to be able to use electricity like EU and most likely Joules from Universal Electricity. In your opinion is it really difficult to implement an electricity system?

UnknownAK commented 11 years ago

i know that it would be hassling for you but would you be able to edit the code to something that would work and paste it, then i might be able to see what the problem would be so i could fix it in the future.

UnknownAK commented 11 years ago

you said you were taking java courses, what type of courses? and also did you look into other mods to learn code because a lot things in your mod are really advanced compared to many others?