Created
February 8, 2017 17:59
-
-
Save DenWav/6e78f34e87330c31b270aeaee7265d31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void updateColorAsync(final World worldIn, final BlockPos glassPos) | |
{ | |
HttpUtil.DOWNLOADER_EXECUTOR.submit(new Runnable() | |
{ | |
public void run() | |
{ | |
Chunk chunk = worldIn.getChunkFromBlockCoords(glassPos); | |
for (int i = glassPos.getY() - 1; i >= 0; --i) | |
{ | |
final BlockPos blockpos = new BlockPos(glassPos.getX(), i, glassPos.getZ()); | |
if (!chunk.canSeeSky(blockpos)) | |
{ | |
break; | |
} | |
IBlockState iblockstate = worldIn.getBlockState(blockpos); | |
if (iblockstate.getBlock() == Blocks.BEACON) | |
{ | |
((WorldServer)worldIn).addScheduledTask(new Runnable() | |
{ | |
public void run() | |
{ | |
TileEntity tileentity = worldIn.getTileEntity(blockpos); | |
if (tileentity instanceof TileEntityBeacon) | |
{ | |
((TileEntityBeacon)tileentity).updateBeacon(); | |
worldIn.addBlockEvent(blockpos, Blocks.BEACON, 1, 0); | |
} | |
} | |
}); | |
} | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment