Advertisement
Guest User

ChunkProviderSingularity

a guest
Jan 31st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.27 KB | None | 0 0
  1. package com.limplungs.blockhole.dimensions;
  2.  
  3. import java.util.List;
  4.  
  5. import com.limplungs.blockhole.blocks.BlockBlockholeWall;
  6. import com.limplungs.blockhole.blocks.BlockList;
  7.  
  8. import net.minecraft.entity.EnumCreatureType;
  9. import net.minecraft.init.Blocks;
  10. import net.minecraft.util.math.BlockPos;
  11. import net.minecraft.world.World;
  12. import net.minecraft.world.biome.Biome;
  13. import net.minecraft.world.biome.Biome.SpawnListEntry;
  14. import net.minecraft.world.chunk.Chunk;
  15. import net.minecraft.world.chunk.ChunkPrimer;
  16. import net.minecraft.world.chunk.IChunkGenerator;
  17.  
  18. public class ChunkProviderSingularity implements IChunkGenerator
  19. {
  20.     private World worldObj;
  21.    
  22.     public ChunkProviderSingularity(World world)
  23.     {
  24.         this.worldObj = world;
  25.     }
  26.  
  27.     @Override
  28.     public Chunk provideChunk(int x, int z)
  29.     {
  30.         ChunkPrimer primer = new ChunkPrimer();
  31.        
  32.         for (int j = 0; j < 256; j++)
  33.         {
  34.             for (int i = 0; i < 16; i++)
  35.             {
  36.                 for (int k = 0; k < 16; k++)
  37.                 {
  38.                     primer.setBlockState(i, j, k, Blocks.AIR.getDefaultState());
  39.                 }
  40.             }
  41.         }
  42.        
  43.         if (x == 0 && z == 0)
  44.         {
  45.             int i = 0;
  46.             int j = 0;
  47.             int k = 0;
  48.  
  49.             for (i = 1; i < 15; i++)
  50.             {
  51.                 for (k = 1; k < 15; k++)
  52.                 {
  53.                     primer.setBlockState(i, j, k, BlockList.BLOCKHOLE_WALL.getDefaultState().withProperty(BlockBlockholeWall.INDEX, ((i-1) * 14 + (k-1))));
  54.                 }
  55.             }
  56.         }
  57.        
  58.  
  59.  
  60.         Chunk chunk = new Chunk(this.worldObj, primer, x, z);
  61.        
  62.         Biome[] abiome = this.worldObj.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
  63.         byte[] abyte = chunk.getBiomeArray();
  64.  
  65.         for (int l = 0; l < abyte.length; ++l)
  66.         {
  67.             abyte[l] = (byte)Biome.getIdForBiome(abiome[l]);
  68.         }
  69.        
  70.         return chunk;
  71.     }
  72.  
  73.     @Override
  74.     public void populate(int x, int z)
  75.     {
  76.        
  77.     }
  78.  
  79.     @Override
  80.     public boolean generateStructures(Chunk chunkIn, int x, int z)
  81.     {
  82.         return false;
  83.     }
  84.  
  85.     @Override
  86.     public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
  87.     {
  88.         return null;
  89.     }
  90.  
  91.     @Override
  92.     public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position)
  93.     {
  94.         return null;
  95.     }
  96.  
  97.     @Override
  98.     public void recreateStructures(Chunk chunkIn, int x, int z)
  99.     {
  100.        
  101.     }
  102.  
  103.    
  104.    
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement