Skip to content

Instantly share code, notes, and snippets.

@Bogdan-G
Created April 28, 2016 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bogdan-G/495b6c5ae64d10d366062b7f86549140 to your computer and use it in GitHub Desktop.
Save Bogdan-G/495b6c5ae64d10d366062b7f86549140 to your computer and use it in GitHub Desktop.
1
public void enqueueRelightChecks()
{
for (int i = 0; i < 8; ++i)
{
if (this.queuedLightChecks >= 4096)
{
return;
}
int j = this.queuedLightChecks % 16;
int k = this.queuedLightChecks / 16 % 16;
int l = this.queuedLightChecks / 256;
++this.queuedLightChecks;
int i1 = (this.xPosition << 4) + k;
int j1 = (this.zPosition << 4) + l;
for (int k1 = 0; k1 < 16; ++k1)
{
int l1 = (j << 4) + k1;
if (this.storageArrays[j] == null && (k1 == 0 || k1 == 15 || k == 0 || k == 15 || l == 0 || l == 15) || this.storageArrays[j] != null && this.storageArrays[j].getBlockByExtId(k, k1, l).getMaterial() == Material.air)
{
if (this.worldObj.getBlock(i1, l1 - 1, j1).getLightValue() > 0)
{
this.worldObj.func_147451_t(i1, l1 - 1, j1);
}
if (this.worldObj.getBlock(i1, l1 + 1, j1).getLightValue() > 0)
{
this.worldObj.func_147451_t(i1, l1 + 1, j1);
}
if (this.worldObj.getBlock(i1 - 1, l1, j1).getLightValue() > 0)
{
this.worldObj.func_147451_t(i1 - 1, l1, j1);
}
if (this.worldObj.getBlock(i1 + 1, l1, j1).getLightValue() > 0)
{
this.worldObj.func_147451_t(i1 + 1, l1, j1);
}
if (this.worldObj.getBlock(i1, l1, j1 - 1).getLightValue() > 0)
{
this.worldObj.func_147451_t(i1, l1, j1 - 1);
}
if (this.worldObj.getBlock(i1, l1, j1 + 1).getLightValue() > 0)
{
this.worldObj.func_147451_t(i1, l1, j1 + 1);
}
this.worldObj.func_147451_t(i1, l1, j1);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment