You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Any block placed such as a rail block will turn the grass into dirt. This is due to the lightreduction being a value of 15 on default for blocks and this code in the grassblock.cs in Craft.Net.Data
public override void OnScheduledUpdate(World world, Vector3 position)
{
var block = world.GetBlock(position + Vector3.Up);
if (block.LightReduction > 2)
world.SetBlock(position, new DirtBlock());
else
Grow(world, position, false);
base.OnScheduledUpdate(world, position);
}
Where (block.LightReduction > 2) is always going to be true for classes inheriting the block class.
At the moment I don't understand what's the point of having an integer for the light reduction code for blocks. I can see it being easier to just use a boolean. That's my understanding from looking at the code but you might have something in mind fore the future.
The text was updated successfully, but these errors were encountered:
In Minecraft each block is inherits a light value. This determines how much light the block "naturally gives off" or reflects. Certain blocks may reduce the light by more than one.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Any block placed such as a rail block will turn the grass into dirt. This is due to the lightreduction being a value of 15 on default for blocks and this code in the grassblock.cs in Craft.Net.Data
public override void OnScheduledUpdate(World world, Vector3 position)
{
var block = world.GetBlock(position + Vector3.Up);
if (block.LightReduction > 2)
world.SetBlock(position, new DirtBlock());
else
Grow(world, position, false);
base.OnScheduledUpdate(world, position);
}
Where (block.LightReduction > 2) is always going to be true for classes inheriting the block class.
At the moment I don't understand what's the point of having an integer for the light reduction code for blocks. I can see it being easier to just use a boolean. That's my understanding from looking at the code but you might have something in mind fore the future.
The text was updated successfully, but these errors were encountered: