-
Notifications
You must be signed in to change notification settings - Fork 20
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
crash caused by missing check of infinite loop of crop magic #341
Comments
Ah, I see what you're looking at - the |
Yes, he keeps recurring crashes on my server I tried to modify it to avoid the crash, although he might execute immediateBlockTick on the air block currently working well while (otherTargetPos.getY() < 255 && world.getBlockState(otherTargetPos.up()).getBlock() == block && !world.isAirBlock(otherTargetPos.up())) <255 is just an additional check but I think it makes sense otherTargetPos will check the top of the crop and its top for the first time. I guess this can correctly index things like sugar cane. taking into account the correct casting while ( world.getBlockState(otherTargetPos.up()).getBlock() == block) |
Would be better to fix this by blocking the |
thanks for your reply |
If you can verify that this solution works and causes no other issues, please create a Pull Request! |
4.3.4 - MC 1.12.2
wizardy:staff use some magic on plant,
some crop (like pam's harvestcraft)
It spreads horizontally and is always only one block high
In the open air will lead to infinite loops cause a crash
public class ModuleEffectThrive implements IModuleEffect {
while (world.getBlockState(otherTargetPos.up()).getBlock() == block) {
otherTargetPos = otherTargetPos.up();
state = world.getBlockState(otherTargetPos);
block = state.getBlock();
}
should we introduce some checks like this?
while (otherTargetPos.up().y < 255 || world.getBlockState(otherTargetPos.up()).getBlock() == block) {
}
The text was updated successfully, but these errors were encountered: