Advertisement
Eragonn14900

Untitled

Nov 30th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. package com.reactioncraft.desert.common.biome;
  2.  
  3. import java.util.Random;
  4. import com.reactioncraft.desert.common.*;
  5. import com.reactioncraft.integration.instances.IntegratedBlocks;
  6. import net.minecraft.block.*;
  7. import net.minecraft.block.material.Material;
  8. import net.minecraft.block.state.IBlockState;
  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.*;
  13. import net.minecraft.world.chunk.ChunkPrimer;
  14. import net.minecraft.world.gen.feature.WorldGenDesertWells;
  15. import net.minecraft.world.gen.feature.WorldGenFossils;
  16.  
  17. public class BiomeGenReactionDesert extends BiomeDesert
  18. {
  19. private static final IBlockState Ore = IntegratedBlocks.DesertBlocks.getDefaultState().withProperty(BlockDesertMulti.TYPE, EnumDesertBlocks.one1);
  20.  
  21. public BiomeGenReactionDesert(BiomeProperties par1)
  22. {
  23. super(par1);
  24. this.spawnableCreatureList.clear();
  25. this.topBlock = IntegratedBlocks.DarkSand.getDefaultState();
  26. this.fillerBlock = IntegratedBlocks.DarkSand.getDefaultState();
  27. }
  28.  
  29. @Override
  30. public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noiseVal)
  31. {
  32. this.generateBiomeTerrain(world, rand, primer, x, z, noiseVal);
  33. int localX = Math.floorMod(x, 16);
  34. int localZ = Math.floorMod(z, 16);
  35. for (int y = 0; y < 255; ++y)
  36. {
  37. if (primer.getBlockState(localX, y, localZ).getBlock() == Blocks.STONE)
  38. {
  39. primer.setBlockState(localX, y , localZ , Ore);
  40. //primer.setBlockState(localX, y, localZ , Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE));
  41. }
  42. }
  43. }
  44.  
  45. @Override
  46. public void decorate(World worldIn, Random rand, BlockPos pos)
  47. {
  48. super.decorate(worldIn, rand, pos);
  49.  
  50. if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DESERT_WELL))
  51. if (rand.nextInt(1000) == 0)
  52. {
  53. int i = rand.nextInt(16) + 8;
  54. int j = rand.nextInt(16) + 8;
  55. BlockPos blockpos = worldIn.getHeight(pos.add(i, 0, j)).up();
  56. (new WorldGenDesertWells()).generate(worldIn, rand, blockpos);
  57. }
  58.  
  59. if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
  60. if (rand.nextInt(64) == 0)
  61. {
  62. (new WorldGenFossils()).generate(worldIn, rand, pos);
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement