Skip to content

Instantly share code, notes, and snippets.

/Generator Class Secret

Created March 31, 2014 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1e9c7e16457af4f3f2a1 to your computer and use it in GitHub Desktop.
Save anonymous/1e9c7e16457af4f3f2a1 to your computer and use it in GitHub Desktop.
package com.Einhaender.EinMod;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class SkyblockGenerator 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:
generateOverworld (world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateEnd (world, random, chunkX * 16, chunkZ * 16);
break;
}
}
private void generateEnd(World world, Random random, int i, int j)
{
}
private void generateOverworld(World world, Random random, int x, int z)
{
destroyChunk (world, x, z);
}
private void generateNether(World world, Random random, int i, int j)
{
}
public void destroyChunk(World world, int x, int z)
{
Chunk chunk = world.getChunkFromBlockCoords (x, z);
int x1 = chunk.xPosition;
int z1 = chunk.zPosition;
for (int y = 255; y >= 0; y--)
{
for (x = x1; x < x1 + 16; x++)
{
for (z = z1; z < z1 + 16; z++)
{
// world.setBlockToAir (x, y, z);
world.setBlock (x, y, z, Blocks.air);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment