Jump to content

Recommended Posts

Posted

I am interested in doing a gas for my mod (among other things) that is light sensitive and reaction depends on the light level itself, is there a means to which I can detect how much light it recieves? or any proximal block suffices

Posted

This is the code I use to check it

 

	public boolean 	onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){

	if (!world.isRemote){
		System.out.println("Light value: " + world.getBlockLightValue(x, y, z));
		System.out.println("Light_do true value: " + world.getBlockLightValue_do(x, y, z, true));
		System.out.println("Light_do false value: " + world.getBlockLightValue_do(x, y, z, false));
		System.out.println("saved light block: " + world.getSavedLightValue(EnumSkyBlock.Block, x, y, z));		
		System.out.println("saved light sky: " + world.getSavedLightValue(EnumSkyBlock.Sky, x, y, z));			
	}
	return true;

}

This is what I get

Light value: 0

Light_do true value: 0

Light_do false value: 0

saved light block: 0

saved light sky: 0

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.