Java Code Examples for net.minecraft.client.renderer.WorldRenderer#getCombinedLight()

The following examples show how to use net.minecraft.client.renderer.WorldRenderer#getCombinedLight() . 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: PlanarLightMatrix.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
public int brightness(int side) {
    if ((sampled & 1 << side) == 0) {
        brightness[side] = WorldRenderer.getCombinedLight(access, pos);
        sampled |= 1 << side;
    }
    return brightness[side];
}
 
Example 2
Source File: LightMatrix.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void sample(int i) {
    if ((sampled & 1 << i) == 0) {
        BlockPos bp = new BlockPos(pos.getX() + (i % 3) - 1, pos.getY() + (i / 9) - 1, pos.getZ() + (i / 3 % 3) - 1);
        BlockState b = access.getBlockState(bp);
        bSamples[i] = WorldRenderer.getCombinedLight(access, bp);
        aSamples[i] = b.getAmbientOcclusionLightValue(access, bp);
        sampled |= 1 << i;
    }
}
 
Example 3
Source File: SimpleBrightnessModel.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
public int sample(int side) {
    if ((sampled & 1 << side) == 0) {
        c = pos.offset(Direction.BY_INDEX[side]);
        samples[side] = WorldRenderer.getCombinedLight(access, c);
        sampled |= 1 << side;
    }
    return samples[side];
}