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

Basic fixes to Infernalfarm #44

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

Conversation

RockTheDev
Copy link

Description

Fixed infernalfarm so it would actually work - harvest, replant nether wart.

Changes

Added a check for blocks in 5 block radius 2 blocks above the machine for nether wart and fixed harvesting not resseting the age of the plant to 0.

Related Issues

None

Checklist

  • [+] I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • [+] I followed the existing code standards and didn't mess up the formatting.
  • [-] I did my best to add documentation to any public classes or methods I added.
  • [-] I have added Nonnull and Nullable annotations to my methods to indicate their behaviour for null values

Fixed infernalfarm so it would actually work - harvest, replant nether wart.
@RockTheDev RockTheDev requested a review from a team as a code owner November 4, 2020 15:18
Comment on lines +64 to +76
@Override
public void onBlockRegistered(Location location, boolean isPlacing) {
int range = RADIUS / 2;
Block block = location.getBlock();

for (int x = -range; x <= range; x++) {
for (int z = -range; z <= range; z++) {
blocks.add(block.getRelative(x, 2, z));
}
}

super.onBlockRegistered(location, isPlacing);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just horrible and redundant, by calling the super method you add all blocks on the same y level yet again.
And this is very redundant as it only deviates from the super method by a single parameter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the build is failing too...

Fixed building issue - missed an import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants