I'm attempting to make world gen for a custom block that works the same as vines. The following is my IWorldGenerator code:
package dudesmods.fancycheeses.world.gen.feature;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import dudesmods.fancycheeses.FancyCheeses;
import net.minecraft.util.Direction;
import net.minecraft.util.Facing;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
public class WorldGenBacteraLactococcus implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
if(world.provider.dimensionId == 0) {
int firstBlockXCoord = chunkX + random.nextInt(16);
int firstBlockYCoord = 64;
int firstBlockZCoord = chunkZ + random.nextInt(16);
generateBacteria(world, random, firstBlockXCoord, firstBlockYCoord, firstBlockZCoord);
}
}
public boolean generateBacteria(World world, Random rand, int x, int y, int z)
{
int l = x;
for (int i1 = z; y < 128; ++y)
{
if (world.isAirBlock(x, y, z))
{
for (int j1 = 2; j1 <= 5; ++j1)
{
if (FancyCheeses.bacteria_lactococcus.canPlaceBlockOnSide(world, x, y, z, j1))
{
world.setBlock(x, y, z, FancyCheeses.bacteria_lactococcus, 1 << Direction.facingToDirection[Facing.oppositeSide[j1]], 2);
break;
}
}
}
else
{
x = l + rand.nextInt(4) - rand.nextInt(4);
z = i1 + rand.nextInt(4) - rand.nextInt(4);
}
}
return true;
}
}
but nothing is generating.