Les minerais ne spawn
-
Bonsoir,
le iron_3 ne veut pas spawn dans la nature alors que les autres si.
package com.mod.obaa.world; import java.util.Random; import com.mod.obaa.init.blockmod; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; public class WorldGen implements IWorldGenerator { public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: Generatenether(world, chunkX * 16, chunkZ * 16, random); break; case 0: GenerateOverWorld(world, chunkX * 16, chunkZ * 16, random); break; case 1: GenerateEnd(world, chunkX * 16, chunkZ * 16, random); break; } } private void addOre(Block block,Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minV, int maxV, int spawnChance) { for(int i = 0; i < spawnChance; i++) { int chunkSize = 16; int Xpos = posX + random.nextInt(chunkSize); int Ypos = minY + random.nextInt(maxY - minY); int Zpos = posZ + random.nextInt(chunkSize); new WorldGenMinable (block, maxV).generate(world, random, Xpos, Ypos, Zpos); } } private void GenerateEnd(World world, int i, int j, Random random) { } private void GenerateOverWorld(World world, int i, int j, Random random) { addOre(blockmod.iron_1, Blocks.stone, random, world, i, j, 5, 45, 3, 4, 12); addOre(blockmod.iron_2, Blocks.stone, random, world, i, j, 5, 30, 2, 3, 11); addOre(blockmod.iron_3, Blocks.stone, random, world, i, j, 5, 16, 1, 2, 50); } private void Generatenether(World world, int i, int j, Random random) { } }
-
La version ?
-
Bonsoir,
J’ajoute également que ce n’est pas la bonne section. Tout ce qui concerne le modding doit aller dans support pour les moddeurs. -
essai déjà sa:
package com.mod.obaa.world; import java.util.Random; import com.mod.obaa.init.blockmod; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; public class WorldGen implements IWorldGenerator { public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: Generatenether(world, chunkX * 16, chunkZ * 16, random); break; case 0: GenerateOverWorld(world, chunkX * 16, chunkZ * 16, random); break; case 1: GenerateEnd(world, chunkX * 16, chunkZ * 16, random); break; } } private void addOre(Block block,Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minV, int maxV, int spawnChance) { for(int i = 0; i < spawnChance; i++) { int chunkSize = 16; int Xpos = posX + random.nextInt(chunkSize); int Ypos = minY + random.nextInt(maxY - minY); int Zpos = posZ + random.nextInt(chunkSize); new WorldGenMinable (block, maxV).generate(world, random, Xpos, Ypos, Zpos); } } private void GenerateEnd(World world, int i, int j, Random random) { } private void GenerateOverWorld(World world, int i, int j, Random random) { addOre(blockmod.iron_1, Blocks.stone, random, world, i, j, 5, 45, 3, 4, 12); addOre(blockmod.iron_2, Blocks.stone, random, world, i, j, 5, 30, 2, 3, 11); addOre(blockmod.iron_3, Blocks.stone, random, world, i, j, 5, 30, 2, 3, 11); } private void Generatenether(World world, int i, int j, Random random) { } }
-
@pazzazzo Merci cela marche, mais comment tu as fais ?