@Override public boolean isFullBlock() { return state.isFullBlock(); }
@Override protected boolean canSustainBush(IBlockState state) { return state.isFullBlock(); }
@Override public boolean isSolid() { return state.isFullBlock(); }
private boolean doesStateBlockWater(IBlockState state) { return state.isFullBlock(); }
public boolean canEntityStandOnPos(BlockPos pos) { return this.world.getBlockState(pos).isFullBlock(); } }
public boolean isWall(World world, BlockPos pos, IBlockState state) { if(!state.isFullBlock() || !state.isOpaqueCube() || !STONE_PREDICATE.apply(state)) return false; return isBorder(world, pos, state); }
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) enumfacing = EnumFacing.SOUTH; else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) enumfacing = EnumFacing.NORTH; else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) enumfacing = EnumFacing.EAST; else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) enumfacing = EnumFacing.WEST; worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
private void setDefaultFacing(World world, BlockPos pos, IBlockState state) { if (!world.isRemote) { IBlockState blockNorth = world.getBlockState(pos.north()); IBlockState blockSouth = world.getBlockState(pos.south()); IBlockState blockWest = world.getBlockState(pos.west()); IBlockState blockEast = world.getBlockState(pos.east()); EnumFacing facing = state.getValue(FACING); if (facing == EnumFacing.NORTH && blockNorth.isFullBlock() && !blockSouth.isFullBlock()) { facing = EnumFacing.SOUTH; } else if (facing == EnumFacing.SOUTH && blockSouth.isFullBlock() && !blockNorth.isFullBlock()) { facing = EnumFacing.NORTH; } else if (facing == EnumFacing.WEST && blockWest.isFullBlock() && !blockEast.isFullBlock()) { facing = EnumFacing.EAST; } else if (facing == EnumFacing.EAST && blockEast.isFullBlock() && !blockWest.isFullBlock()) { facing = EnumFacing.WEST; } world.setBlockState(pos, state.withProperty(FACING, facing), 2); } }
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState northState = worldIn.getBlockState(pos.north()); IBlockState southState = worldIn.getBlockState(pos.south()); IBlockState westState = worldIn.getBlockState(pos.west()); IBlockState eastState = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && northState.isFullBlock() && !southState.isFullBlock()) enumfacing = EnumFacing.SOUTH; else if (enumfacing == EnumFacing.SOUTH && southState.isFullBlock() && !northState.isFullBlock()) enumfacing = EnumFacing.NORTH; else if (enumfacing == EnumFacing.WEST && westState.isFullBlock() && !eastState.isFullBlock()) enumfacing = EnumFacing.EAST; else if (enumfacing == EnumFacing.EAST && eastState.isFullBlock() && !westState.isFullBlock()) enumfacing = EnumFacing.WEST; worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
@Override public void onBlockAdded(World parWorld, BlockPos parBlockPos, IBlockState parIBlockState) { if (!parWorld.isRemote) { // Rotate block if the front side is blocked IBlockState blockToNorth = parWorld.getBlockState(parBlockPos.north()); IBlockState blockToSouth = parWorld.getBlockState(parBlockPos.south()); IBlockState blockToWest = parWorld.getBlockState(parBlockPos.west()); IBlockState blockToEast = parWorld.getBlockState(parBlockPos.east()); EnumFacing enumfacing = parIBlockState.getValue(FACING); if (enumfacing == EnumFacing.NORTH && blockToNorth.isFullBlock() && !blockToSouth.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && blockToSouth.isFullBlock() && !blockToNorth.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && blockToWest.isFullBlock() && !blockToEast.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && blockToEast.isFullBlock() && !blockToWest.isFullBlock()) { enumfacing = EnumFacing.WEST; } parWorld.setBlockState(parBlockPos, parIBlockState.withProperty(FACING, enumfacing), 2); } }
private void setDefaultDirection(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { EnumFacing enumfacing = state.getValue(LOOKING); boolean flag = worldIn.getBlockState(pos.north()).isFullBlock(); boolean flag1 = worldIn.getBlockState(pos.south()).isFullBlock(); if (enumfacing == EnumFacing.NORTH && flag && !flag1) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && flag1 && !flag) { enumfacing = EnumFacing.NORTH; } else { boolean flag2 = worldIn.getBlockState(pos.west()).isFullBlock(); boolean flag3 = worldIn.getBlockState(pos.east()).isFullBlock(); if (enumfacing == EnumFacing.WEST && flag2 && !flag3) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && flag3 && !flag2) { enumfacing = EnumFacing.WEST; } } worldIn.setBlockState(pos, state.withProperty(LOOKING, enumfacing), 2); } }
private boolean canBlowThrough(BlockPos tester) { //passes through air, and anything NOT a full block return this.getWorld().isAirBlock(tester) || !this.getWorld().getBlockState(tester).isFullBlock(); }
boolean isCeiling(World world, BlockPos pos, IBlockState state) { if(!state.isFullBlock() || !state.isOpaqueCube()) return false; BlockPos downPos = pos.down(); return world.isAirBlock(downPos) || world.getBlockState(downPos).getBlock().isReplaceable(world, downPos); }
boolean isFloor(World world, BlockPos pos, IBlockState state) { if(!state.isFullBlock() || !state.isOpaqueCube()) return false; BlockPos upPos = pos.up(); return world.isAirBlock(upPos) || world.getBlockState(upPos).getBlock().isReplaceable(world, upPos); }
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state, VariedChests.ChestType myType) { EnumFacing facing = null; for(EnumFacing horizFace : EnumFacing.Plane.HORIZONTAL) { if(getCustomType(worldIn, pos.offset(horizFace)) == myType) return state; if(worldIn.getBlockState(pos.offset(horizFace)).isFullBlock()) { if(facing != null) { facing = null; break; } facing = horizFace; } } if(facing != null) { return state.withProperty(FACING, facing.getOpposite()); } else { EnumFacing enumfacing2 = state.getValue(FACING); if(worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock()) enumfacing2 = enumfacing2.getOpposite(); if(worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock()) enumfacing2 = enumfacing2.rotateY(); if(worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock()) enumfacing2 = enumfacing2.getOpposite(); return state.withProperty(FACING, enumfacing2); } }
if (iblockstate.isFullBlock()) { if (enumfacing != null) { enumfacing = null; EnumFacing enumfacing2 = (EnumFacing) state.getValue(FACING); if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock()) { enumfacing2 = enumfacing2.getOpposite(); if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock()) { enumfacing2 = enumfacing2.rotateY(); if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock()) { enumfacing2 = enumfacing2.getOpposite();
@Override public void doExplosionB (boolean spawnParticles) { this.playExplosionSound(); this.spawnExplosionParticle(); for (final BlockPos blockpos : this.getAffectedBlockPositions()) { final IBlockState state = this.world.getBlockState(blockpos); final Block block = state.getBlock(); if (spawnParticles) { this.spawnBlockExplosionParticles(blockpos); } if (state.getMaterial() != Material.AIR) { this.destroyBlock(block, state, blockpos); } else if (this.doesCauseFire() && this.world.getBlockState(blockpos).getMaterial() == Material.AIR && this.world.getBlockState(blockpos.down()).isFullBlock() && this.random.nextInt(3) == 0) { this.world.setBlockState(blockpos, Blocks.FIRE.getDefaultState()); } } }
/** * Called when the {@link EntityCrossbowArrow} hits a block * * @param arrow The itemstack of the shot arrow * @param blockPos The position of the hit block * @param arrowEntity The arrow entity * @param shootingEntity The shooting entity. Can be the arrow entity itself */ public void onHitBlock(ItemStack arrow, BlockPos blockPos, EntityCrossbowArrow arrowEntity, Entity shootingEntity) { EnumArrowType type = getType(arrow); if (type == EnumArrowType.SPITFIRE) { for (int dx = -1; dx < 2; dx++) { for (int dy = -2; dy < 2; dy++) { for (int dz = -1; dz < 2; dz++) { BlockPos pos = blockPos.add(dx, dy, dz); if ((arrowEntity.getEntityWorld().getBlockState(pos).getMaterial() == Material.AIR || arrowEntity.getEntityWorld().getBlockState(pos).getBlock().isReplaceable(arrowEntity.getEntityWorld(), pos)) && arrowEntity.getEntityWorld().getBlockState(pos.down()).isFullBlock() && arrowEntity.getRNG().nextInt(4) != 0) { arrowEntity.getEntityWorld().setBlockState(pos, ModBlocks.alchemical_fire.getDefaultState()); } } } } } }