Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

  • Author

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.