Java Code Examples for net.minecraft.init.Blocks.lava()
The following are Jave code examples for showing how to use
lava() of the
net.minecraft.init.Blocks
class.
You can vote up the examples you like. Your votes will be used in our system to get
more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft File: ChunkProviderGenerate.java View Source Code | 5 votes |
public ChunkProviderGenerate(World worldIn, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) { this.worldObj = worldIn; this.mapFeaturesEnabled = p_i45636_4_; this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); this.rand = new Random(p_i45636_2_); this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); this.field_147434_q = new double[825]; this.parabolicField = new float[25]; for (int i = -2; i <= 2; ++i) { for (int j = -2; j <= 2; ++j) { float f = 10.0F / MathHelper.sqrt_float((float)(i * i + j * j) + 0.2F); this.parabolicField[i + 2 + (j + 2) * 5] = f; } } if (p_i45636_5_ != null) { this.settings = ChunkProviderSettings.Factory.jsonToFactory(p_i45636_5_).func_177864_b(); this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; worldIn.func_181544_b(this.settings.seaLevel); } }
Example 2
Project: DecompiledMinecraft File: World.java View Source Code | 5 votes |
public boolean isFlammableWithin(AxisAlignedBB bb) { int i = MathHelper.floor_double(bb.minX); int j = MathHelper.floor_double(bb.maxX + 1.0D); int k = MathHelper.floor_double(bb.minY); int l = MathHelper.floor_double(bb.maxY + 1.0D); int i1 = MathHelper.floor_double(bb.minZ); int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) { BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int k1 = i; k1 < j; ++k1) { for (int l1 = k; l1 < l; ++l1) { for (int i2 = i1; i2 < j1; ++i2) { Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) { return true; } } } } } return false; }
Example 3
Project: DecompiledMinecraft File: BlockLiquid.java View Source Code | 5 votes |
public static BlockStaticLiquid getStaticBlock(Material materialIn) { if (materialIn == Material.water) { return Blocks.water; } else if (materialIn == Material.lava) { return Blocks.lava; } else { throw new IllegalArgumentException("Invalid material"); } }
Example 4
Project: DecompiledMinecraft File: ChunkProviderGenerate.java View Source Code | 5 votes |
public ChunkProviderGenerate(World worldIn, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) { this.worldObj = worldIn; this.mapFeaturesEnabled = p_i45636_4_; this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); this.rand = new Random(p_i45636_2_); this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); this.field_147434_q = new double[825]; this.parabolicField = new float[25]; for (int i = -2; i <= 2; ++i) { for (int j = -2; j <= 2; ++j) { float f = 10.0F / MathHelper.sqrt_float((float)(i * i + j * j) + 0.2F); this.parabolicField[i + 2 + (j + 2) * 5] = f; } } if (p_i45636_5_ != null) { this.settings = ChunkProviderSettings.Factory.jsonToFactory(p_i45636_5_).func_177864_b(); this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; worldIn.func_181544_b(this.settings.seaLevel); } }
Example 5
Project: DecompiledMinecraft File: World.java View Source Code | 5 votes |
public boolean isFlammableWithin(AxisAlignedBB bb) { int i = MathHelper.floor_double(bb.minX); int j = MathHelper.floor_double(bb.maxX + 1.0D); int k = MathHelper.floor_double(bb.minY); int l = MathHelper.floor_double(bb.maxY + 1.0D); int i1 = MathHelper.floor_double(bb.minZ); int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) { BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int k1 = i; k1 < j; ++k1) { for (int l1 = k; l1 < l; ++l1) { for (int i2 = i1; i2 < j1; ++i2) { Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) { return true; } } } } } return false; }
Example 6
Project: DecompiledMinecraft File: BlockLiquid.java View Source Code | 5 votes |
public static BlockStaticLiquid getStaticBlock(Material materialIn) { if (materialIn == Material.water) { return Blocks.water; } else if (materialIn == Material.lava) { return Blocks.lava; } else { throw new IllegalArgumentException("Invalid material"); } }
Example 7
Project: FundamentalChemistry File: TileVersatileGenerator.java View Source Code | 5 votes |
public int getHeatSource() { Block block = this.worldObj.getBlockState(this.pos.add(0,-1,0)).getBlock(); if(block == Blocks.fire) return 2; else if(block == Blocks.flowing_lava) return 2; else if(block == Blocks.lava) return 5; return 0; }
Example 8
Project: BaseClient File: ChunkProviderGenerate.java View Source Code | 5 votes |
public ChunkProviderGenerate(World worldIn, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) { this.worldObj = worldIn; this.mapFeaturesEnabled = p_i45636_4_; this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); this.rand = new Random(p_i45636_2_); this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); this.field_147434_q = new double[825]; this.parabolicField = new float[25]; for (int i = -2; i <= 2; ++i) { for (int j = -2; j <= 2; ++j) { float f = 10.0F / MathHelper.sqrt_float((float)(i * i + j * j) + 0.2F); this.parabolicField[i + 2 + (j + 2) * 5] = f; } } if (p_i45636_5_ != null) { this.settings = ChunkProviderSettings.Factory.jsonToFactory(p_i45636_5_).func_177864_b(); this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; worldIn.func_181544_b(this.settings.seaLevel); } }
Example 9
Project: BaseClient File: World.java View Source Code | 5 votes |
public boolean isFlammableWithin(AxisAlignedBB bb) { int i = MathHelper.floor_double(bb.minX); int j = MathHelper.floor_double(bb.maxX + 1.0D); int k = MathHelper.floor_double(bb.minY); int l = MathHelper.floor_double(bb.maxY + 1.0D); int i1 = MathHelper.floor_double(bb.minZ); int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) { BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int k1 = i; k1 < j; ++k1) { for (int l1 = k; l1 < l; ++l1) { for (int i2 = i1; i2 < j1; ++i2) { Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) { return true; } } } } } return false; }
Example 10
Project: BaseClient File: BlockLiquid.java View Source Code | 5 votes |
public static BlockStaticLiquid getStaticBlock(Material materialIn) { if (materialIn == Material.water) { return Blocks.water; } else if (materialIn == Material.lava) { return Blocks.lava; } else { throw new IllegalArgumentException("Invalid material"); } }
Example 11
Project: BaseClient File: ChunkProviderGenerate.java View Source Code | 5 votes |
public ChunkProviderGenerate(World worldIn, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) { this.worldObj = worldIn; this.mapFeaturesEnabled = p_i45636_4_; this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); this.rand = new Random(p_i45636_2_); this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); this.field_147434_q = new double[825]; this.parabolicField = new float[25]; for (int i = -2; i <= 2; ++i) { for (int j = -2; j <= 2; ++j) { float f = 10.0F / MathHelper.sqrt_float((float)(i * i + j * j) + 0.2F); this.parabolicField[i + 2 + (j + 2) * 5] = f; } } if (p_i45636_5_ != null) { this.settings = ChunkProviderSettings.Factory.jsonToFactory(p_i45636_5_).func_177864_b(); this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; worldIn.func_181544_b(this.settings.seaLevel); } }
Example 12
Project: BaseClient File: World.java View Source Code | 5 votes |
public boolean isFlammableWithin(AxisAlignedBB bb) { int i = MathHelper.floor_double(bb.minX); int j = MathHelper.floor_double(bb.maxX + 1.0D); int k = MathHelper.floor_double(bb.minY); int l = MathHelper.floor_double(bb.maxY + 1.0D); int i1 = MathHelper.floor_double(bb.minZ); int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) { BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int k1 = i; k1 < j; ++k1) { for (int l1 = k; l1 < l; ++l1) { for (int i2 = i1; i2 < j1; ++i2) { Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) { return true; } } } } } return false; }
Example 13
Project: BaseClient File: BlockLiquid.java View Source Code | 5 votes |
public static BlockStaticLiquid getStaticBlock(Material materialIn) { if (materialIn == Material.water) { return Blocks.water; } else if (materialIn == Material.lava) { return Blocks.lava; } else { throw new IllegalArgumentException("Invalid material"); } }
Example 14
Project: minecraft-quiverbow File: PowderKnuckle_Mod.java View Source Code | 5 votes |
void doMining(World world, EntityPlayerMP player, int x, int y, int z) // Calling this 27 times, to blast mine a 3x3x3 area { Block toBeBroken = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); if (toBeBroken.getBlockHardness(world, x, y, z) == -1) { return; } // Unbreakable if (toBeBroken.getHarvestLevel(meta) > 1) { return; } if (toBeBroken.getMaterial() == Material.water) { return; } if (toBeBroken.getMaterial() == Material.lava) { return; } if (toBeBroken.getMaterial() == Material.air) { return; } if (toBeBroken.getMaterial() == Material.portal) { return; } // Need to do checks here against invalid blocks if (toBeBroken == Blocks.water) { return; } if (toBeBroken == Blocks.flowing_water) { return; } if (toBeBroken == Blocks.lava) { return; } if (toBeBroken == Blocks.flowing_lava) { return; } if (toBeBroken == Blocks.obsidian) { return; } if (toBeBroken == Blocks.mob_spawner) { return; } // Crashing blocks: Redstone Lamp, Extended Piston // They're likely trying to drop things that cannot be dropped (active states of themselves) //WorldSettings.GameType gametype = WorldSettings.GameType.getByName("survival"); WorldSettings.GameType gametype = world.getWorldInfo().getGameType(); BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(world, gametype, player, x, y, z); if (event.isCanceled()) { return; } // Not allowed to do this //toBeBroken.dropBlockAsItem(world, x, x, z, meta, 0); // The last one is Fortune boolean removalSuccess = world.setBlockToAir(x, y, z); if (removalSuccess) { toBeBroken.onBlockDestroyedByPlayer(world, x, y, z, meta); } Item preBlockItem = toBeBroken.getItemDropped(meta, player.getRNG(), 0); if (preBlockItem == null) { return; } // Item doesn't exist ItemStack blockItem = new ItemStack(preBlockItem); blockItem.setItemDamage(meta); EntityItem entityItem = new EntityItem(world, x, y + 0.5d, z, blockItem); entityItem.delayBeforeCanPickup = 10; world.spawnEntityInWorld(entityItem); }
Example 15
Project: DecompiledMinecraft File: BlockModelShapes.java View Source Code | 4 votes |
public TextureAtlasSprite getTexture(IBlockState state) { Block block = state.getBlock(); IBakedModel ibakedmodel = this.getModelForState(state); if (ibakedmodel == null || ibakedmodel == this.modelManager.getMissingModel()) { if (block == Blocks.wall_sign || block == Blocks.standing_sign || block == Blocks.chest || block == Blocks.trapped_chest || block == Blocks.standing_banner || block == Blocks.wall_banner) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/planks_oak"); } if (block == Blocks.ender_chest) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/obsidian"); } if (block == Blocks.flowing_lava || block == Blocks.lava) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/lava_still"); } if (block == Blocks.flowing_water || block == Blocks.water) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/water_still"); } if (block == Blocks.skull) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/soul_sand"); } if (block == Blocks.barrier) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:items/barrier"); } } if (ibakedmodel == null) { ibakedmodel = this.modelManager.getMissingModel(); } return ibakedmodel.getParticleTexture(); }
Example 16
Project: BaseClient File: BlockModelShapes.java View Source Code | 4 votes |
public TextureAtlasSprite getTexture(IBlockState state) { Block block = state.getBlock(); IBakedModel ibakedmodel = this.getModelForState(state); if (ibakedmodel == null || ibakedmodel == this.modelManager.getMissingModel()) { if (block == Blocks.wall_sign || block == Blocks.standing_sign || block == Blocks.chest || block == Blocks.trapped_chest || block == Blocks.standing_banner || block == Blocks.wall_banner) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/planks_oak"); } if (block == Blocks.ender_chest) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/obsidian"); } if (block == Blocks.flowing_lava || block == Blocks.lava) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/lava_still"); } if (block == Blocks.flowing_water || block == Blocks.water) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/water_still"); } if (block == Blocks.skull) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/soul_sand"); } if (block == Blocks.barrier) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:items/barrier"); } } if (ibakedmodel == null) { ibakedmodel = this.modelManager.getMissingModel(); } return ibakedmodel.getParticleTexture(); }
Example 17
Project: BaseClient File: BlockModelShapes.java View Source Code | 4 votes |
public TextureAtlasSprite getTexture(IBlockState state) { Block block = state.getBlock(); IBakedModel ibakedmodel = this.getModelForState(state); if (ibakedmodel == null || ibakedmodel == this.modelManager.getMissingModel()) { if (block == Blocks.wall_sign || block == Blocks.standing_sign || block == Blocks.chest || block == Blocks.trapped_chest || block == Blocks.standing_banner || block == Blocks.wall_banner) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/planks_oak"); } if (block == Blocks.ender_chest) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/obsidian"); } if (block == Blocks.flowing_lava || block == Blocks.lava) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/lava_still"); } if (block == Blocks.flowing_water || block == Blocks.water) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/water_still"); } if (block == Blocks.skull) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/soul_sand"); } if (block == Blocks.barrier) { return this.modelManager.getTextureMap().getAtlasSprite("minecraft:items/barrier"); } } if (ibakedmodel == null) { ibakedmodel = this.modelManager.getMissingModel(); } return ibakedmodel.getParticleTexture(); }
Example 18
Project: minecraft-quiverbow File: FlintDust.java View Source Code | 4 votes |
@Override public void onImpact(MovingObjectPosition target) { if (target.entityHit != null) // We hit a living thing! { // Damage target.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), (float)this.damage); } else // Hit the terrain { Block block = this.worldObj.getBlock(target.blockX, target.blockY, target.blockZ); int meta = this.worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ); boolean breakThis = true; // Checking here against invalid blocks if (block == Blocks.bedrock) { breakThis = false; } else if (block == Blocks.water) { breakThis = false; } else if (block == Blocks.flowing_water) { breakThis = false; } else if (block == Blocks.lava) { breakThis = false; } else if (block == Blocks.flowing_lava) { breakThis = false; } else if (block == Blocks.obsidian) { breakThis = false; } else if (block == Blocks.mob_spawner) { breakThis = false; } else if (block.getMaterial() == Material.water) { breakThis = false; } else if (block.getMaterial() == Material.lava) { breakThis = false; } else if (block.getMaterial() == Material.air) { breakThis = false; } else if (block.getMaterial() == Material.portal) { breakThis = false; } else if (block.getHarvestLevel(meta) > 0) { breakThis = false; } else if (block.getBlockHardness(this.worldObj, target.blockX, target.blockY, target.blockZ) > 3) { breakThis = false; } if (this.shootingEntity instanceof EntityPlayerMP) { WorldSettings.GameType gametype = this.worldObj.getWorldInfo().getGameType(); BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(this.worldObj, gametype, (EntityPlayerMP) this.shootingEntity, target.blockX, target.blockY, target.blockZ); if (event.isCanceled()) { breakThis = false; } // Not allowed to do this } if (breakThis) // Nothing preventing us from breaking this block! { this.worldObj.setBlockToAir(target.blockX, target.blockY, target.blockZ); block.dropBlockAsItem(this.worldObj, target.blockX, target.blockY, target.blockZ, meta, 0); } } // SFX for (int i = 0; i < 4; ++i) { this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } this.worldObj.playSoundAtEntity(this, Block.soundTypeGravel.getBreakSound(), 1.0F, 1.0F); this.setDead(); // Hit something, so begone. }