allow the herbivorous absorber to also pick up flowers above and below it

Closes #19
This commit is contained in:
Ellpeck 2018-12-16 18:27:56 +01:00
parent ac3ce4d8cb
commit 8e6d29272b

View file

@ -32,14 +32,16 @@ public class TileEntityFlowerGenerator extends TileEntityImpl implements ITickab
List<BlockPos> possible = new ArrayList<>(); List<BlockPos> possible = new ArrayList<>();
int range = 3; int range = 3;
for (int x = -range; x <= range; x++) { for (int x = -range; x <= range; x++) {
for (int y = -1; y <= 1; y++) {
for (int z = -range; z <= range; z++) { for (int z = -range; z <= range; z++) {
BlockPos offset = this.pos.add(x, 0, z); BlockPos offset = this.pos.add(x, y, z);
IBlockState state = this.world.getBlockState(offset); IBlockState state = this.world.getBlockState(offset);
if (NaturesAuraAPI.FLOWERS.contains(state)) { if (NaturesAuraAPI.FLOWERS.contains(state)) {
possible.add(offset); possible.add(offset);
} }
} }
} }
}
if (possible.isEmpty()) if (possible.isEmpty())
return; return;