mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-16 18:54:51 +00:00
Initial Commit
This commit is contained in:
1 parent
397135f687
commit
0f32dd8620
82 files changed
+10693
No files matched your search
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user