mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-11 15:57:42 +00:00
28 lines
708 B
Java
28 lines
708 B
Java
package codechicken.lib.lighting;
|
|||
|
|
|
||
|
|
import net.minecraft.world.IBlockAccess;
|
||
|
|
import codechicken.lib.vec.BlockCoord;
|
||
|
|
|
||
|
|
public class LazyLightMatrix
|
||
|
|
{
|
||
|
|
private BlockCoord pos = new BlockCoord();
|
||
|
|
private IBlockAccess access;
|
||
|
|
private boolean computed = false;
|
||
|
|
private LightMatrix lightMatrix = new LightMatrix();
|
||
|
|
|
||
|
|
public LightMatrix lightMatrix()
|
||
|
|
{
|
||
|
|
if(computed)
|
||
|
|
return lightMatrix;
|
||
|
|
computed = true;
|
||
|
|
lightMatrix.computeAt(access, pos.x, pos.y, pos.z);
|
||
|
|
return lightMatrix;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setPos(IBlockAccess access, int x, int y, int z)
|
||
|
|
{
|
||
|
|
computed = false;
|
||
|
|
this.access = access;
|
||
|
|
pos.set(x, y, z);
|
||
|
|
}
|
||
|
|
}
|