net.minecraft.block.BlockSand Java Examples
The following examples show how to use
net.minecraft.block.BlockSand.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MoCChunkProviderWyvernLair.java From mocreaturesdev with GNU General Public License v3.0 | 6 votes |
/** * Populates chunk with ores etc etc */ public void populate_old(IChunkProvider par1IChunkProvider, int par2, int par3) { BlockSand.fallInstantly = true; MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, worldObj.rand, par2, par3, false)); int var4 = par2 * 16; int var5 = par3 * 16; BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); var6.decorate(this.worldObj, this.worldObj.rand, var4, var5); MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, worldObj.rand, par2, par3, false)); BlockSand.fallInstantly = false; }
Example #2
Source File: OilGeneratorFix.java From NewHorizonsCoreMod with GNU General Public License v3.0 | 5 votes |
private static boolean checkBlockAbove( World pWorld, int pLocX, int pLocY, int pLocZ ) { Block tBlock = pWorld.getBlock( pLocX, pLocY, pLocZ ); if(tBlock instanceof BlockSand) { return true; } if(tBlock instanceof BlockGravel) { return true; } return false; }
Example #3
Source File: BiomeCanyon.java From CommunityMod with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { int i = worldIn.getSeaLevel(); IBlockState iblockstate = this.topBlock; IBlockState iblockstate1 = this.fillerBlock; int j = -1; int k = (int) (noiseVal / 3.0D + 3.0D + rand.nextDouble() * 0.25D); int l = x & 15; int i1 = z & 15; BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int j1 = 255; j1 >= 0; --j1) { if (j1 <= rand.nextInt(5)) { chunkPrimerIn.setBlockState(i1, j1, l, BEDROCK); } else { IBlockState iblockstate2 = chunkPrimerIn.getBlockState(i1, j1, l); if (iblockstate2.getMaterial() == Material.AIR) { j = -1; } else if (iblockstate2.getBlock() == Blocks.STONE) { if (j == -1) { if (k <= 0) { iblockstate = AIR; iblockstate1 = STONE; } else if (j1 >= i - 4 && j1 <= i + 1) { iblockstate = this.topBlock; iblockstate1 = this.fillerBlock; } if (j1 < i && (iblockstate == null || iblockstate.getMaterial() == Material.AIR)) { if (this.getTemperature(blockpos$mutableblockpos.setPos(x, j1, z)) < 0.15F) { iblockstate = ICE; } else { iblockstate = WATER; } } j = k; if (j1 >= i - 1) { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate); } else if (j1 < i - 7 - k) { iblockstate = AIR; iblockstate1 = STONE; chunkPrimerIn.setBlockState(i1, j1, l, GRAVEL); } else { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); } } else if (j > 0) { --j; chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); if (j == 0 && iblockstate1.getBlock() == Blocks.SAND && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? RED_SANDSTONE : SANDSTONE; } if (j == 0 && iblockstate == redRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate = redRock; } if (j == 0 && iblockstate1 == redRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = redRock; } } } } } }
Example #4
Source File: BiomeCragCliffs.java From CommunityMod with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { int i = worldIn.getSeaLevel(); IBlockState iblockstate = this.topBlock; IBlockState iblockstate1 = this.fillerBlock; int j = -1; int k = (int) (noiseVal / 3.0D + 3.0D + rand.nextDouble() * 0.25D); int l = x & 15; int i1 = z & 15; BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int j1 = 255; j1 >= 0; --j1) { if (j1 <= rand.nextInt(5)) { chunkPrimerIn.setBlockState(i1, j1, l, BEDROCK); } else { IBlockState iblockstate2 = chunkPrimerIn.getBlockState(i1, j1, l); if (iblockstate2.getMaterial() == Material.AIR) { j = -1; } else if (iblockstate2.getBlock() == Blocks.STONE) { if (j == -1) { if (k <= 0) { iblockstate = AIR; iblockstate1 = STONE; } else if (j1 >= i - 4 && j1 <= i + 1) { iblockstate = this.topBlock; iblockstate1 = this.fillerBlock; } if (j1 < i && (iblockstate == null || iblockstate.getMaterial() == Material.AIR)) { if (this.getTemperature(blockpos$mutableblockpos.setPos(x, j1, z)) < 0.15F) { iblockstate = ICE; } else { iblockstate = WATER; } } j = k; if (j1 >= i - 1) { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate); } else if (j1 < i - 7 - k) { iblockstate = AIR; iblockstate1 = STONE; chunkPrimerIn.setBlockState(i1, j1, l, GRAVEL); } else { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); } } else if (j > 0) { --j; chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); if (j == 0 && iblockstate1.getBlock() == Blocks.SAND && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? RED_SANDSTONE : SANDSTONE; } if (j == 0 && iblockstate == blueRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate = blueRock; } if (j == 0 && iblockstate1 == blueRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = blueRock; } } } } } }
Example #5
Source File: BiomeCanyon.java From Traverse-Legacy-1-12-2 with MIT License | 4 votes |
@Override public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { int i = worldIn.getSeaLevel(); IBlockState iblockstate = this.topBlock; IBlockState iblockstate1 = this.fillerBlock; int j = -1; int k = (int) (noiseVal / 3.0D + 3.0D + rand.nextDouble() * 0.25D); int l = x & 15; int i1 = z & 15; BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int j1 = 255; j1 >= 0; --j1) { if (j1 <= rand.nextInt(5)) { chunkPrimerIn.setBlockState(i1, j1, l, BEDROCK); } else { IBlockState iblockstate2 = chunkPrimerIn.getBlockState(i1, j1, l); if (iblockstate2.getMaterial() == Material.AIR) { j = -1; } else if (iblockstate2.getBlock() == Blocks.STONE) { if (j == -1) { if (k <= 0) { iblockstate = AIR; iblockstate1 = STONE; } else if (j1 >= i - 4 && j1 <= i + 1) { iblockstate = this.topBlock; iblockstate1 = this.fillerBlock; } if (j1 < i && (iblockstate == null || iblockstate.getMaterial() == Material.AIR)) { if (this.getTemperature(blockpos$mutableblockpos.setPos(x, j1, z)) < 0.15F) { iblockstate = ICE; } else { iblockstate = WATER; } } j = k; if (j1 >= i - 1) { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate); } else if (j1 < i - 7 - k) { iblockstate = AIR; iblockstate1 = STONE; chunkPrimerIn.setBlockState(i1, j1, l, GRAVEL); } else { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); } } else if (j > 0) { --j; chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); if (j == 0 && iblockstate1.getBlock() == Blocks.SAND && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? RED_SANDSTONE : SANDSTONE; } if (j == 0 && iblockstate == redRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate = redRock; } if (j == 0 && iblockstate1 == redRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = redRock; } } } } } }
Example #6
Source File: BiomeCragCliffs.java From Traverse-Legacy-1-12-2 with MIT License | 4 votes |
@Override public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { int i = worldIn.getSeaLevel(); IBlockState iblockstate = this.topBlock; IBlockState iblockstate1 = this.fillerBlock; int j = -1; int k = (int) (noiseVal / 3.0D + 3.0D + rand.nextDouble() * 0.25D); int l = x & 15; int i1 = z & 15; BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int j1 = 255; j1 >= 0; --j1) { if (j1 <= rand.nextInt(5)) { chunkPrimerIn.setBlockState(i1, j1, l, BEDROCK); } else { IBlockState iblockstate2 = chunkPrimerIn.getBlockState(i1, j1, l); if (iblockstate2.getMaterial() == Material.AIR) { j = -1; } else if (iblockstate2.getBlock() == Blocks.STONE) { if (j == -1) { if (k <= 0) { iblockstate = AIR; iblockstate1 = STONE; } else if (j1 >= i - 4 && j1 <= i + 1) { iblockstate = this.topBlock; iblockstate1 = this.fillerBlock; } if (j1 < i && (iblockstate == null || iblockstate.getMaterial() == Material.AIR)) { if (this.getTemperature(blockpos$mutableblockpos.setPos(x, j1, z)) < 0.15F) { iblockstate = ICE; } else { iblockstate = WATER; } } j = k; if (j1 >= i - 1) { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate); } else if (j1 < i - 7 - k) { iblockstate = AIR; iblockstate1 = STONE; chunkPrimerIn.setBlockState(i1, j1, l, GRAVEL); } else { chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); } } else if (j > 0) { --j; chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); if (j == 0 && iblockstate1.getBlock() == Blocks.SAND && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? RED_SANDSTONE : SANDSTONE; } if (j == 0 && iblockstate == blueRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate = blueRock; } if (j == 0 && iblockstate1 == blueRock && k > 1) { j = rand.nextInt(4) + Math.max(0, j1 - 63); iblockstate1 = blueRock; } } } } } }
Example #7
Source File: MoCChunkProviderWyvernLair.java From mocreaturesdev with GNU General Public License v3.0 | 4 votes |
/** * Populates chunk with ores etc etc */ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { BlockSand.fallInstantly = true; MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, worldObj.rand, par2, par3, false)); int var4 = par2 * 16; int var5 = par3 * 16; BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); //this.RNGa.setSeed(this.worldObj.getSeed()); long var7 = this.RNGa.nextLong() / 2L * 2L + 1L; long var9 = this.RNGa.nextLong() / 2L * 2L + 1L; //this.RNGa.setSeed((long)par2 * var7 + (long)par3 * var9 ^ this.worldObj.getSeed()); boolean var11 = false; int var12; int var13; int var14; if (!var11 && this.RNGa.nextInt(2) == 0) { var12 = var4 + this.RNGa.nextInt(16) + 8; var13 = this.RNGa.nextInt(128); var14 = var5 + this.RNGa.nextInt(16) + 8; (new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.RNGa, var12, var13, var14); } if (!var11 && this.RNGa.nextInt(8) == 0) { var12 = var4 + this.RNGa.nextInt(16) + 8; var13 = this.RNGa.nextInt(this.RNGa.nextInt(120) + 8); var14 = var5 + this.RNGa.nextInt(16) + 8; if (var13 < 63 || this.RNGa.nextInt(10) == 0) { (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.RNGa, var12, var13, var14); } } var6.decorate(this.worldObj, this.RNGa, var4, var5); SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.RNGa); if (!portalDone) createPortal(this.worldObj, this.RNGa); /* while(!portalDone) { createPortal(this.worldObj, this.RNGa); } */ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, worldObj.rand, par2, par3, false)); BlockSand.fallInstantly = false; }