Java Code Examples for net.minecraft.block.material.Material#LAVA
The following examples show how to use
net.minecraft.block.material.Material#LAVA .
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: GTTileRockBreaker.java From GT-Classic with GNU Lesser General Public License v3.0 | 6 votes |
private void checkStructure() { if (world.getTotalWorldTime() % 60 == 0) { EnumFacing foundSide = null; for (EnumFacing side : EnumFacing.VALUES) { IBlockState x = world.getBlockState(pos.offset(side)); IBlockState z = world.getBlockState(pos.offset(side.getOpposite())); if (x.getMaterial() == Material.WATER && x.getValue(BlockLiquid.LEVEL) == 0 && z.getMaterial() == Material.LAVA && z.getValue(BlockLiquid.LEVEL) == 0) { foundSide = side; break; } } if (foundSide == null) { this.rockMode = RockMode.INVALID; return; } this.rockMode = foundSide.getAxis().isHorizontal() ? RockMode.COBBLE : RockMode.STONE; } }
Example 2
Source File: JesusHack.java From ForgeWurst with GNU General Public License v3.0 | 5 votes |
private boolean isStandingOnLiquid(EntityPlayer player) { if(!isLiquidCollisionEnabled(player)) return false; World world = WPlayer.getWorld(player); boolean foundLiquid = false; boolean foundSolid = false; // check collision boxes below player AxisAlignedBB playerBox = player.getEntityBoundingBox(); playerBox = playerBox.union(playerBox.offset(0, -0.5, 0)); // Using expand() with negative values doesn't work in 1.10.2. for(AxisAlignedBB box : world.getCollisionBoxes(player, playerBox)) { BlockPos pos = new BlockPos(box.getCenter()); Material material = BlockUtils.getMaterial(pos); if(material == Material.WATER || material == Material.LAVA) foundLiquid = true; else if(material != Material.AIR) foundSolid = true; } return foundLiquid && !foundSolid; }
Example 3
Source File: ItemCybereyeUpgrade.java From Cyberware with MIT License | 5 votes |
@SubscribeEvent @SideOnly(Side.CLIENT) public void handleWaterVision(RenderBlockOverlayEvent event) { if (CyberwareAPI.isCyberwareInstalled(event.getPlayer(), new ItemStack(this, 1, 1))) { if (event.getBlockForOverlay().getMaterial() == Material.WATER || event.getBlockForOverlay().getMaterial() == Material.LAVA) { event.setCanceled(true); } } }
Example 4
Source File: EntityFallingBlockTFC.java From TFC2 with GNU General Public License v3.0 | 5 votes |
public boolean canFallInto(World worldIn, BlockPos pos) { if (worldIn.isAirBlock(pos)) return true; IBlockState state = worldIn.getBlockState(pos); Material material = state.getBlock().getMaterial(state); return (state.getBlock() == Blocks.FIRE) || (material == Material.AIR) || (material == Material.WATER) || (material == Material.LAVA) || state.getBlock().isReplaceable(worldIn, pos); }
Example 5
Source File: BlockGravity.java From TFC2 with GNU General Public License v3.0 | 5 votes |
@Override public boolean canFallInto(World worldIn, BlockPos pos) { if (worldIn.isAirBlock(pos)) return true; Block block = worldIn.getBlockState(pos).getBlock(); Material material = block.getMaterial(worldIn.getBlockState(pos)); return (block == Blocks.FIRE) || (material == Material.AIR) || (material == Material.WATER) || (material == Material.LAVA) || block.isReplaceable(worldIn, pos); }
Example 6
Source File: BlockValkyriumOre.java From Valkyrien-Skies with Apache License 2.0 | 4 votes |
public static boolean canFallThrough(IBlockState state) { Block block = state.getBlock(); Material material = state.getMaterial(); return block == Blocks.FIRE || material == Material.AIR || material == Material.WATER || material == Material.LAVA; }
Example 7
Source File: WeatherRenderer.java From TFC2 with GNU General Public License v3.0 | 4 votes |
public static void addRainParticles(Random random, int rendererUpdateCount) { Minecraft mc = Minecraft.getMinecraft(); WorldClient worldclient = mc.world; if(worldclient.provider.getDimension() != 0) return; float rainStrength = (float)WeatherManager.getInstance().getPrecipitation((int)mc.player.posX, (int)mc.player.posZ); double tempPlayer = WeatherManager.getInstance().getTemperature((int)mc.player.posX,(int)mc.player.posY, (int)mc.player.posZ); if(tempPlayer <= 0) return; if (!mc.gameSettings.fancyGraphics) { rainStrength /= 2.0F; } if (rainStrength > 0.0F) { worldclient.rand.setSeed((long)rendererUpdateCount * 312987231L); Entity entity = mc.getRenderViewEntity(); BlockPos blockpos = new BlockPos(entity); byte b0 = 10; double d0 = 0.0D; double d1 = 0.0D; double d2 = 0.0D; int i = 0; int rainParticles = Math.max((int)(100.0F * rainStrength * rainStrength), 4); if (mc.gameSettings.particleSetting == 1) { rainParticles >>= 1; } else if (mc.gameSettings.particleSetting == 2) { rainParticles = 0; } for (int k = 0; k < rainParticles; ++k) { BlockPos blockPos1 = worldclient.getPrecipitationHeight(blockpos.add(worldclient.rand.nextInt(b0) - worldclient.rand.nextInt(b0), 0, worldclient.rand.nextInt(b0) - worldclient.rand.nextInt(b0))); double temp = WeatherManager.getInstance().getTemperature(blockPos1); BlockPos blockpos2 = blockPos1.down(); IBlockState state = worldclient.getBlockState(blockpos2); Block block = worldclient.getBlockState(blockpos2).getBlock(); if (blockPos1.getY() <= blockpos.getY() + b0 && blockPos1.getY() >= blockpos.getY() - b0 && temp > 0) { float f1 = worldclient.rand.nextFloat(); float f2 = worldclient.rand.nextFloat(); AxisAlignedBB axisalignedbb = state.getBoundingBox(worldclient, blockpos2); if (block.getMaterial(state) == Material.LAVA) { mc.world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)((float)blockPos1.getX() + f1), (double)((float)blockPos1.getY() + 0.1F) - axisalignedbb.minY, (double)((float)blockPos1.getZ() + f2), 0.0D, 0.0D, 0.0D, new int[0]); } else if (block.getMaterial(state) != Material.AIR) { //block.setBlockBoundsBasedOnState(worldclient, blockpos2); ++i; if (worldclient.rand.nextInt(i) == 0) { d0 = (double)((float)blockpos2.getX() + f1); d1 = (double)((float)blockpos2.getY() + 0.1F) + axisalignedbb.maxY - 1.0D; d2 = (double)((float)blockpos2.getZ() + f2); } mc.world.spawnParticle(EnumParticleTypes.WATER_DROP, (double)((float)blockpos2.getX() + f1), (double)((float)blockpos2.getY() + 0.1F) + axisalignedbb.maxY, (double)((float)blockpos2.getZ() + f2), 0.0D, 0.0D, 0.0D, new int[0]); } } } if (i > 0 && worldclient.rand.nextInt(3) < rainSoundCounter++) { rainSoundCounter = 0; if (d1 > (double)(blockpos.getY() + 1) && worldclient.getPrecipitationHeight(blockpos).getY() > MathHelper.floor((float)blockpos.getY())) { mc.world.playSound(d0, d1, d2, SoundEvents.WEATHER_RAIN_ABOVE, SoundCategory.WEATHER, 0.1F*rainStrength, 0.5F, false); } else { mc.world.playSound(d0, d1, d2, SoundEvents.WEATHER_RAIN, SoundCategory.WEATHER, 0.2F*rainStrength, 1.0F, false); } } } }