Java Code Examples for

The following examples show how to use . These examples are extracted from open source projects. 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 Project: MiningGadgets   File:    License: MIT License 5 votes vote down vote up
public List<BlockPos> findSources(World world, List<BlockPos> coords) {
    List<BlockPos> sources = new ArrayList<>();
    for (BlockPos coord : coords) {
        for (Direction side : Direction.values()) {
            BlockPos sidePos = coord.offset(side);
            IFluidState state = world.getFluidState(sidePos);
            if ((state.getFluid().isEquivalentTo(Fluids.LAVA) || state.getFluid().isEquivalentTo(Fluids.WATER)))
                if (!sources.contains(sidePos))
    return sources;