Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable crop growth light levels #9641

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JamieIsGeek
Copy link

@JamieIsGeek JamieIsGeek commented Aug 23, 2023

Closes #9631

@JamieIsGeek JamieIsGeek requested a review from a team as a code owner August 23, 2023 22:02
@Machine-Maker
Copy link
Member

So the problem with this, is that crops will break if they can't see the sky and have a light level lower than 8 (or smth close).

There are multiple light level and conditions for crops to grow, so idk how well a single configuration value will handle those.

@JamieIsGeek
Copy link
Author

Yeah I saw something lower down in the class about crop survival which I guess could also be turned into a config option?

@JamieIsGeek
Copy link
Author

There is this which is the only othert light dependant part of the CropBlock class so I'd assuming making this configurable would fix your issue?

@Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
    return (world.getRawBrightness(pos, 0) >= 8 || world.canSeeSky(pos)) && super.canSurvive(state, world, pos);
}

@Machine-Maker
Copy link
Member

Yeah, that would be one potential fix. I just wonder if an event allowing plugins to customize it more finely would be better. Idk how such an event would work tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

Growth Required Light Level
3 participants