Jump to content

[1.7.10]Light value?


BuddingDev

Recommended Posts

Minecraft has 16 different light levels, 0 Being the darkest and 15 being lightest.

 

Light Level 15 would equal to the maximum light level a block can reach.

 

http://minecraft.gamepedia.com/Light

 

In code the range is 0F to 1.0F

 

float lightValue = 0F;
lightValue = 7/15; // Result 0.467F;

 

But any value from 0F to 1.0F would work :)

 

A better explanation: http://greyminecraftcoder.blogspot.com/2013/08/lighting.html

I require Java, both the coffee and the code :)

Link to comment
Share on other sites

Now here is an interesting question:

What if a [stroke]noob[/stroke] newbie called setLightValue(100F)?

How will Minecraft react?

 

I guess there is only one way to find out! :)

 

Although, I'm pretty sure it still is capped...

I require Java, both the coffee and the code :)

Link to comment
Share on other sites

<Nitpick>

float lightValue = 0F;
lightValue = 7/15; // Result 0.467F;

 

Actually the result there would be 0, because neither of those numbers (7 or 15) are floats.

</Nitpick>

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

<Nitpick>

float lightValue = 0F;
lightValue = 7/15; // Result 0.467F;

 

Actually the result there would be 0, because neither of those numbers (7 or 15) are floats.

</Nitpick>

 

HAHA Damn! I knew I should have added the float notation after the number, but my head just said this is an example no one would care :P, I was wrong hehe.

 

Moral of the story: The computer is a dumb machine, so tell it exactly what you need or else you will suffer the consequences :)

I require Java, both the coffee and the code :)

Link to comment
Share on other sites

Moral of the story: The computer is a dumb machine, so tell it exactly what you need or else you will suffer the consequences :)

 

To err is to be human.  To really fuck up, you need a computer.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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.