Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.limplungs.blockhole.dimensions;
- import java.util.List;
- import com.limplungs.blockhole.blocks.BlockBlockholeWall;
- import com.limplungs.blockhole.blocks.BlockList;
- import net.minecraft.entity.EnumCreatureType;
- import net.minecraft.init.Blocks;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraft.world.biome.Biome;
- import net.minecraft.world.biome.Biome.SpawnListEntry;
- import net.minecraft.world.chunk.Chunk;
- import net.minecraft.world.chunk.ChunkPrimer;
- import net.minecraft.world.chunk.IChunkGenerator;
- public class ChunkProviderSingularity implements IChunkGenerator
- {
- private World worldObj;
- public ChunkProviderSingularity(World world)
- {
- this.worldObj = world;
- }
- @Override
- public Chunk provideChunk(int x, int z)
- {
- ChunkPrimer primer = new ChunkPrimer();
- for (int j = 0; j < 256; j++)
- {
- for (int i = 0; i < 16; i++)
- {
- for (int k = 0; k < 16; k++)
- {
- primer.setBlockState(i, j, k, Blocks.AIR.getDefaultState());
- }
- }
- }
- if (x == 0 && z == 0)
- {
- int i = 0;
- int j = 0;
- int k = 0;
- for (i = 1; i < 15; i++)
- {
- for (k = 1; k < 15; k++)
- {
- primer.setBlockState(i, j, k, BlockList.BLOCKHOLE_WALL.getDefaultState().withProperty(BlockBlockholeWall.INDEX, ((i-1) * 14 + (k-1))));
- }
- }
- }
- Chunk chunk = new Chunk(this.worldObj, primer, x, z);
- Biome[] abiome = this.worldObj.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
- byte[] abyte = chunk.getBiomeArray();
- for (int l = 0; l < abyte.length; ++l)
- {
- abyte[l] = (byte)Biome.getIdForBiome(abiome[l]);
- }
- return chunk;
- }
- @Override
- public void populate(int x, int z)
- {
- }
- @Override
- public boolean generateStructures(Chunk chunkIn, int x, int z)
- {
- return false;
- }
- @Override
- public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
- {
- return null;
- }
- @Override
- public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position)
- {
- return null;
- }
- @Override
- public void recreateStructures(Chunk chunkIn, int x, int z)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement