Jump to content

SteezyFleeces

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by SteezyFleeces

  1. I am having trouble spawning a block on the surface, the console prints out "block placed" but I will search all over and not see one, could I get some help fixing this? package myown.worldgen; import java.util.Random; import myown.basicinfo.Ids; import myown.blocks.Blocks; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenTallGrass; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; public class WorldGeneratorHSM implements IWorldGenerator { public static void init(){ GameRegistry.registerWorldGenerator(new WorldGeneratorHSM()); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { // TODO Auto-generated method stub switch(world.provider.dimensionId){ //case -1: generateNether(world, random,chunkX*16,chunkZ*16); case 0 : generateSurface(world, random,chunkX*16,chunkZ*16); } } private void generateSurface(World world, Random random, int BlockX, int BlockZ) { for(int i =0; i<10;i++){ int Xcoord = BlockX + random.nextInt(16); int Zcoord = BlockZ + random.nextInt(16); int Ycoord = random.nextInt(30); (new WorldGenMinable(Ids.AlloBlock, 4)).generate(world, random, Xcoord, Ycoord, Zcoord); } for(int i =0; i<100;i++){ int Xcoord = BlockX + random.nextInt(16); int Zcoord = BlockZ + random.nextInt(16); int Ycoord = world.getHeightValue(Xcoord, Zcoord)+random.nextInt(4); if(world.isAirBlock(Xcoord, Ycoord, Zcoord) && world.getBlockId(Xcoord, Ycoord-1, Zcoord) == Block.grass.blockID && Blocks.block1.canPlaceBlockAt(world, Xcoord, Ycoord, Zcoord)){ System.out.println("block placed"); (new WorldGenMinable(Ids.SapphireOre, 1)).generate(world, random, Xcoord, Ycoord, Zcoord); } } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.