I get an error:
my WorldGen code:
package de.MhytRPG.www.worldgen;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import de.MhytRPG.www.MhytRPG;
import de.MhytRPG.www.structures.Schematic;
import de.MhytRPG.www.structures.SchematicLoader;
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.WorldGenLiquids;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGen 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);
break;
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
break;
}
}
private void generateEnd(World world, Random rand, int chunkX, int chunkZ) {}
private void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
for(int k = 0; k < 10; k++){
int firstBlockXCoord = chunkX + rand.nextInt(16);
int firstBlockYCoord = rand.nextInt(200);
int firstBlockZCoord = chunkZ + rand.nextInt(16);
(new WorldGenLiquids(MhytRPG.blockgoldenwater)).generate(world, rand, firstBlockXCoord, firstBlockYCoord, firstBlockZCoord);
}
for(int chanceForChuk = 0; chanceForChuk < 1; chanceForChuk++) {
Schematic spring = SchematicLoader.get("spring.schematic");
int firstBlockXCoord = chunkX + rand.nextInt(16);
int firstBlockYCoord = rand.nextInt(200);
int firstBlockZCoord = chunkZ + rand.nextInt(16);
int i = 0;
for(int cy = 0; cy < spring.height; cy++)
for(int cz = 0; cz < spring.length; cz++)
for(int cx = 0; cx < spring.width; cx++){
Block b = Block.getBlockById(spring.blocks[i]);
if(b!= Blocks.air)
{
world.setBlockToAir(cx + firstBlockXCoord , cy + firstBlockYCoord, cz + firstBlockZCoord);
world.setBlock(cx + firstBlockXCoord, cy + firstBlockYCoord, cz + firstBlockZCoord, b, spring.data[i] , 2);
}
i++;
}
}
}
private void generateNether(World world, Random rand, int chunkX, int chunkZ) {}
}
My Line 52 is: for(int cy = 0; cy < spring.height; cy++)
I don´t really know why, is the spring.height = 0 ?